How To Restore Archivelogs That Belongs To Another Incarnation_1326236.1

rongshiyuan發表於2014-05-22

How To Restore Archivelogs That Belongs To Another Incarnation (文件 ID 1326236.1)


In this Document

Goal
Solution


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.

APPLIES TO:

Oracle Database - Enterprise Edition - Version 9.2.0.1 to 11.2.0.2 [Release 9.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 08-Jan-2014***

GOAL

How to restore archives of previous incarnation for 24X7 database 

SOLUTION

Create a dummy instance, if using same ORACLE_HOME then change the RDBMS parameter DB_UNIQUE_NAME and INSTANCE_NAME to a different value ,with minimal memory (SGA) settings.


A) Steps  to be used for versions before 11.2 

C:\Documents and Settings\jspillai>echo %ORACLE_SID%
dummy

C:\Documents and Settings\jspillai>rman target / catalog=rman/rman@ora11

Recovery Manager: Release 11.2.0.1.0 - Production on Mon May 30 13:33:03 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

connected to target database: ORA12 (not mounted)         ===>dummy instance in no-mount stage
connected to recovery catalog database

RMAN> set dbid=1362454908

executing command: SET DBID
database name is "ORA12" and DBID is 1362454908

 

RMAN> list incarnation of database ;


List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
743 756 ORA12 1362454908 PARENT 1 02-APR-10
743 744 ORA12 1362454908 PARENT 940976 27-APR-11
743 970 ORA12 1362454908 CURRENT 1531084 30-MAY-11

RMAN> list backup of archivelog sequence 10;

specification does not match any backup in the repository

 

RMAN> reset database to incarnation 744;

database reset to incarnation 744


RMAN> list backup of archivelog sequence 10;


List of Backup Sets
===================


BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
873 73.75M DISK 00:00:08 26-MAY-11
BP Key: 901 Status: AVAILABLE Compressed: NO Tag: TAG20110526T141851
Piece Name: E:\BACKUP\ORA12\ORA12_0NMDA6MC_1_1

List of Archived Logs in backup set 873
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 10 1170143 17-MAY-11 1221117 22-MAY-11

BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
885 73.75M DISK 00:00:11 27-MAY-11
BP Key: 913 Status: AVAILABLE Compressed: NO Tag: TAG20110527T222645
Piece Name: E:\BACKUP\ORA12\DF_T752279206_S34_P1

List of Archived Logs in backup set 885
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 10 1170143 17-MAY-11 1221117 22-MAY-11


RMAN> restore archivelog sequence 10;

Starting restore at 30-MAY-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=129 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=192 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=5 device type=DISK

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=10
channel ORA_DISK_1: reading from backup piece E:\BACKUP\ORA12\DF_T752279206_S34_P1
channel ORA_DISK_1: piece handle=E:\BACKUP\ORA12\DF_T752279206_S34_P1 tag=TAG20110527T222645
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
Finished restore at 30-MAY-11

 

B) Steps  to be used for versions from 11.2 onward

 

Note: New Feature starting with "RMAN 11.2" ! 
----
NEW in RMAN 11.2 you can use parameter INCARNATION in RESTORE ARCHIVELOG command :

o Find Incarnation to be used for restore 
  Then ->  rman> restore archivelog sequence xxx thread yyy incarnation nnn ; 


Example:
--------
D:\TEMP>rman target / catalog rman/rman@fcn
...
RMAN> list incarnation of database ;
List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
51      67      V112     2263958055       ORPHAN  33560639   16-MAR-2012:09:12:48
51      68      V112     2263958055       PARENT  56098511   12-NOV-2012:17:28:35
51      95794   V112     2263958055       PARENT  208213274  21-NOV-2013:14:57:37    

51      112883  V112     2263958055       CURRENT 211944640  08-JAN-2014:12:29:57

RMAN> restore archivelog sequence 600 thread 1  INCARNATION 95794  PREVIEW ;  # use preview as check.
RMAN> restore archivelog sequence 600 thread 1  INCARNATION 95794  ;          # Restore the archivelog from incarnation 95794

----------
Reference:
----------
http://docs.oracle.com/cd/E11882_01/backup.112/e10643/rcmsubcl002.htm#i78730
Oracle? Database Backup and Recovery Reference
11g Release 2 (11.2)
E10643-07
. 
 archivelogRecordSpecifier

--

 

#


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1167212/,如需轉載,請註明出處,否則將追究法律責任。

相關文章