Performing Log Sequence–Based Recovery


In the following post, we’ll see how to perform database recovery via Performing Log Sequence–Based Recovery. Suppose you want to recover the whole database but from last good known backup you do not have all the archived logs on disk i.e. one or some archive logs have been lost and we dont have their backup.

In such a case we’ll perform a log sequence based recovery to recover the database till where we have the archived logs. RMAN allows you to apply redo up to a specific archived redo log file by specifying its sequence number when restoring and recovering.

Recovery Steps:-

    • RMAN> connect target /
    • RMAN> startup mount;
    • RMAN>
run{
set until sequence <SEQUENCE NUMBER> thread <THREAD NUMBER>;
restore database;
recover database;
}
  • RMAN> alter database open resetlogs;

To get the Sequence Number you can use the below query with time:-

  • select sequence#, first_change#, first_time from v$log_history order by first_time;

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s