Professional Documents
Culture Documents
Disaster Recovery Using RMAN 10gR2
Disaster Recovery Using RMAN 10gR2
Michael T. Dinh
Page 1 of 14
5/11/2007
Abstract
The purpose of this paper is to demonstrate how I recovered from a complete database
loss using Recovery Manager 10gR2 (RMAN) on Red Hat Enterprise Linux ES release 4
(Nahant Update 4) without a Recovery Catalog in a simplistic manner.
As part of the exercise, I deleted the database and server parameter file.
Convention
Standard In
Standard Out
Red
Blue
Prerequisite
I verified the database is using server parameter file (spfile).
SQL> show parameter spfile
NAME
TYPE
VALUE
-------------------------- ----------- ---------------------------------------spfile
string
/oracle/10gr2/db_1/dbs/spfileTIGGER.ora
Archive Mode
Enabled
/ora_arch01/TIGGER
12
15
15
Michael T. Dinh
Page 2 of 14
5/11/2007
Michael T. Dinh
Page 3 of 14
5/11/2007
Michael T. Dinh
Page 4 of 14
5/11/2007
May
May
May
May
May
May
May
May
May
9
10
10
10
10
10
10
10
10
22:13
02:18
02:21
02:21
02:21
02:23
02:21
02:21
02:20
longterm
logs
DB_TIGGER_20070510_0rihb8la_1_1
DB_TIGGER_20070510_0qihb8kr_1_1
DB_TIGGER_20070510_0pihb8kb_1_1
c-2781701566-20070510-06
c-2781701566-20070510-05
AL_TIGGER_20070510_0sihb8le_1_1
AL_TIGGER_20070510_0oihb8jr_1_1
SQL>
When I created a new tablespace, a new controlfile autobackup was created as well.
Michael T. Dinh
Page 5 of 14
5/11/2007
Michael T. Dinh
Page 6 of 14
5/11/2007
will be needed for recovery since it was the last known good backup:
SQL> select sysdate from dual;
SYSDATE
----------------------------10-MAY-2007 02:34:05
SQL> create table after_level1 as select * from t;
Table created.
SQL>
Michael T. Dinh
Page 7 of 14
5/11/2007
`/ora_admin/TIGGER/create/CreateDB.log'
`/ora_admin/TIGGER/create/CreateDBCatalog.log'
`/ora_admin/TIGGER/create/postDBCreation.log'
directory: `/ora_admin/TIGGER/create'
`/ora_admin/TIGGER/adump/ora_18120.aud'
`/ora_admin/TIGGER/adump/ora_18121.aud'
`/ora_admin/TIGGER/adump/ora_18136.aud'
directory: `/ora_admin/TIGGER/adump'
`/ora_admin/TIGGER/bdump/alert_TIGGER.log'
`/ora_admin/TIGGER/bdump/tigger_lgwr_17419.trc'
`/ora_admin/TIGGER/bdump/tigger_lgwr_17618.trc'
directory: `/ora_admin/TIGGER/bdump'
directory: `/ora_admin/TIGGER/cdump'
directory: `/ora_admin/TIGGER/udump'
directory: `/ora_admin/TIGGER'
`/ora_arch01/TIGGER/arch_1_4_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_5_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_6_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_7_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_8_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_9_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_10_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_11_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_12_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_13_622171326.dbf'
`/ora_arch01/TIGGER/arch_1_14_622171326.dbf'
directory: `/ora_arch01/TIGGER'
`/ora_data01/TIGGER/control01.dbf'
`/ora_data01/TIGGER/system01.dbf'
`/ora_data01/TIGGER/sysaux01.dbf'
directory: `/ora_data01/TIGGER'
`/ora_data02/TIGGER/control02.dbf'
`/ora_data02/TIGGER/undotbs01.dbf'
directory: `/ora_data02/TIGGER'
`/ora_data03/TIGGER/control03.dbf'
`/ora_data03/TIGGER/users01.dbf'
directory: `/ora_data03/TIGGER'
directory: `/ora_indx01/TIGGER'
directory: `/ora_indx02/TIGGER'
`/ora_redo1a/TIGGER/redo01a.log'
`/ora_redo1a/TIGGER/redo03a.log'
directory: `/ora_redo1a/TIGGER'
`/ora_redo1b/TIGGER/redo01b.log'
`/ora_redo1b/TIGGER/redo03b.log'
directory: `/ora_redo1b/TIGGER'
Michael T. Dinh
Page 8 of 14
5/11/2007
Michael T. Dinh
Page 9 of 14
5/11/2007
startup nomount
RMAN> startup nomount;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/oracle/10gr2/db_1/dbs/initTIGGER.ora'
starting Oracle instance without parameter file for retrival of spfile
Oracle instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
159383552 bytes
1218244
58722620
92274688
7168000
bytes
bytes
bytes
bytes
Michael T. Dinh
1073741824 bytes
1223540 bytes
964691084 bytes
104857600 bytes
Page 10 of 14
5/11/2007
2969600 bytes
1073741824 bytes
1223540
964691084
104857600
2969600
bytes
bytes
bytes
bytes
restore database
RMAN> restore database;
Starting restore at 10-MAY-2007 02:53:06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=47 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /ora_data01/TIGGER/system01.dbf
channel ORA_DISK_1: reading from backup piece
/orabackup/TIGGER/DB_TIGGER_20070510_0pihb8kb_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/orabackup/TIGGER/DB_TIGGER_20070510_0pihb8kb_1_1 tag=10MAY2007
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /ora_data02/TIGGER/undotbs01.dbf
channel ORA_DISK_1: reading from backup piece
/orabackup/TIGGER/DB_TIGGER_20070510_0qihb8kr_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/orabackup/TIGGER/DB_TIGGER_20070510_0qihb8kr_1_1 tag=10MAY2007
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
Michael T. Dinh
Page 11 of 14
5/11/2007
recover database
RMAN> recover database;
Starting recover at 10-MAY-2007 02:56:00
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /ora_data01/TIGGER/system01.dbf
channel ORA_DISK_1: reading from backup piece
/orabackup/TIGGER/DB_TIGGER_20070510_10ihb959_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/orabackup/TIGGER/DB_TIGGER_20070510_10ihb959_1_1 tag=10MAY2007
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: /ora_data02/TIGGER/undotbs01.dbf
channel ORA_DISK_1: reading from backup piece
/orabackup/TIGGER/DB_TIGGER_20070510_11ihb95a_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/orabackup/TIGGER/DB_TIGGER_20070510_11ihb95a_1_1 tag=10MAY2007
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00003: /ora_data01/TIGGER/sysaux01.dbf
channel ORA_DISK_1: reading from backup piece
/orabackup/TIGGER/DB_TIGGER_20070510_12ihb95b_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/orabackup/TIGGER/DB_TIGGER_20070510_12ihb95b_1_1 tag=10MAY2007
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
starting media recovery
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=14
channel ORA_DISK_1: reading from backup piece
/orabackup/TIGGER/AL_TIGGER_20070510_14ihb95e_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/orabackup/TIGGER/AL_TIGGER_20070510_14ihb95e_1_1 tag=10MAY2007
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Michael T. Dinh
Page 12 of 14
5/11/2007
Verified Recovery
SQL>
SQL>
2
3
NAME
-------------------------------------------------------------------------------/ora_data01/TIGGER/sysaux01.dbf
/ora_data01/TIGGER/system01.dbf
/ora_data02/TIGGER/undotbs01.dbf
/ora_data03/TIGGER/users01.dbf
/ora_redo1a/TIGGER/redo01a.log
/ora_redo1a/TIGGER/redo03a.log
/ora_redo1b/TIGGER/redo01b.log
/ora_redo1b/TIGGER/redo03b.log
/ora_redo2a/TIGGER/redo02a.log
/ora_redo2a/TIGGER/redo04a.log
/ora_redo2b/TIGGER/redo02b.log
/ora_redo2b/TIGGER/redo04b.log
/ora_temp01/TIGGER/temp01.dbf
13 rows selected.
SQL> select count(*) from (select * from dba_objects order by 1);
COUNT(*)
---------9444
SQL> select count(*) from t;
COUNT(*)
---------9444
Michael T. Dinh
Page 13 of 14
5/11/2007
Archive Mode
Enabled
/ora_arch01/TIGGER
0
1
1
NAME
TYPE
VALUE
--------------------------- ----------- --------------------------------------spfile
string
/oracle/10gr2/db_1/dbs/spfileTIGGER.ora
SQL>
Q.E.D.
Disclaimer: The information in this document is the opinion of the author, not of Oracle Corporation. Any content, materials,
information or software downloaded or otherwise obtained through the use of the site is done at your own discretion and risk.
Oracle shall have no responsibility for any damage to your computer system or loss of data that results from the download
of any content, materials, information or software.
Michael T. Dinh
Page 14 of 14
5/11/2007