Oracle 穿越incarnation恢复数据(三)

2014-11-24 11:46:47 · 作者: · 浏览: 1

SQL> startup mount
ORACLE instance started.

Total System Global Area 629145600 bytes
Fixed Size 2022824 bytes
Variable Size 209715800 bytes
Database Buffers 411041792 bytes
Redo Buffers 6365184 bytes
Database mounted.

[oracle@rhel6 ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Jul 17 21:34:14 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORA10G (DBID=4061806388)

RMAN> list incarnation;

using target database control file instead of recovery catalog

List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORA10G 4061806388 PARENT 1 2005-10-22-21:44:08
2 2 ORA10G 4061806388 PARENT 525876 2011-02-12-18:37:43
3 3 ORA10G 4061806388 PARENT 7781117 2011-05-23-13:24:09
4 4 ORA10G 4061806388 PARENT 7787669 2011-05-23-15:51:11
5 5 ORA10G 4061806388 CURRENT 9022404 2011-07-17-21:32:32

RMAN> reset database to incarnation 4;
database reset to incarnation 4

RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORA10G 4061806388 PARENT 1 2005-10-22-21:44:08
2 2 ORA10G 4061806388 PARENT 525876 2011-02-12-18:37:43
3 3 ORA10G 4061806388 PARENT 7781117 2011-05-23-13:24:09
4 4 ORA10G 4061806388 CURRENT 7787669 2011-05-23-15:51:11
5 5 ORA10G 4061806388 ORPHAN 9022404 2011-07-17-21:32:32


RMAN> run {
2> set until time '2011-07-17-21:22:30';
3> restore database;
4> recover database;
5> }

RMAN> alter database open resetlogs;
database opened


SQL> select * from t043_incarnation;

A
------------------------------------------------------------
corss successful

SQL> select * from t043_other;

A
----------
1
2
总结:穿越incarnation后,将会产生孤儿incarnation(orphan),这个时候最好重新备份下数据库
本文出自 “月牙天冲” 博客