Flashback query with database in noarchivelog mode

From dbawiki
Revision as of 15:39, 30 November 2011 by 127.0.0.1 (talk)
Jump to: navigation, search

Typically, development databases are not started in archivelog mode. This causes a problem for hot backups but not necessarily for flashback queries. You can still flashback to any time within the online redo logs:

ALTER SESSION 
  SET NLS_TIMESTAMP_FORMAT = 
  'DD-MON-YYYY HH24:MI:SS.FF3';
set lines 9999
set trimspool on
set pages 9999
set heading off
spool old_version.sql

select text from dba_source  
      as of timestamp to_timestamp('22-SEP-2011 07:30:00.000')
where owner='SCOTT'
  and name='MYPACKAGE'
order by type, line;

spool off