Oracle Recovery Manager (RMAN), a command-line and Oracle Enterprise Manager-based tool, is the Oracle-preferred method for efficiently backing up and recovering an Oracle database. RMAN is designed to work intimately with the server, providing block-level corruption detection during backup and restore.

Oracle RMAN Recovery Case Study : Loss of all datafiles

Required : Level 0 backup, relevant archive logs, DBID (select dbid from v$database)

Delete all the datafiles (SIMULATING the scenario)

[ora10g@localhost backup]$ cd /oracle/product/10.2.0/oradata/orcl/
[ora10g@localhost orcl]$ ls
control01.ctl control03.ctl redo01.log redo03.log system01.dbf undotbs01.dbf control02.ctl example01.dbf redo02.log sysaux01.dbf temp01.dbf users01.dbf
[ora10g@localhost orcl]$ rm -f *
[ora10g@localhost orcl]$ ls
[ora10g@localhost orcl]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Tue Mar 9 12:33:48 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>select tablespace_name from dba_Tablespaces;
select tablespace_name from dba_Tablespaces
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-01116: error in opening database file 1
ORA-01110: data file 1: '/oracle/product/10.2.0/oradata/orcl/system01.dbf'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
SQL>

RECOVERY PROCESS

First we need to shutdown/abort the instance with from RMAN console

[ora10g@localhost orcl]$ rman target / catalog rman/rman@rman
Recovery Manager: Release 10.2.0.4.0 - Production on Tue Mar 9 12:43:39 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database (not started)
connected to recovery catalog database
RMAN> startup nomount
RMAN> set dbid=1240560427
executing command: SET DBID
database name is "ORCL" and DBID is 1240560427
RMAN> run {
allocate channel ch00 type disk;
restore controlfile;
release channel ch00;
}

allocated channel: ch00
channel ch00: sid=156 devtype=DISK
Starting restore at 09-MAR-10
channel ch00: starting datafile backupset restore
channel ch00: restoring control file
channel ch00: reading from backup piece
/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/autobackup/2010_03_09/o1_mf_s_713190583_5sd1qs9h_.bkp
channel ch00: restored backup piece 1
handle=/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/autobackup/2010_03_09/o1_mf_s_713190583_5sd1qs9h_.
bkp tag=TAG20100309T122943
channel ch00: restore complete, elapsed time: 00:00:10
output filename=/oracle/product/10.2.0/oradata/orcl/control01.ctl
output filename=/oracle/product/10.2.0/oradata/orcl/control02.ctl
output filename=/oracle/product/10.2.0/oradata/orcl/control03.ctl
Finished restore at 09-MAR-10
released channel: ch00
RMAN>
RMAN> run {
allocate channel ch00 type disk;
restore database;
recover database;
release channel ch00;
}

allocated channel: ch00
channel ch00: sid=156 devtype=DISK
Starting restore at 09-MAR-10
Starting implicit crosscheck backup at 09-MAR-10
Crosschecked 24 objects
Finished implicit crosscheck backup at 09-MAR-10
Starting implicit crosscheck copy at 09-MAR-10
Finished implicit crosscheck copy at 09-MAR-10
searching for all files in the recovery area
cataloging files…
cataloging done
List of Cataloged Files
=======================
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_08/o1_mf_1_7_5sb2om25_.arc
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_08/o1_mf_1_8_5sb2wkxg_.arc
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_08/o1_mf_1_9_5sb2wnyj_.arc
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_08/o1_mf_1_10_5sb2wtwh_.arc
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_08/o1_mf_1_11_5sbh7hpw_.arc
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_09/o1_mf_1_14_5sd1qwyr_.arc
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/autobackup/2010_03_08/o1_mf_s_713125997_5sb2oh1p_.bkp
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/autobackup/2010_03_08/o1_mf_s_713126951_5sb3mckr_.bkp
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/autobackup/2010_03_09/o1_mf_s_713183648_5sctz3jc_.bkp
FileName:/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/autobackup/2010_03_09/o1_mf_s_713190583_5sd1qs9h_.bkp
channel ch00: starting datafile backupset restore
channel ch00: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /oracle/product/10.2.0/oradata/orcl/undotbs01.dbf
restoring datafile 00003 to /oracle/product/10.2.0/oradata/orcl/sysaux01.dbf
channel ch00: reading from backup piece /oracle/admin/backup/bk_26_1_713190107
channel ch00: restored backup piece 1
piece handle=/oracle/admin/backup/bk_26_1_713190107 tag=TAG20100309T122146
channel ch00: restore complete, elapsed time: 00:03:17
channel ch00: starting datafile backupset restore
channel ch00: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /oracle/product/10.2.0/oradata/orcl/system01.dbf
restoring datafile 00004 to /oracle/product/10.2.0/oradata/orcl/users01.dbf
restoring datafile 00005 to /oracle/product/10.2.0/oradata/orcl/example01.dbf
channel ch00: reading from backup piece /oracle/admin/backup/bk_25_1_713190107
channel ch00: restored backup piece 1
piece handle=/oracle/admin/backup/bk_25_1_713190107 tag=TAG20100309T122146
channel ch00: restore complete, elapsed time: 00:03:17
Finished restore at 09-MAR-10
Starting recover at 09-MAR-10
starting media recovery
archive log thread 1 sequence 11 is already on disk as file
/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_08/o1_mf_1_11_5sbh7hpw_.arc
archive log thread 1 sequence 14 is already on disk as file
/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_09/o1_mf_1_14_5sd1qwyr_.arc
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=13
channel ORA_DISK_1: reading from backup piece /oracle/admin/backup/bk_27_1_713190581
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/admin/backup/bk_27_1_713190581 tag=TAG20100309T122941
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 archive log
filename=/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_09/o1_mf_1_13_5sd46knb_.arc thread=1 sequence=13
channel default: deleting archive log(s)
filename=/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_09/o1_mf_1_13_5sd46knb_.arc
recid=60 stamp=713193105 archive log
filename=/oracle/product/10.2.0/db_1/flash_recovery_area/ORCL/archivelog/2010_03_09/o1_mf_1_14_5sd1qwyr_.arc
thread=1 sequence=14
unable to find archive log
archive log thread=1 sequence=15
RMAN-00571:=====================================
RMAN-00569: === ERROR MESSAGE STACK FOLLOWS====
RMAN-00571:=====================================
RMAN-03002: failure of recover command at 03/09/2010 13:11:47
RMAN-06054: media recovery requesting unknown log: thread 1 seq 15 lowscn 1061263
RMAN> exit

Oracle Recovery Manager (RMAN), a command-line and Oracle Enterprise Manager-based tool, is the Oracle-preferred method for efficiently backing up and recovering an Oracle database. RMAN is designed to work intimately with the server, providing block-level corruption detection during backup and restore. RMAN optimizes performance and space consumption during backup with file multiplexing and backup-set compression, and integrates with Oracle Secure Backup and third-party media-management products for tape backup.

Share →
0 comments
Skip to toolbar