C.1 Appendix: Recording DML Changes on the Tracked Table

DML Changes on a Tracked Table Row Temporary tcrv Table Blockchain History Table

First Insert

 

For any row, its very first inserted data (first lifespan) is protected by inserting a dummy row into its associated blockchain history table. This dummy row records the digest over the row's first lifespan.

Update

The latest version of the row (with the updates to the columns) now becomes the current lifespan of this tracked table row and gets recorded in the tcrv table.

The beginning SCN of this current lifespan is taken from the commit SCN of the transaction that inserted the new row. The end SCN is infinite.

The previous current lifespan is deleted from the tcrv table.

The previous current lifespan is inserted into the history table.

The beginning SCN of the entry in the history table is the commit SCN of the first transaction that inserted the row, and its end SCN is the commit SCN of the second transaction that updated the row.

Based on the current lifespan row in the tcrv table, a cryptographic digest (SHA2-512) is computed for the row with the latest lifespan and the cryptographic hash of the previous row in the chain. This digest is inserted in the blockchain history table in the column ORAFBA_CURRENT_LIFESPAN_DIGEST$ along with the previous lifespan.

Therefore, this new column protects the latest lifespan row in the tcrv table, while also protecting itself using the blockchain semantics.

Delete

The current lifespan in the tcrv table is removed.

A new historical lifespan is created in the history table (indicating that the ROWID is deleted).