Friday, October 30, 2020

dba_flashback_archive Tips

DBA_FLASHBACK_VIEW can be used to monitor Oracle flashback as it contains the columns flashback_archive_name, flashback_archive#, retention_in_days, create_time, last_purge_time  and status to help the DBA administer the flashback feature of Oracle. 

Here is the query to show the dba_flashback_archive contents:

 select
    flashback_archive_name,
    status
from
   dba_flashback_archive;

 The dba_flashback_archive describes all flashback archives in the database and the status column of dba_flashback_archive indicates whether the flashback archive is a default archive for the database.  

All DBA's will enable a flashback_data_archive area that can then be seen by dba_flashback_archive.  

Note these limitations on using DDL with 11g flashback data archive.  

With a flashback data archive it is possible to view data as any point in time  since the flashback data archive was created. However, attempting to view  data as a timestamp before the data archive is created causes the following  ORA-01466 flashback error:

ORA-01466: unable to read data - table definition has changed    

If you try to drop a flashback tablespace that is in-use you get the ORA-55641 error:

SQL > alter flashback flashback_archive_area_one archive remove tablespace flashback_tablespace_one;  

ORA-55641: Cannot drop tablespace used by Flashback Data Archive.