Database Reference
In-Depth Information
To clean up or purge data to an SCN or timestamp from a Flashback Data Archive, use
the ALTER command with the purge clause:
SQL> alter flashback archive default_flash_archive
Purge before SCN 979271;
SQL>
SQL> alter flashback archive default_flash_archive
Purge before timestamp (SYSDATE - 180);
SQL>
And if you have established a deletion policy for archives, you can drop an archive,
including the default archive, quite easily, with no warning from the system:
SQL> drop flashback archive audit_flash_archive2;
SQL>
Using the Flashback Data Archive
Once the Flashback Data Archive is created, you can begin archiving data from specific
tables. To enable archiving for an existing table, use the ALTER TABLE command with the
FLASHBACK ARCHIVE clause:
SQL> alter table employee_history flashback archive audit_flash_archive;
SQL>
If you have created a default flashback archive and want to use it, then you don't need to
specify the name of the archive.
Equally straightforward, create a new table with the archive feature to utilize the default
Flashback Data Archive:
SQL> create table shipments (ship_id number(9),
shipper number(9), ship_date date)
flashback archive;
SQL>
Now that you have established all the structures, query the base table to retrieve archive
data using the AS OF TIMESTAMP clause:
SQL> select * from shipments AS OF TIMESTAMP TO_TIMESTAMP
('2013-02-01 12:00:00', 'YYYY-MM-DD HH24:MI:SS');
SQL>
To disable archiving for a table, simply alter the table using the NO FLASHBACK
ARCHIVE clause:
SQL> alter table shipments no flashback archive;
SQL>
Search WWH ::




Custom Search