Performing SCN-Based Recovery


In The following post we’ll see how to perform an incomplete database recovery to a particular database SCN.

There are several scenarios where this type of recovery would be your only choice, In what scenarios and how to determine the SCN required for this type of recovery read my earlier post on Restore database in case of dropped table.

Now I assume that we have the SCN of interest to proceed with SCN based recovery, following are the steps to be followed:-

Recovery Steps:-

  • RMAN> connect target /
  • RMAN> startup mount;
  • RMAN> restore database until scn <SCN of Interest>;
  • RMAN> recover database until scn <SCN of Interest>;
  • RMAN> alter database open resetlogs;

You can use the below code in your environment:-

  • RMAN> connect target /
  • RMAN> startup mount;
  • RMAN> run{
    set until scn <SCN of Interest>;
    restore database;
    recover database;
    }
  • RMAN> alter database open resetlogs;

Also If you have set the initialization parameter log_checkpoints_to_alert to TRUE, then every time a log switch occurs, Oracle will write the SCN of each checkpoint to your target database alert.log file. This feature can be handy when trying to determine historical checkpoint SCN activity.

I hope this post would be helpful in scenarios when you know the recovery process but as there is lot of stress on DBAs during recovery scenarios even googling at that time for the syntax is an overhead, hence the idea is to make a repository that cover all possibile recovery scenarios step by step with syntax of commands at a single destination. I would try to cover all the scenarios in my subsequent posts. Please comment if any of the curious readers are interested to know the internals of the recovery process like which process does that, what information is in redo that is applied to the datafiles to recover them to point in time and etc.

PLEASE COMMENT IF YOU FACE ANY ERRORS WHEN PERFORMING THIS RECOVERY SO THAT WE CAN WORK ON THOSE AND ENHANCE THIS REPOSITORY FOR OTHER READERS.

 

One thought on “Performing SCN-Based Recovery

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.