重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 375|回复: 0
打印 上一主题 下一主题

[参考文档] How To Restore Archivelogs That Belongs To Another Incarnation

[复制链接]
跳转到指定楼层
楼主
发表于 2024-7-21 17:52:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
目标:
NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner.
For the purposes of this document, the following fictitious environment is used as an example to describe the procedure:
ORACLE_SID: test
DBNAME: ORA12, V112

***********************

How to restore archives of previous incarnation for a database

处理方法:
Create a test 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


echo %ORACLE_SID%
test

rman target / catalog=<RmanUsername>/<password>@<catalog_tns>
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) ===> test 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: \<path>\<backuppiece_name>

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: \<path>\<backuppiece_name>

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;
..
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 \<path>\<backuppiece_name>
channel ORA_DISK_1: piece handle=\<path>\<backuppiece_name> 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 database versions from 11.2 onward

Running oracle release 11.2 or higher, you can use RMAN INCARNATION parameter in the RESTORE ARCHIVELOG command :

- Find  the incarnation to be used for restore and then execute the following command to restore the archivelog:

rman> restore archivelog sequence <sequence#> thread <thread#> incarnation <incarnation_key>;
Example:

rman target / catalog <RmanUsername/<password>@<catalog_tns>
...
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

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-28 15:33 , Processed in 0.126415 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表