9.5 BLOCKCHAIN_TABLE
This command uses an extension of the DBMS_BLOCKCHAIN_TABLE
PL/SQL
package. A blockchain table is an append-only table designed for centralized blockchain
applications. V2 blockchain tables support schema evolution, delegate signatures, and
countersignatures in addition to the functionality found in V1 blockchain tables. Blockchain
tables support only DER encoding for X.509 certificates, not PEM encoding.
Syntax
blockchain_table|bl [add_interval_partitioning|addintpartition] |
[countersign_row|countersign] | desc | [delete_expired_rows|del] |
get_bytes_for_row_hash | get_bytes_for_row_signature | get_digest |
get_signed_digest | [sign_row|sign] |
[sign_row_with_countersignature|signandcountersign] | verify_rows | verify_table | verify_user_chains
The following table provides a description of each sub-command.
Sub-Command | Description |
---|---|
add_interval_partitioning | addintpartition | Adds interval partitioning to an existing, non-partitioned, V1 or V2 blockchain table. |
countersign_row | countersign | This command procures a countersignature on a specified row in a blockchain table.The countersignature will be produced by signing the row data content using the table owner's private key stored in the database wallet. |
desc | Use this command to describe the details of the Blockchain table. |
delete_expired_rows | del | Delete some or all expired rows in the blockchain table. |
get_bytes_for_row_hash | This command returns in row_data the bytes for the particular row identified (a series of meta-data-value, column-data-value pairs in column position order) followed by the hash for the previous row in the chain in the data format specified. |
get_bytes_for_row_signature | This command returns the bytes used to compute a user signature, a delegate signature, or a countersignature. For a user signature or a delegate signature, the command returns in row_data the bytes in the hash in the row without any metadata. |
get_digest | This command generates and returns a cryptographic hash of the digest for user-specified rows or for a specified blockchain table. |
get_signed_digest | This command generates and returns the signed digest for user-specified rows (if specified) in a blockchain table using the table owner's private key stored in the database wallet. The particular rows in the digest are specified by the selector parameter. The default value of this field is null. The signed_bytes, signed_row_indexes, and schema_certificate_guid are also returned. |
sign_row | sign | This command can be used by the current user to provide a signature on the row content of a previously inserted row. |
sign_row_with_countersignature | signandcountersign | It is an extension of SIGN_ROW command that enables the user to request a countersignature from the database.The countersignature is produced by signing the row data content using the table owner's private key stored in the database wallet. |
verify_rows | This command verifies all rows on all applicable system chains for the integrity of HASH column value for rows created in the range of low_timestamp to high_timestamp. Row signatures can be verified as an option. |
verify_table | This command verifies all rows whose creation-time falls between the minimum value for the row-creation time from begin_bytes_file and the maximum value for row-creation time from end_bytes_file, and returns the number of successfully verified rows. |
verify_user_chains | This command verifies rows of one or more user chains when the user chains feature is enabled on the blockchain table. |
For more information such as syntax and examples for each sub-command, enter help
blockchain_table
in the SQLcl command-line help.