Oracle DBMS_BLOCKCHAIN_TABLE
Version 26ai

General Information
Library Note Morgan's Library Page Header
The best Oracle News for FY2026

Oracle Database 26ai is now availble. If you haven't you downloaded already: Why?
Purpose A blockchain table is an append-only table designed for centralized blockchain applications.

In an Oracle Blockchain Table, peers are database users who trust the database to maintain a tamper-resistant ledger which is implemented as a blockchain table,

A blockchain table is defined and managed by the application. Existing applications can protect against fraud without requiring a new infrastructure or programming model. And, although transaction throughput is lower than for a standard heap table, performance for a blockchain table is better than for a decentralized blockchain.

The DBMS_BLOCKCHAIN_TABLE package lets you do the following:
  • delete rows in a blockchain table that are beyond the row retention defined for the blockchain table
  • get the bytes that are input to the signature algorithm so you can sign a row you inserted into the blockchain table
  • get the bytes that are input to the cryptographic hash for a row so you can verify the hash in the row
  • sign a row you inserted into a blockchain table after the row is added to a chain in the blockchain table
  • have the database verify the hashes and signatures on some or all rows in a blockchain table
AUTHID CURRENT_USER
Constants
Name Data Type Value
 Hashing Algorithmsl
HASH_ALGO_SHA2_256 NUMBER 1
HASH_ALGO_SHA2_384 NUMBER 2
HASH_ALGO_SHA2_512 NUMBER 3
HASH_ALGO_DEFAULT NUMBER 3
 Signing Algorithmsl
SIGN_ALGO_RSA_SHA2_256 NUMBER 1
SIGN_ALGO_RSA_SHA2_384 NUMBER 2
SIGN_ALGO_RSA_SHA2_512 NUMBER 3
SIGN_ALGO_DEFAULT NUMBER 3
Dependencies
ALL_OBJECTS DBMS_FLASHBACK_ARCHIVE NLS_DATABASE_PARAMETERS
ALL_USERS DBMS_LOB ORABCTAB_ROW_ARRAY_T
DBMS_AQADM_LIB DBMS_UTILITY UTL_I18N
DBMS_ASSERT DUAL UTL_RAW
DBMS_BLOCKCHAIN_TABLE_LIB KUPM$MCP  
Documented Yes: Packages and Types Reference
Exceptions
Error Code Reason
ORA-05720 <table_name> is not a blockchain table
First Available 20c
Pragma PRAGMA SUPPLEMENTAL_LOG_DATA(default, NONE);
Security Model Owned by SYS with EXECUTE granted to PUBLIC
Source {ORACLE_HOME}/rdbms/admin/dbmsbctab.sql
{ORACLE_HOME}/rdbms/admin/prvtbctab.plb
Subprograms
ADD_INTERVAL_PARTITIONING
BLOCKCHAIN_DML_NOREPL
COUNTERSIGN_ROW
COUNTERSIGN_ROW_SPECIFIED_BY_KEY_COLUMNS
DELETE_EXPIRED_ROWS
GET_BLOCKCHAIN_DIGEST
GET_BLOCKCHAIN_DIGEST_FOR_SELECTED_ROWS
GET_BYTES_FOR_ROW_HASH
GET_BYTES_FOR_ROW_HASH_SPECIFIED_BY_KEY _COLUMNS
GET_BYTES_FOR_ROW_SIGNATURE
GET_BYTES_FOR_ROW_SIGNATURE_SPECIFIED_BY _KEY_COLUMNS
GET_SIGNED_BLOCKCHAIN_DIGEST
GET_SIGNED_BLOCKCHAIN_DIGEST_FOR_SELECTED_ROWS
IMPORT_CHAIN
IMPORT_DROPPED
IMPORT_EPOCH
IMPORT_ROW_VERSION_VALUES
SIGN_ROW
SIGN_ROW_SPECIFIED_BY_KEY_COLUMNS
SIGN_ROW_SPECIFIED_BY_KEY_COLUMNS _WITH_COUNTERSIGNATURE
SIGN_ROW_WITH_COUNTERSIGNATURE
VERIFY_ROWS
VERIFY_TABLE_BLOCKCHAIN
VERIFY_USER_BLOCKCHAIN_ROWS
 
ADD_INTERVAL_PARTITIONING (new 23ai)
Adds internal partitioning to an existing, non-partitioned, V1 or V2 blockchain table dbms_blockchain_table.add_interval_partitioning(
schema_name          IN VARCHAR2,
table_name           IN VARCHAR2,
interval_number      IN NUMBER,
interval_frequency   IN VARCHAR2,
first_high_timestamp IN TIMESTAMP);
TBD
 
BLOCKCHAIN_DML_NOREPL (new 23ai)
Undocumented dbms_blockchain_table.blockchain_dml_norepl;
exec dbms_blockchain_table.blockchain_dml_norepl;
 
COUNTERSIGN_ROW (new 23ai)
Procures a countersignature on a specified row in a blockchain table dbms_blockchain_table.countersign_row(
schema_name                       IN    VARCHAR2,
table_name                        IN    VARCHAR2,
instance_id                       IN    NUMBER,
chain_id                          IN    NUMBER,
sequence_id                       IN    NUMBER,
countersignature_algo             IN    NUMBER    DEFAULT sign_algo_default,
countersignature_signed_bytes     IN OUT BLOB,
countersignature                     OUT RAW,
countersignature_certificate_guid    OUT RAW,
countersignature_content_version  IN     VARCHAR2 DEFAULT 'V2_DIGEST',
pdb_guid                          IN     RAW      DEFAULT NULL);
TBD
 
COUNTERSIGN_ROW_SPECIFIED_BY_KEY_COLUMNS (new 23ai)
Uses, at most, 3 user columns, to identify exactly one blockchain table row and procures a countersign for that row dbms_blockchain_table.countersign_row_specified_by_key_columns(
schema_name                       IN     VARCHAR2,
table_name                        IN     VARCHAR2,
keycol1_name                      IN     VARCHAR2,
keycol1_value                     IN     VARCHAR2,
keycol2_name                      IN     VARCHAR2 DEFAULT NULL,
keycol2_value                     IN     VARCHAR2 DEFAULT NULL,
keycol3_name                      IN     VARCHAR2 DEFAULT NULL,
keycol3_value                     IN     VARCHAR2 DEFAULT NULL,
countersignature_algo             IN     NUMBER   DEFAULT SIGN_ALGO_DEFAULT,
countersignature_signed_bytes     IN OUT BLOB,
countersignature                     OUT RAW,
countersignature_certificate_guid    OUT RAW,
countersignature_content_version  IN     VARCHAR2 DEFAULT 'V2_DIGEST',
pdb_guid                          IN     RAW      DEFAULT NULL);
TBD
 
DELETE_EXPIRED_ROWS
Deletes rows outside the retention window created before before_timestamp if the time stamp is specified; otherwise, deletes all rows outside the retention window. dbms_blockchain_table.delete_expired_rows(
schema_name            IN  VARCHAR2,
table_name             IN  VARCHAR2,
before_timestamp       IN  TIMESTAMP WITH TIME ZONE DEFAULT NULL,
number_of_rows_deleted OUT NUMBER);
DECLARE
 rowsDel NUMBER;
BEGIN
  dbms_blockchain_table.delete_expired_rows('UWCLASS', 'LEDGER', NULL, rowsDel);
  dbms_output.put_line(TO_CHAR(rowsDel) || ' rows deleted');
END;
/
8 rows deleted
 
GET_BLOCKCHAIN_DIGEST (new 23ai)
Undocumented dbms_blockchain_table.get_blockchain_digest(
schema_name         IN     VARCHAR2,
table_name          IN     VARCHAR2,
digest_bytes        IN OUT BLOB,
digest_rows_indexes    OUT orabctab_row_array_t,
hash_algo           IN     NUMBER DEFAULT HASH_ALGO_DEFAULT)
RETURN RAW;
TBD
 
GET_BLOCKCHAIN_DIGEST_FOR_SELECTED_ROWS (new 23ai)
Undocumented dbms_blockchain_table.get_blockchain_digest_for_selected_rows(
schema_name         IN     VARCHAR2,
table_name          IN     VARCHAR2,
row_selector        IN     VARCHAR2,
digest_bytes        IN OUT BLOB,
row_data_bytes      IN OUT BLOB,
digest_rows_indexes    OUT orabctab_row_array_t,
hash_algo           IN     NUMBER DEFAULT HASH_ALGO_DEFAULT)
RETURN RAW;
TBD
 
GET_BYTES_FOR_ROW_HASH (new 23ai parameter)
Returns in row_data the bytes (series of {meta-data-value} {column-data-value} in column position order} for the particular row identified, followed by the hash (in data format) for previous row in the chain, in the data format supported. dbms_blockchain_table.get_bytes_for_row_hash(
schema_name IN     VARCHAR2,
table_name  IN     VARCHAR2,
instance_id IN     NUMBER,
chain_id    IN     NUMBER,
sequence_id IN     NUMBER,
data_format IN     NUMBER,
row_data    IN OUT BLOB,
chain_name  IN     VARCHAR2 DEFAULT NULL,
pdb_guid    IN     RAW      DEFAULT NULL);
TBD
 
GET_BYTES_FOR_ROW_HASH_SPECIFIED_BY_KEY_COLUMNS (new 23ai)
Uses at most 3 columns to uniquely identify a row dbms_blockchain_table.get_bytes_for_row_hash_specified_by_key_columns(
schema_name   IN     VARCHAR2,
table_name    IN     VARCHAR2,
data_format   IN     NUMBER,
row_data      IN OUT BLOB,
chain_name    IN     VARCHAR2 DEFAULT NULL,
keycol1_name  IN     VARCHAR2,
keycol1_value IN     VARCHAR2,
keycol2_name  IN     VARCHAR2 DEFAULT NULL,
keycol2_value IN     VARCHAR2 DEFAULT NULL,
keycol3_name  IN     VARCHAR2 DEFAULT NULL,
keycol3_value IN     VARCHAR2 DEFAULT NULL,
pdb_guid      IN     RAW      DEFAULT NULL);
TBD
 
GET_BYTES_FOR_ROW_SIGNATURE (new 23ai parameters)
Bytes returned are the bytes in the row hash. No metadata is included. dbms_blockchain_table.get_bytes_for_row_signature(
schema_name    IN     VARCHAR2,
table_name     IN     VARCHAR2,
instance_id    IN     NUMBER,
chain_id       IN     NUMBER,
sequence_id    IN     NUMBER,
data_format    IN     NUMBER,
row_data       IN OUT BLOB,
pdb_guid       IN     RAW     DEFAULT NULL,
signature_type IN     VARCHAR2 DEFAULT 'USER');
TBD
GET_BYTES_FOR_ROW_SIGNATURE_SPECIFIED_BY _KEY_COLUMNS (new 23ai)
Uses at most 3 columns to uniquely identify a row dbms_blockchain_table.get_bytes_for_row_signature_specified_by_key_columns(
schema_name    IN     VARCHAR2,
table_name     IN     VARCHAR2,
data_format    IN     NUMBER,
row_data       IN OUT BLOB,
keycol1_name   IN     VARCHAR2,
keycol1_value  IN     VARCHAR2,
keycol2_name   IN     VARCHAR2 DEFAULT NULL,
keycol2_value  IN     VARCHAR2 DEFAULT NULL,
keycol3_name   IN     VARCHAR2 DEFAULT NULL,
keycol3_value  IN     VARCHAR2 DEFAULT NULL,
pdb_guid       IN     RAW      DEFAULT NULL,
signature_type IN     VARCHAR2 DEFAULT 'USER');
TBD
 
GET_SIGNED_BLOCKCHAIN_DIGEST (new 23ai parameters)
Generates the signed digest for a specified blockchain table using the table owner's private key stored in the database wallet dbms_blockchain_table.get_signed_blockchain_digest(
schema_name             IN VARCHAR2,
table_name              IN VARCHAR2,
signed_bytes            IN OUT BLOB,
signed_rows_indexes        OUT orabctab_row_array_t,
schema_certificate_guid    OUT RAW,
signature_algo          IN     NUMBER DEFAULT sign_algo_default)
RETURN RAW;
TBD
 
GET_SIGNED_BLOCKCHAIN_DIGEST_FOR_SELECTED_ROWS (new 23ai)
Undocumented dbms_blockchain_table.get_signed_blockchain_digest_for_selected_rows(
schema_name             IN     VARCHAR2,
table_name              IN     VARCHAR2,
row_selector            IN     VARCHAR2,
signed_bytes            IN OUT BLOB,
row_data_bytes          IN OUT BLOB,
signed_rows_indexes        OUT orabctab_row_array_t,
schema_certificate_guid    OUT RAW,
signature_algo          IN     NUMBER DEFAULT SIGN_ALGO_DEFAULT)
RETURN RAW;
TBD
 
IMPORT_CHAIN (new 23ai parameters)
Undocumented dbms_blockchain_table.import_chain(
schema_name IN VARCHAR2,
table_name  IN VARCHAR2,
instance_id IN NUMBER,
chain_id    IN NUMBER,
epoch_num   IN NUMBER,
hash        IN RAW,
min_seqnum  IN NUMBER,
max_seqnum  IN NUMBER,
last_ctime  IN TIMESTAMP WITH TIME ZONE DEFAULT SYSTIMESTAMP,
pdb_guid    IN RAW                      DEFAULT NULL,
del_seqnum  IN NUMBER                   DEFAULT NULL,
del_hash    IN RAW                      DEFAULT NULL);
TBD
 
IMPORT_DROPPED (new 23ai)
Undocumented dbms_blockchain_table.import_dropped(
schema_name IN VARCHAR2,
table_name  IN VARCHAR2,
drop_time   IN TIMESTAMP WITH TIME ZONE);
TBD
 
IMPORT_EPOCH (new 23ai parameters)
Undocumented dbms_blockchain_table.import_epoch(
schema_name   IN VARCHAR2,
table_name    IN VARCHAR2,
epoch_num     IN NUMBER,
reason_id     IN NUMBER,
pdb_guid      IN RAW,
hash_algo     IN NUMBER,
hash_format   IN NUMBER,
is_last_epoch IN BOOLEAN                  DEFAULT FALSE,
col_pos_max   IN NUMBER                   DEFAULT NULL,
col_pos_vec   IN RAW                      DEFAULT NULL,
start_time    IN TIMESTAMP WITH TIME ZONE DEFAULT SYSTIMESTAMP,
delete_time   IN TIMESTAMP WITH TIME ZONE DEFAULT NULL);
TBD
 
IMPORT_ROW_VERSION_VALUES (new 23ai)
Undocumented dbms_blockchain_table.import_row_version_values(
schema_name      IN VARCHAR2,
table_name       IN VARCHAR2,
pdb_guid         IN RAW,
row_version_name IN VARCHAR2,
keycol1_value    IN VARCHAR2,
keycol2_value    IN VARCHAR2                  DEFAULT NULL,
keycol3_value    IN VARCHAR2                  DEFAULT NULL,
version_num      IN NUMBER,
hash             IN RAW                       DEFAULT NULL,
create_time      IN TIMESTAMP WITH TIME ZONE,
inst_id          IN NUMBER                    DEFAULT NULL,
tran_id          IN VARCHAR2                  DEFAULT NULL);
TBD
 
SIGN_ROW (new 23ai parameter)
Provides a signature on row content of a previously inserted row. The user who inserted a row into a blockchain table is the only user that can sign the row. dbms_dbms_blockchain_table.sign_row(
schema_name      IN VARCHAR2,
table_name       IN VARCHAR2,
instance_id      IN NUMBER,
chain_id         IN NUMBER,
sequence_id      IN NUMBER,
hash             IN RAW     DEFAULT NULL,
signature        IN RAW,
certificate_guid IN RAW,
signature_algo   IN NUMBER,
delegate         IN BOOLEAN DEFAULT FALSE,
pdb_guid         IN RAW     DEFAULT NULL);
TBD
 
SIGN_ROW_SPECIFIED_BY_KEY_COLUMNS (new 23ai)
Allows the current user to provide a signature on the row content of a previously inserted row dbms_blockchain_table.sign_row_specified_by_key_columns(
schema_name      IN VARCHAR2,
table_name       IN VARCHAR2,
hash             IN RAW      DEFAULT NULL,
signature        IN RAW,
certificate_guid IN RAW,
signature_algo   IN NUMBER,
delegate         IN BOOLEAN  DEFAULT FALSE,
keycol1_name     IN VARCHAR2,
keycol1_value    IN VARCHAR2,
keycol2_name     IN VARCHAR2 DEFAULT NULL,
keycol2_value    IN VARCHAR2 DEFAULT NULL,
keycol3_name     IN VARCHAR2 DEFAULT NULL,
keycol3_value    IN VARCHAR2 DEFAULT NULL,
pdb_guid         IN RAW      DEFAULT NULL);
TBD
 
SIGN_ROW_SPECIFIED_BY_KEY_COLUMNS_WITH_COUNTERSIGNATURE (new 23ai)
Uses at most 3 user columns names and values to uniquely identify a single row to sign and countersign dbms_blockchain_table.sign_row_specified_by_key_columns_with_countersignature(
schema_name                       IN VARCHAR2,
table_name                        IN VARCHAR2,
hash                              IN RAW      DEFAULT NULL,
signature                         IN RAW,
certificate_guid                  IN RAW,
signature_algo                    IN NUMBER,
delegate                          IN BOOLEAN  DEFAULT FALSE,
keycol1_name                      IN VARCHAR2,
keycol1_value                     IN VARCHAR2,
keycol2_name                      IN VARCHAR2 DEFAULT NULL,
keycol2_value                     IN VARCHAR2 DEFAULT NULL,
keycol3_name                      IN VARCHAR2 DEFAULT NULL,
keycol3_value                     IN VARCHAR2 DEFAULT NULL,
countersignature_algo             IN NUMBER   DEFAULT SIGN_ALGO_DEFAULT,
countersignature_signed_bytes     IN OUT BLOB,
countersignature                     OUT RAW,
countersignature_certificate_guid    OUT RAW,
countersignature_content_version  IN VARCHAR2 DEFAULT 'V2_DIGEST',
pdb_guid                          IN RAW      DEFAULT NULL);
TBD
 
SIGN_ROW_WITH_COUNTERSIGNATURE (new 23ai)
Allows a user to request a countersignature fro the database dbms_blockchain_table.sign_row_with_countersignature(
schema_name                       IN     VARCHAR2,
table_name                        IN     VARCHAR2,
instance_id                       IN     NUMBER,
chain_id                          IN     NUMBER,
sequence_id                       IN     NUMBER,
hash                              IN     RAW      DEFAULT NULL,
signature                         IN     RAW,
certificate_guid                  IN     RAW,
signature_algo                    IN     NUMBER,
delegate                          IN     BOOLEAN  DEFAULT FALSE,
countersignature_algo             IN     NUMBER   DEFAULT SIGN_ALGO_DEFAULT,
countersignature_signed_bytes     IN OUT BLOB,
countersignature                     OUT RAW,
countersignature_certificate_guid    OUT RAW,
countersignature_content_version  IN     VARCHAR2 DEFAULT 'V2_DIGEST',
pdb_guid                          IN     RAW      DEFAULT NULL);
TBD
 
VERIFY_ROWS (new 23ai parameters)
Verifies all rows on all applicable chains for integrity of HASH column value for rows created in the range of LOW_TIMESTAMP to HIGH_TIMESTAMP. Optionally verifies row signatures. dbms_blockchain_table.verify_rows(
schema_name               IN  VARCHAR2,
table_name                IN  VARCHAR2,
low_timestamp             IN  TIMESTAMP WITH TIME ZONE DEFAULT NULL,
high_timestamp            IN  TIMESTAMP WITH TIME ZONE DEFAULT NULL,
instance_id               IN  NUMBER                   DEFAULT NULL,
chain_id                  IN  NUMBER                   DEFAULT NULL,
number_of_rows_verified   OUT NUMBER,
verify_signature          IN  BOOLEAN                  DEFAULT TRUE,
verify_delegate_signature IN  BOOLEAN                  DEFAULT TRUE,
verify_countersignature   IN  BOOLEAN                  DEFAULT TRUE,
pdb_guid                  IN  RAW                      DEFAULT NULL);
TBD
 
VERIFY_TABLE_BLOCKCHAIN
Verifies all rows with creation times between the minimum value for the row creation time from signed_buffer_previous and the maximum valuefor signed_buffer_latest and returns the number of successfully verified rows dbms_blockchain_table.verify_table_blockchain(
bytes_latest              IN  BLOB    DEFAULT NULL,
bytes_previous            IN  BLOB    DEFAULT NULL,
number_of_rows_verified   OUT NUMBER,
verify_signature          IN  BOOLEAN DEFAULT TRUE,
verify_delegate_signature IN  BOOLEAN DEFAULT TRUE,
verify_countersignature   IN  BOOLEAN DEFAULT TRUE,
signed_bytes_latest       IN  BLOB    DEFAULT NULL,
signed_bytes_previous     IN  BLOB    DEFAULT NULL);
TBD
 
VERIFY_USER_BLOCKCHAIN_ROWS (new 23ai)
Verifies row of one or more user chains when the user chains feature is enabled on the blockchain table dbms_blockchain_table.verify_user_blockchain_rows(
schema_name                IN  VARCHAR2,
table_name                 IN  VARCHAR2,
row_version_name           IN  VARCHAR2,
number_of_rows_verified    OUT NUMBER,
keycol1_value              IN  VARCHAR2                 DEFAULT NULL,
keycol2_value              IN  VARCHAR2                 DEFAULT NULL,
keycol3_value              IN  VARCHAR2                 DEFAULT NULL,
low_timestamp              IN  TIMESTAMP WITH TIME ZONE DEFAULT NULL,
high_timestamp             IN  TIMESTAMP WITH TIME ZONE DEFAULT NULL,
verify_signature           IN  BOOLEAN                  DEFAULT TRUE,
verify_delegate_signature  IN  BOOLEAN                  DEFAULT TRUE,
verify_countersignature    IN  BOOLEAN                  DEFAULT TRUE,
pdb_guid                   IN  RAW                      DEFAULT NULL);
TBD

Related Topics
Built-in Functions
Built-in Packages
Database Security
BlockChain Tables
DBMS_BLOCKCHAIN_UTL
DBMS_IMMUTABLE_TABLE
DBMS_TABLE_DATA
DBMS_USER_CERTS
Immutable Tables
What's New In 21c
What's New In 26ai

Morgan's Library Page Footer
This site is maintained by Daniel Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2026 Daniel A. Morgan All Rights Reserved