Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

doubt about database point in time recovery using rman

977469Dec 20 2013 — edited Dec 22 2013

Hi Everyone,

I have been practising various rman restore and recovery scenarios . I have a doubt regarding database point in time recovery using rman. Imagine i have a full database backup including controlfile scheduled to run at 10 PM everyday. today is 20th dec 2013. imagine i want to restore the database to a prior point in time ( say 18th dec till 8 AM). so i would restore all the datafiles  from 17th night's backup and apply archives till 8 AM of 18th dec . in this scenario should i restore the controlfile too from 17th dec bkp ( i am assuming yes we should ) or can we use the current controlfile ( assuming it is intact). i found the below from oracle docs.

Performing Point-in-Time Recovery with a Current Control File

The database must be closed to perform database point-in-time recovery. If you are recovering to a time, then you should set the time format environment variables before invoking RMAN. The following are sample Globalization Support settings:

NLS_LANG = american_america.us7ascii
NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS" 
 

To recover the database until a specified time, SCN, or log sequence number:

  1. After connecting to the target database and, optionally, the recovery catalog database, ensure that the database is mounted. If the database is open, shut it down and then mount it:

2.  SHUTDOWN IMMEDIATE;

3.  STARTUP MOUNT;
4.   
  1. Determine the time, SCN, or log sequence that should end recovery. For example, if you discover that a user accidentally dropped a tablespace at 9:02 a.m., then you can recover to 9 a.m.--just before the drop occurred. You will lose all changes to the database made after that time.

You can also examine the alert.log to find the SCN of an event and recover to a prior SCN. Alternatively, you can determine the log sequence number that contains the recovery termination SCN, and then recover through that log. For example, query V$LOG_HISTORY to view the logs that you have archived. 

RECID      STAMP      THREAD#    SEQUENCE#  FIRST_CHAN FIRST_TIM NEXT_CHANG
---------- ---------- ---------- ---------- ---------- --------- ----------
         1  344890611          1          1      20037 24-SEP-02      20043
         2  344890615          1          2      20043 24-SEP-02      20045
         3  344890618          1          3      20045 24-SEP-02      20046
 
  1. Perform the following operations within a RUN command:
    1. Set the end recovery time, SCN, or log sequence. If specifying a time, then use the date format specified in the NLS_LANG and NLS_DATE_FORMAT environment variables.
    2. If automatic channels are not configured, then manually allocate one or more channels.
    3. Restore and recover the database.

  The following example performs an incomplete recovery until November 15 at 9 a.m. 

RUN
{ 
  SET UNTIL TIME 'Nov 15 2002 09:00:00';
  # SET UNTIL SCN 1000;       # alternatively, specify SCN
  # SET UNTIL SEQUENCE 9923;  # alternatively, specify log sequence number
  RESTORE DATABASE;
  RECOVER DATABASE;
}
 
  1. If recovery was successful, then open the database and reset the online logs:
5.  ALTER DATABASE OPEN RESETLOGS;

I did not quiet understand why the above scenario is using current controlfile as the checkpoint scn in the current controlfile and the checkpoint scn in the datafile headers do not match after the restore and recovery. Thanks in Advance for your help.

Thanks

satya

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 19 2014
Added on Dec 20 2013
3 comments
696 views