Pavan DBA's Blog

The DBA Knowledge Store

Archive for the ‘backup and recovery’ Category

script to know till which scn your datafiles need recovery

Posted by Pavan DBA on October 29, 2009

spool scandatafile.sql
set serveroutput on
declare
  scn number(12) := 0;
  scnmax number(12) := 0;
begin
  for f in (select * from v$datafile) loop
    scn := dbms_backup_restore.scandatafile(f.file#);
    dbms_output.put_line(‘File ‘ || f.file# ||’ absolute fuzzy scn = ‘ || scn);
    if scn > scnmax then scnmax := scn; end if;
  end loop;
 
  dbms_output.put_line(‘Minimum PITR SCN = ‘ || scnmax);
end;

Posted in backup and recovery, Scripts | 2 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 1,272 other followers