RMAN>run { 2> allocate channel c1 type disk; 3> allocate channel c2 type disk; 4> allocate channel c3 type disk; 5> set until time "to_date('2011-08-16:14:49:37','YYYY-MM-DD:HH24:MI:SS')"; 6> restore database; 7> recover database; 8> alter database open resetlogs; 9> }
SQL> create tablespace cata datafile '/home/oracle/oradata/lin/catalog_01.dbf' size 1024M 2 segment space management auto extent management local uniform;
Tablespace created.
SQL> create user cata identified by cata default tablespace cata quota unlimited on cata;
User created.
SQL> grant connect,resource to cata;
Grant succeeded.
SQL> grant recovery_catalog_owner to cata;
Grant succeeded.
[oracle@localhost ~]$ rman catalog cata/cata
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Aug 16 16:55:00 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to recovery catalog database
RMAN> create catalog tablespace cata;
recovery catalog created
RMAN>
[oracle@localhost ~]$ rman target sys/sunlin
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Aug 16 20:05:28 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: LIN (DBID=2243770666)
RMAN> connect catalog cata/cata@ST
connected to recovery catalog database
RMAN> register database;
database registered in recovery catalog starting full resync of recovery catalog full resync complete
RMAN>list incarnation;
List of Database Incarnations DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time ------- ------- -------- ---------------- --- ---------- ---------- 1 7 LIN 2243770666 PARENT 1 15-JUL-11 1 2 LIN 2243770666 CURRENT 172218 16-AUG-11
RMAN> resync catalog;
starting full resync of recovery catalog full resync complete
RMAN> list incarnation;
List of Database Incarnations DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time ------- ------- -------- ---------------- --- ---------- ---------- 1 7 LIN 2243770666 PARENT 1 15-JUL-11 1 2 LIN 2243770666 CURRENT 172218 16-AUG-11
RMAN> reset database to incarnation 2;
database reset to incarnation 2
RMAN> list incarnation;
List of Database Incarnations DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time ------- ------- -------- ---------------- --- ---------- ---------- 1 7 LIN 2243770666 PARENT 1 15-JUL-11 1 2 LIN 2243770666 CURRENT 172218 16-AUG-11