The target database version is ORACLE8.1.7, the directory database version is Oracle9.2.0, lost all data files (including control files and online log files), use RMAN to make backup and recovery: Experimental steps:
1. Create a table space used in the directory database:
SQL> CREATE TABLESPACE RMANTS DATAFILE '/OPT/Orcle/db02/oradata/orcl/rmants.dbf' size 100m Autoextend On Next 1M MaxSize Unlimited; TableSpace Created.
2. Create RMAN users and authorize in the directory database:
SQL> CREATE User Rman Identified by Rman Default TableSpace Rmants Temporary TableSpace Temp Quota Unlimited on Rmants; user created.
SQL> Grant Recovery_catalog_owner to rman; grant succeeded.
3. Create a recovery directory in the directory database:
$ RMAN Catalog Rman / RMAN
Recovery Manager: Release 9.2.0.4.0 - 64bit Production
CopyRight (C) 1995, 2002, Oracle Corporation. All Rights Reserved.
connected to recovery catalog databaserecovery catalog is not installedRMAN> create catalog tablespace rmants; recovery catalog created4, register the target database to restore service name directory My target database using rcat $ rman target / (execute the command on the target database, first with RMAN connection to the target database)
Recovery Manager: Release 8.1.7.3.0 - Production
RMAN-06005: Connected to Target Database: Orcl (DBID = 1000277484) RMAN> Connect Catalog RMAN / RMAN @ Rcat (Connected to Catalog Directory Database)
RMAN-06008: Connected to Recovery Catalog DatabaserMan> Register Database; (registering target database on catalog directory database)
RMAN-03022: compiling command: registerRMAN-03023: executing command: registerRMAN-08006: database registered in recovery catalogRMAN-03023: executing command: full resyncRMAN-08002: starting full resync of recovery catalogRMAN-08004: full resync complete preparations have been made Ok, let's start using RMAN to make backups and recovery. 5. rman make a full backup: RMAN> run {allocate channel c1 type disk; backup full tag 'dbfull' format '/ opt / oracle / full% u_% p_% c' database include current controlfile; sql 'alter system archive log current '; backup filesperset 3 archivelog all delete input; release channel c1;} RMAN-03022: compiling command: allocateRMAN-03023: executing command: allocateRMAN-08030: allocated channel: c1RMAN-08500: channel c1: sid = 15 devtype = DISK
RMAN-03022: compiling command: backupRMAN-03023: executing command: backupRMAN-08008: channel c1: starting full datafile backupsetRMAN-08502: set_count = 3 set_stamp = 537970127 creation_time = 27-SEP-04RMAN-08010: channel c1: specifying datafile ( s) in backupsetRMAN-08522: input datafile fno = 00001 name = / opt / oracle / db02 / oradata / ORCL / system01.dbfRMAN-08011: including current controlfile in backupsetRMAN-08522: input datafile fno = 00004 name = / opt / oracle /db02/oradata/orCl/temp01.dbfrman-08522: input datafile fno = 00019 name = / opt / oracle / db02/ oradata / oracle / rbs02.dbfrman-08522: input datafile fno = 00003 name = / opt / oracle / db02 /oradata/ORCL/rbs03.dbfRMAN-08522: input datafile fno = 00002 name = / opt / oracle / db02 / oradata / ORCL / tools01.dbfRMAN-08522: input datafile fno = 00006 name = / opt / oracle / db02 / oradata /Orcl/indx01.dbfrman-08522: input datafile fn = 00005 name = / opt / oracle / db02 / oradata / orcl / users01.dbfrman-08522: input datafile fno = 00007 name = / opt / oracle / db02 / oradata / orcl /DRSYS01.DBFRMAN DATAFILE FNO = 00010 name = / opt / oracle / db02 / oradata / ORCL / test.dbfRMAN-08013: channel c1: piece 1 createdRMAN-08503: piece handle = / opt / oracle / full03g11hef_1_1 comment = NONERMAN-08525: backup set complete, elapsed time : 00: 02: 55RMAN-03023: executing command: partial resyncRMAN-08003: starting partial resync of recovery catalogRMAN-08005: partial resync completeRMAN-03022: compiling command: sqlRMAN-06162: sql statement: alter system archive log currentRMAN-03023: Executing Command: SQL
RMAN-03022: compiling command: backupRMAN-03025: performing implicit partial resync of recovery catalogRMAN-03023: executing command: partial resyncRMAN-08003: starting partial resync of recovery catalogRMAN-08005: partial resync completeRMAN-03023: executing command: backupRMAN-08009 : channel c1: starting archivelog backupsetRMAN-08502: set_count = 4 set_stamp = 537970305 creation_time = 27-SEP-04RMAN-08014: channel c1: specifying archivelog (s) in backup setRMAN-08504: input archivelog thread = 1 sequence = 1 recid = 7 stamp = 537958625RMAN-08013: channel c1: piece 1 createdRMAN-08503: piece handle = / opt / oracle / db01 / app / oracle / product / 8.1.7 / dbs / 04g11hk1_1_1 comment = NONERMAN-08525: backup set complete, elapsed time: 00: 00: 02RMAN-08071: channel c1: deleting archivelog (s) RMAN-08514: archivelog filename = / opt / oracle / arch / ORCL / arch_1_1.arc recid = 7 stamp = 537958625RMAN-08009: channel c1: starting ArchiveLog BackupsetrMan-08502: set_count = 5 set_stamp = 537970307 Creation_time = 27-Sep-04rman-08014: Channel C1: S pecifying archivelog (s) in backup setRMAN-08504: input archivelog thread = 1 sequence = 2 recid = 8 stamp = 537958661RMAN-08504: input archivelog thread = 1 sequence = 3 recid = 9 stamp = 537959443RMAN-08504: input archivelog thread = 1 sequence = 4 recid = 10 stamp = 537970304RMAN-08013: channel c1: piece 1 createdRMAN-08503: piece handle = / opt / oracle / db01 / app / oracle / product / 8.1.7 / dbs / 05g11hk3_1_1 comment = NONERMAN-08525: backup set complete, elapsed time: 00: 00: 02RMAN-08071: channel c1: deleting archivelog (s) RMAN-08514: archivelog filename = / opt / oracle / arch / ORCL / arch_1_2.arc recid = 8 stamp = 537958661RMAN-08514 : ArchiveLog FileName =
/opt/oracle/arch/ORCL/arch_1_3.arc recid = 9 stamp = 537959443RMAN-08514: archivelog filename = / opt / oracle / arch / ORCL / arch_1_4.arc recid = 10 stamp = 537970304RMAN-03023: executing command: partial resyncRMAN -08003: starting partial resync of recovery catalogRMAN-08005: partial resync completeRMAN-03022: compiling command: releaseRMAN-03023: executing command: releaseRMAN-08031: released channel: c1RMAN> exitRecovery Manager complete.6 view the database backup information:
$ Rman target / catalog rman / rman @ rcat Recovery Manager: Release 8.1.7.3.0 - Production RMAN-06005: connected to target database: ORCL (DBID = 1000277484) RMAN-06008: connected to recovery catalog databaseRMAN> list backup; RMAN -03022: Compiableing Command: List list of backup setskey Recid Stamp LV Set Stamp Set Count Completion Time ---------------- ---------- - - ---------------------------------------- 22 2 537970293 0 537970127 3 27-Sep -04 List of backup Pieces Key PC # cp # status completion time piece name ------------------------------ ------------ ------------------------ 23 1 1 Available 27-SEP-04 / OPT / ORACLE / Full03G11Hef_1_1 list of datafiles include file name lv type ckp scn ckp time ---- --------------------------------- ---- - ---- ----------------------- 1 /opt/oracle/db02/oradata/orcl/system01.dbf 0 Full 5226242 27-SEP- 04 2 /opt/oracle/db02/oradata/orcl/tools01.dbf 0 Full 5226242 27-Sep-04 3 /opt/oracle/db02/oradata/orcl/rbs03.dbf 0 Full 5226242 27-Sep-04 4 / OPT / Oracle/db02/oradata/orcl/temp01.dbf 0 Full 5226242 27-Sep-04 5 /opt/oracle/db02/oradata/orcl/users01.dbf 0 Full 5226242 27-Sep-04 6 / OPT / ORACLE / DB02 / ORADATA/ORCL/indx01.dbf 0 Full 5226242 27-Sep-04 7 /opt/oracle/db02/oradata/orcl/drsys01.dbf 0 Full 5226242 27-Sep-04 10 / OPT / ORACLE / DB02 / ORADATA / ORCL / Test.dbf 0 Full 5226242 27-Sep-04 19 /opt/oracle/db02/oradata/orcl/rbs02.dbf 0 Full 5226242 27-Sep-047. Turn off the database, simulate all data file loss, manually delete all data Files, control files and online log files:
$ Lsnrctl stop LSNRCTL for Solaris:.. Version 8.1.7.3.0 - Production on 27-SEP-2004 12:30:39 (c) Copyright 1998 Oracle Corporation All rights reserved Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP (Host = ipasdb) (port = 1521))) The Command Complated SuccessFully $ SQLPLUS INTERNAL / ORACLE SQL * PLUS: Release 8.1.7.0.0 - Production ON Mon Sep 27 12:29:12 2004 (C) Copyright 2000 Oracle .. Corporation All rights reserved Connected to: Oracle8i Enterprise Edition Release 8.1.7.3.0 - 64bit ProductionWith the Partitioning optionJServer Release 8.1.7.3.0 - 64bit Production SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down $ rm /. OPT / ORACLE / DB02 / ORADATA / ORCL / * $ RM / OPT / ORCLE / DB03 / ORADATA / ORCL / * $ RM / OPT / ORCLE / DB04 / ORADATA / ORCL / * 8. Fully recovery with RMAN: (1) First, start the database to Nomount status: $ SQLPLUS INTERNAL / ORACLE SQL * PLUS: Release 8.1.7.0.0 - Production ON Mon Sep 27 12:32:37 2004 (C) Copyright 2000 Oracle Corporation. All Rights Reserved. Connected To An idle instance. SQL> Startup NOM . OuntORACLE instance started Total System Global Area 1134141116 bytesFixed Size 102076 bytesVariable Size 311750656 bytesDatabase Buffers 819200000 bytesRedo Buffers 3088384 bytes (2) before doing the entire database recovery, you need to restore the control file:. $ Rman target / catalog rman / rman @ rcat Recovery Manager : Release 8.1.7.3.0 - Production RMAN-06006: connected to target database: ORCL (not mounted) RMAN-06008: connected to recovery catalog database RMAN> run {allocate channel c1 type disk; restore controlfile; release channel c1;} RMAN-03022: Compiling Command: Allocaterman-03023: Executing Command: Allocaterman-08030: Allocated Channel: C1RMAN-08500: CHANNEL C1: SID =
14 devtype = DISK RMAN-03022: compiling command: restore RMAN-03022: compiling command: IRESTORERMAN-03023: executing command: IRESTORERMAN-08016: channel c1: starting datafile backupset restoreRMAN-08502: set_count = 3 set_stamp = 537970127 creation_time = 27- SEP-04RMAN-08021: channel c1: restoring controlfileRMAN-08505: output filename = / opt / oracle / db02 / oradata / ORCL / control01.ctlRMAN-08023: channel c1: restored backup piece 1RMAN-08511: piece handle = / opt / oracle / full03g11hef_1_1 tag = DBFULL params = NULLRMAN-08024: channel c1: restore completeRMAN-08058: replicating controlfileRMAN-08506: input filename = / opt / oracle / db02 / oradata / ORCL / control01.ctlRMAN-08505: output filename = / opt /oracle/db03/oradata/ORCL/control02.ctlRMAN-08505: output filename = / opt / oracle / db04 / oradata / ORCL / control03.ctl RMAN-03022: compiling command: releaseRMAN-03023: executing command: releaseRMAN-08031: Released Channel: C1 (3). Recovery Archive Log File: Rman> Run {Set ArchiveLog Destination To '/ Opt / Oracle / Arch / Orcl'; Allocate Channel C1 Type DIS k; restore archivelog all; release channel c1;} RMAN-03022: compiling command: set RMAN-03022: compiling command: allocateRMAN-03023: executing command: allocateRMAN-08030: allocated channel: c1RMAN-08500: channel c1: sid = 14 devtype = DISK RMAN-03022: compiling command: restore RMAN-03022: compiling command: IRESTORERMAN-03023: executing command: IRESTORERMAN-08018: channel c1: starting archivelog restore to user-specified destinationRMAN-08508: archivelog destination = / opt / oracle / Arch / Orclrman-08022: Channel C1: Restoring ArchiveLogRMAN-08510: ArchiveLog Thread = 1 sequence = 1rman-08023: Channel C1: Restored Backup Piece 1RMAN-08511: Piece Handle =
/opt/oracle/db01/app/oracle/product/8.1.7/dbs/04g11hk1_1_1 tag = null params = NULLRMAN-08024: channel c1: restore completeRMAN-08018: channel c1: starting archivelog restore to user-specified destinationRMAN-08508 : archivelog destination = / opt / oracle / arch / ORCLRMAN-08022: channel c1: restoring archivelogRMAN-08510: archivelog thread = 1 sequence = 2RMAN-08022: channel c1: restoring archivelogRMAN-08510: archivelog thread = 1 sequence = 3RMAN-08022 : channel c1: restoring archivelogRMAN-08510: archivelog thread = 1 sequence = 4RMAN-08023: channel c1: restored backup piece 1RMAN-08511: piece handle = / opt / oracle / db01 / app / oracle / product / 8.1.7 / dbs / 05g11hk3_1_1 tag = null params = NULLRMAN-08024: channel c1: restore complete RMAN-03022: compiling command: releaseRMAN-03023: executing command: releaseRMAN-08031: released channel: c1 (4) to restore all of the data file, and to resetlogs. Way Open Database: Rman> Run {Allocate Channel C1 Type Disk; SQL 'ALTER DATABASE MOUNT'; Restore Database; Restore Database; SQL 'ALTABASE OPEN RESETLOGS';} RMAN-03022: CO mpiling command: allocateRMAN-03023: executing command: allocateRMAN-08030: allocated channel: c1RMAN-08500: channel c1: sid = 12 devtype = DISK RMAN-03022: compiling command: sqlRMAN-06162: sql statement: alter database mountRMAN-03023: executing command: sql RMAN-03022: compiling command: restoreRMAN-03025: performing implicit partial resync of recovery catalogRMAN-03023: executing command: partial resyncRMAN-08003: starting partial resync of recovery catalogRMAN-08005: partial resync complete RMAN-03022: compiling Command: IRESTORERMAN-03023: Executing Command: IRESTORERMAN-08016: Channel C1: Starting DataFile Backupset Restorer-08502: Set_count =
3 set_stamp = 537970127 creation_time = 27-SEP-04RMAN-08089: channel c1: specifying datafile (s) to restore from backup setRMAN-08523: restoring datafile 00001 to /opt/oracle/db02/oradata/ORCL/system01.dbfRMAN-08523 : restaurant datafile 00002 to /opt/oracle/db02/oradata/orcl/tools01.dbfrman-08523: Restoring DataFile 00003 to /opt/oracle/db02/oradata/orcl/rbs03.dbfrman-08523: Restoring DataFile 00004 To / OPT / ORACLE / DB02 / ORADATA / ORCL / TEMP01.DBFRMAN-08523: Restoring DataFile 00005 to /opt/oracle/db02/oradata/orcl/Users01.dbfrman-08523: Restoring DataFile 00006 to / OPT / ORACLE / DB02 / ORADATA / ORCL / indx01.dbfRMAN-08523: restoring datafile 00007 to /opt/oracle/db02/oradata/ORCL/drsys01.dbfRMAN-08523: restoring datafile 00010 to /opt/oracle/db02/oradata/ORCL/test.dbfRMAN-08523: restoring datafile 00019 to /opt/oracle/db02/oradata/ORCL/rbs02.dbfRMAN-08023: channel c1: restored backup piece 1RMAN-08511: piece handle = / opt / oracle / full03g11hef_1_1 tag = DBFULL params = NULLRMAN-08024: channel c1: Restore completion teRMAN-03023: executing command: partial resyncRMAN-08003: starting partial resync of recovery catalogRMAN-08005: partial resync complete RMAN-03022: compiling command: recover RMAN-03022: compiling command: recover (1) RMAN-03023: executing command: partial resync RMAN-03022: compiling command: recover (2) RMAN-03022: compiling command: recover (3) RMAN-03023: executing command: recover (3) RMAN-08054: starting media recovery RMAN-03022: compiling command: recover (4) RMAN-03023: executing command: recover (4) RMAN-08017: channel c1: starting archivelog restore to default destinationRMAN-08022: channel c1: restoring archivelogRMAN-08510: archivelog thread = 1 sequence =
4RMAN-08023: channel c1: restored backup piece 1RMAN-08511: piece handle = / opt / oracle / db01 / app / oracle / product / 8.1.7 / dbs / 05g11hk3_1_1 tag = null params = NULLRMAN-08024: channel c1: restore completeRMAN-08515: archivelog filename = / opt / oracle / arch / ORCL / arch_1_4.arc thread = 1 sequence = 4RMAN-08060: unable to find archivelogRMAN-08510: archivelog thread = 1 sequence = 5RMAN-03026: error recovery releasing channel resourcesRMAN -08031: Released channel: c1rman-00571: ======================================== =================== r--00569: =============== Error Message stack backs ========= ======= r--00571: ================================================================ ==================== RMAN-03002: Failure During compiration of comMMANDRMAN-03013: Command Type: recoverrman-03006: Non-Retryable Error Occurred During Execution of Command: RecoVer (4) RMAN-07004: Unhandled Exception During Command Execution On Channel Defaultrman-20000: Abnormal Termination Of Job Steprman-06054: Media Recovery Requesting Unknown log: Thread 1 SCN 5226245RMAN> EXITRECOVERY Manager Complete. Found some error message, the analysis is mainly because there is no finding of Arch_1_5.arc archiving logs,