In Oracle Database 12c there are two new features which can be used to control the validity and visibility of the data. They are called Temporal Validity and In Database Archiving. The concepts behind these two new features are a bit interlinked, so it is important to understand and distinguish between these two.
So then what is the difference between In-Database Archiving and Temporal Validity in 12c?
In-Database Archiving and Temporal Validity
The In-database archiving feature allows you to control the visibility of data inside the database. The use of the term archiving may suggest that it is related to some new backup and recovery technique. But is is not. It is a simple method to mark certain rows within a table as archive. Once a row has been marked as an archive, it will not be visible to users and applications. Thus you can effectively make certain rows as inactive while still being able to keep them inside the database.
The table rows marked as inactive or archive can be viewed for compliance purposes, using a session parameter setting. Compression can also be applied to these rows to save the space. Aggressive compression can further be used. Since these rows will not be accessed by any application, it will have no affect on performance of the database.
Once a row has been marked as archive, it can also be made active again with a single update command.
The second concept is that of Temporal Validity. Suppose you have an HR application which is being used to track when an employee joined or left. Normally when an employee leaves his record, it is not deleted from the table rather than the column named something like End_Date is updated with his/her departure date. The columns like Start_Date and End_Date define the validity of an employee record at any given point in time. This is different from the transaction time which is system maintained and records when that specific record was inserted and/or updated.
In 11g and versions before that, there was no way of tracking the Valid time. The columns were required to be added and maintained by the application developers. Starting from 12c however, this functionality is provided under Temporal Validity. You just provide the Period clause with the column name in table definition and Oracle adds some hidden columns to maintain the Validity. These columns can be accessed and manipulated by users.
While both of these features are related, yet they are different. Not only are they different in their implementation but also in he specific business requirements they are intended for.
When you mark a record as an archive or inactive row, using the In-Database Archiving then it affects its visibility to the users. You need specific session parameter values to see them. While in the case of the Temporal Validity a record may not be valid during a specific period of time but it still remains visible. Using different values for Start_Date and End_Date columns you can still see the record. And you can also change its Validity time using the update operation.