Oracle 10g RAC RMAN backup Example
Closed database and delete datafile
[oracle@racnode1 backup]$ srvctl stop database -d racdb
[oracle@racnode1 backup]$ asmcmd
ASMCMD> ls
DATADG/
FLASHDG/
ASMCMD> cd datadg
ASMCMD> ls
RACDB/
ASMCMD> cd racdb
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileracdb.ora
ASMCMD> cd PARAMETERFILE
ASMCMD> ls
spfile.268.802541131
ASMCMD> cd ..
ASMCMD> cd datafile
ASMCMD> ls
EXAMPLE.264.802540751
SYSAUX.257.802540615
SYSTEM.256.802540615
UNDOTBS1.258.802540615
UNDOTBS2.265.802540981
UNDOTBS3.269.802888323
USERS.259.802540615
ASMCMD> rm EXAMPLE.264.802540751
ASMCMD> rm *
You may delete multiple files and/or directories.
Are you sure? (y/n) y
ASMCMD> ls
asmcmd: entry 'datafile' does not exist in directory '+datadg/racdb/'
ASMCMD>
Start racnode1, racnode2, racnode3 instance to mount state
[oracle@racnode1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 15:47:31 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 599785472 bytes
Fixed Size 2098112 bytes
Variable Size 201329728 bytes
Database Buffers 390070272 bytes
Redo Buffers 6287360 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '+DATADG/racdb/datafile/system.256.802540615'
SQL>
[oracle@racnode2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 15:47:55 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 599785472 bytes
Fixed Size 2098112 bytes
Variable Size 197135424 bytes
Database Buffers 394264576 bytes
Redo Buffers 6287360 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '+DATADG/racdb/datafile/system.256.802540615'
SQL>
[oracle@racnode3 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 15:48:11 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 599785472 bytes
Fixed Size 2098112 bytes
Variable Size 163580992 bytes
Database Buffers 427819008 bytes
Redo Buffers 6287360 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 1 - see DBWR trace file
ORA-01110: data file 1: '+DATADG/racdb/datafile/system.256.802540615'
SQL>
recovery database
[oracle@racnode1 backup]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Tue Dec 25 16:01:30 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: RACDB (DBID=800157471, not open)
RMAN> run{
2> restore database;
3> recover database;
4> alter database open;
5> }
Starting restore at 2012-12-25 16:01:47
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=861 instance=racdb1 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=868 instance=racdb2 devtype=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: sid=861 instance=racdb3 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 +DATADG/racdb/datafile/system.269.802972261
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/backup/RACDB_LVL0_20121225_01ntomb3_s1_p1
channel ORA_DISK_2: starting datafile backupset restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
restoring datafile 00003 to +DATADG/racdb/datafile/sysaux.265.802972263
restoring datafile 00004 to +DATADG/racdb/datafile/users.257.802972267
restoring datafile 00006 to +DATADG/racdb/datafile/undotbs2.259.802972265
channel ORA_DISK_2: reading from backup piece /u01/app/oracle/backup/RACDB_LVL0_20121225_02ntomb3_s2_p1
channel ORA_DISK_3: starting datafile backupset restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
restoring datafile 00002 to +DATADG/racdb/datafile/undotbs1.256.802972267
restoring datafile 00005 to +DATADG/racdb/datafile/example.258.802972265
restoring datafile 00007 to +DATADG/racdb/datafile/undotbs3.264.802972269
channel ORA_DISK_3: reading from backup piece /u01/app/oracle/backup/RACDB_LVL0_20121225_03ntomb3_s3_p1
channel ORA_DISK_3: restored backup piece 1
piece handle=/u01/app/oracle/backup/RACDB_LVL0_20121225_03ntomb3_s3_p1 tag=DB_INC0
channel ORA_DISK_3: restore complete, elapsed time: 00:01:24
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/backup/RACDB_LVL0_20121225_01ntomb3_s1_p1 tag=DB_INC0
channel ORA_DISK_1: restore complete, elapsed time: 00:01:50
channel ORA_DISK_2: restored backup piece 1
piece handle=/u01/app/oracle/backup/RACDB_LVL0_20121225_02ntomb3_s2_p1 tag=DB_INC0
channel ORA_DISK_2: restore complete, elapsed time: 00:01:49
Finished restore at 2012-12-25 16:03:45
Starting recover at 2012-12-25 16:03:45
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
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: +DATADG/racdb/datafile/system.269.802972261
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/backup/RACDB_LVL1_20121225_0anton25_s10_p1
channel ORA_DISK_2: starting incremental datafile backupset restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
destination for restore of datafile 00003: +DATADG/racdb/datafile/sysaux.265.802972263
destination for restore of datafile 00004: +DATADG/racdb/datafile/users.257.802972267
destination for restore of datafile 00006: +DATADG/racdb/datafile/undotbs2.259.802972265
channel ORA_DISK_2: reading from backup piece /u01/app/oracle/backup/RACDB_LVL1_20121225_0bnton25_s11_p1
channel ORA_DISK_3: starting incremental datafile backupset restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: +DATADG/racdb/datafile/undotbs1.256.802972267
destination for restore of datafile 00005: +DATADG/racdb/datafile/example.258.802972265
destination for restore of datafile 00007: +DATADG/racdb/datafile/undotbs3.264.802972269
channel ORA_DISK_3: reading from backup piece /u01/app/oracle/backup/RACDB_LVL1_20121225_0cnton25_s12_p1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/backup/RACDB_LVL1_20121225_0anton25_s10_p1 tag=DB_INC1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:00
channel ORA_DISK_2: restored backup piece 1
piece handle=/u01/app/oracle/backup/RACDB_LVL1_20121225_0bnton25_s11_p1 tag=DB_INC1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:02
channel ORA_DISK_3: restored backup piece 1
piece handle=/u01/app/oracle/backup/RACDB_LVL1_20121225_0cnton25_s12_p1 tag=DB_INC1
channel ORA_DISK_3: restore complete, elapsed time: 00:00:02
starting media recovery
archive log thread 1 sequence 20 is already on disk as file /u01/app/oracle/arch/1_20_802540708.dbf
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=19
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/backup/RACDB_ARCH_20121225_0dnton3c_s13_p1
channel ORA_DISK_2: starting archive log restore to default destination
channel ORA_DISK_3: starting archive log restore to default destination
channel ORA_DISK_2: restoring archive log
archive log thread=2 sequence=11
channel ORA_DISK_2: reading from backup piece /u01/app/oracle/backup/RACDB_ARCH_20121225_0enton3c_s14_p1
channel ORA_DISK_3: restoring archive log
archive log thread=3 sequence=4
channel ORA_DISK_3: reading from backup piece /u01/app/oracle/backup/RACDB_ARCH_20121225_0fnton3c_s15_p1
channel ORA_DISK_1: restored backup piece 1
piece handle=/u01/app/oracle/backup/RACDB_ARCH_20121225_0dnton3c_s13_p1 tag=ARCH_INC1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archive log filename=/u01/app/oracle/arch/1_19_802540708.dbf thread=1 sequence=19
media recovery complete, elapsed time: 00:00:05
channel ORA_DISK_2: restored backup piece 1
piece handle=/u01/app/oracle/backup/RACDB_ARCH_20121225_0enton3c_s14_p1 tag=ARCH_INC1
channel ORA_DISK_2: restore complete, elapsed time: 00:00:06
channel ORA_DISK_3: restored backup piece 1
piece handle=/u01/app/oracle/backup/RACDB_ARCH_20121225_0fnton3c_s15_p1 tag=ARCH_INC1
channel ORA_DISK_3: restore complete, elapsed time: 00:00:06
Finished recover at 2012-12-25 16:03:58
database opened
RMAN>
validate
[oracle@racnode1 ~]$ srvctl start service -d racdb -s zwc
[oracle@racnode1 ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Dec 25 16:12:08 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
SQL> conn hr/hr@racdb
Connected.
SQL> conn hr/hr@racdb1
Connected.
SQL> conn hr/hr@racdb2
Connected.
SQL> conn hr/hr@racdb3
Connected.
SQL> select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') dt from dual;
DT
-------------------
2012-12-25 16:12:36
SQL>
SQL> !crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.racdb.db application 0/0 0/1 ONLINE ONLINE racnode2
ora....b1.inst application 0/5 0/0 ONLINE ONLINE racnode1
ora....b2.inst application 0/5 0/0 ONLINE ONLINE racnode2
ora....b3.inst application 0/5 0/0 ONLINE ONLINE racnode3
ora.....zwc.cs application 0/0 0/1 ONLINE ONLINE racnode1
ora....db1.srv application 0/0 0/0 ONLINE ONLINE racnode1
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE racnode1
ora....E1.lsnr application 0/5 0/0 ONLINE ONLINE racnode1
ora....de1.gsd application 0/5 0/0 ONLINE ONLINE racnode1
ora....de1.ons application 0/3 0/0 ONLINE ONLINE racnode1
ora....de1.vip application 0/0 0/0 ONLINE ONLINE racnode1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE racnode2
ora....E2.lsnr application 0/5 0/0 ONLINE ONLINE racnode2
ora....de2.gsd application 0/5 0/0 ONLINE ONLINE racnode2
ora....de2.ons application 0/3 0/0 ONLINE ONLINE racnode2
ora....de2.vip application 0/0 0/0 ONLINE ONLINE racnode2
ora....SM3.asm application 0/5 0/0 ONLINE ONLINE racnode3
ora....E3.lsnr application 0/5 0/0 ONLINE ONLINE racnode3
ora....de3.gsd application 0/5 0/0 ONLINE ONLINE racnode3
ora....de3.ons application 0/3 0/0 ONLINE ONLINE racnode3
ora....de3.vip application 0/0 0/0 ONLINE ONLINE racnode3
SQL> select INSTANCE_NAME,HOST_NAME,VERSION,TO_CHAR(STARTUP_TIME,'YYYY-MM-DD HH24:MI:SS') DT,STATUS,ACTIVE_STATE,INSTANCE_ROLE,DATABASE_STATUS from gv$INSTANCE;
INSTANCE_NAME HOST_NAME VERSION DT STATUS ACTIVE_ST INSTANCE_ROLE DATABASE_STATUS
---------------- ---------- ----------------- ------------------- ------------ --------- ------------------ -----------------
racdb2 racnode2 10.2.0.5.0 2012-12-25 16:08:08 OPEN NORMAL PRIMARY_INSTANCE ACTIVE
racdb1 racnode1 10.2.0.5.0 2012-12-25 16:08:07 OPEN NORMAL PRIMARY_INSTANCE ACTIVE
racdb3 racnode3 10.2.0.5.0 2012-12-25 16:08:08 OPEN NORMAL PRIMARY_INSTANCE ACTIVE