In-Database Row Archiving
In-database archiving is a feature provided by Oracle in 12c which allow to archive rows withing a table. It is done by making those rows invisible. Application will not be able to get those data from the table, they will compressed and kept secure. It will be accessed only when we set session parameter.
So, with this feature you don't have to purge the data, but same time it will not impact the application performance. We can compressed these archived data to reduce backup time. We can make the update deferred so that the application upgrades time can be minimized.
To manage in-database archiving for a table, you must enable ROW ARCHIVAL for the table, manipulate the ORA_ARCHIVE_STATE hidden column of the table, and specify either ACTIVE or ALL for the ROW ARCHIVAL VISIBILITY session parameter.
1. Connect to the database
2. Create the table.
Create table order_arch as select order_id, amount from order where rownum <= 4;
3. Enable row archival on the table.
alter table order_arch row archival;
In-database archiving is a feature provided by Oracle in 12c which allow to archive rows withing a table. It is done by making those rows invisible. Application will not be able to get those data from the table, they will compressed and kept secure. It will be accessed only when we set session parameter.
So, with this feature you don't have to purge the data, but same time it will not impact the application performance. We can compressed these archived data to reduce backup time. We can make the update deferred so that the application upgrades time can be minimized.
To manage in-database archiving for a table, you must enable ROW ARCHIVAL for the table, manipulate the ORA_ARCHIVE_STATE hidden column of the table, and specify either ACTIVE or ALL for the ROW ARCHIVAL VISIBILITY session parameter.
1. Connect to the database
2. Create the table.
Create table order_arch as select order_id, amount from order where rownum <= 4;
3. Enable row archival on the table.
alter table order_arch row archival;
4. Set the archival visibility to ALL for the session. This will allow this session to view all rows, archived or not.
alter session set row archival visibility = all;
5. Issue the same query as before, but now you should see all 4 rows.
select order_id, amount, ora_archive_state from order_arch;
6. Set the archival visibility to ACTIVE for the session. This will allow this session to view only active (unarchived) rows.
alter session set row archival visibility = active;