To determine the time for the until time clause for RMAN duplicate/recovery

Connect to production server and source the DB home.

 

1. Export the NLS date format in PROD

 

export NLS_DATE_FORMAT=’YYYY-MM-DD HH24:MI:SS’

 

2. Connect to production database(PROD)

 

rman target /

list backup of controlfile;

 

Pick the time of the latest controlfile time.

 

Sample Output:

 

RMAN> list backup of controlfile;

 

From the above output it helps to determine the control file which need to be copied over to DEV/TEST server.

 

3. To determine the point in time recover run the archive log backup command.

 

Please use the below command on PROD to retrieve that and the latest time stamp from Next Time column of the last archive log present in the backup being used.

 

RMAN> list backup of archivelog all;

 

 

 

Step 4: connect to RMAN (Target Environment)

 

Sample clone:

 

rman auxiliary / log=/u01/backups/RMAN/rman_instance_rec.log

 

DUPLICATE DATABASE TO DEV

UNTIL TIME “TO_DATE(’31-JAN-2014 00:00:28′,’DD-MON-YYYY HH24:MI:SS’)”

BACKUP LOCATION ‘/u01/backups/RMAN/PROD’

nofilenamecheck

;

 

Note: Following command automatically restore, recover, open database and also recreate the TEMP tablespace.

 

 

Error Message:

 

channel ORA_AUX_DISK_4: SID=626 device type=DISK

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of Duplicate Db command at 09/06/2012 17:50:45

 

RMAN-05501: aborting duplication of target database

RMAN-06617: UNTIL TIME (06-SEP-12) is ahead of last NEXT TIME in archived logs (06-SEP-12)

 

RMAN> exit

 

If we run into issue in providing the point in time recovery, try to readjust the value to next lower sequence number from the archive log list and match it to that respective timing.

 

Error Fix: How to find the exact time to mention.

 

Description:

The below command will simulate the restore process from available backup. It won’t touch the data file

 

RMAN> Restore database PREVIEW;

 

PREVIEW tells about

1. At which SCN media recovery will start

2. AT which SCN recovery required to clear the datafile fuzziness.

3. What all archivelogs are required to clear this fuzziness.

4. Also it reports the missing archivelogs under backup.

 

Based on scn you can find until which archive log is required and based on SCN you can find the time of recover

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 )

Facebook photo

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

Connecting to %s