In the same table, the data is archived by placing the row in the inactive state. Database, you can compress optimizations for those inactive row. While archiving is implemented, applications can be restricted from accessing only those data in the active state. By default, those inactive row are not available to the app.
turn on the in-database archiving function of the table and use the keyword "row archival" when creating the table. Tables created with the keyword "row archival" add a hidden column: Ora_archive_state.
Sql> CREATE TABLE Emp_indbarch (emp_id number (6) notNULL, Name VARCHAR2 ( -), Hire_date date notNULL, job_id varchar2 (5) notNULL, Salary number (6) ) row archival; SQL> INSERT into Emp_indbarch (emp_id, Name,hire_date, job_id, salary) VALUES (1,'Scott','21-may-2009','Dev',50000); SQL> INSERT into Emp_indbarch (emp_id, Name,hire_date, job_id, salary) VALUES (2,'Jane','11-jun-2009','pm',30000); SQL>commit; SQL>SelectOra_archive_state,emp_id,name fromemp_indbarch;ora_archive_state emp_id NAME------------------------------ ---------- --------------------0 1Scott0 2Janesql>
The value of the hidden column ora_archive_state is 0 by default, indicating that row is active. A value of non 0 o'clock indicates that the row is inactive.
Manually modify active to inactive
set ora_archive_state=1where emp_id=1; SQL> commit;
By default , the inactive row is not visible for sessions and applications: (equivalent to alter session set row archival visibility=active)
Select from emp_indbarch;ora_archive_state emp_id NAME------------------------------------------------------------0 2 Janesql
Setting inactive data is visible to the app:
set row Archival visibility = all ; Session altered. SQLSelect from emp_indbarch;ora_archive_state emp_id NAME-------------------- ----------------------------------------1 1 Scott0 2 Janesql
Cancel the In-database archiving function of the table:
sql> ALTER TABLE Emp_indbarch no row archival; Table altered. SQLSelect from emp_indbarch; Select from Emp_indbarch *1: ORA-00904"ora_archive_state": Invalid Identifiersql
Oracle 12C--In-database archiving