In Database Archiving
- In Database Archiving is a new feature of Oracle 12c meant to solve management of historical data inside the database.
- Like its name says, this functionnality leaves data into the database, so it remains accessible if you need it.
- With In Database Archiving, historical data remains in the database but is invisible to the application.
- Hybrid Columnar Compression (HCC) is used to compress the historical data into the database.
Temporal Validity
- Temporal Validity works in concomitence with In Database Archiving
- It adds the “valid time” dimension to the data by adding columns to table indicating if the row is still valid or can be archived.
- This helps performance by reducing the quantity of data accessible to the application.
- The Valid-Time of data is defined at table creation :
SQL> CREATE TABLE ORDER_HISTORY (ORDER_ID NUMBER, ORDER_DATE DATE, COMMENTS VARCHARC2(100), USER_TIME_START DATE, USER_TIME_END DATE, PERIOD FOR user_time (USER_TIME_START , USER_TIME_END));
- When you insert a row in the table you must insert the validity period too :
INSERT INTO ORDER_HISTORY (ORDER_ID , ORDER_DATE, COMMENTS, USER_TIME_START, USER_TIME_END) VALUES (1,SYSDATE,'ORDER 1',SYSDATE, SYSDATE+30);
Continue reading OCP 12C – In Database Archiving and Temporal Validity