1. Backup and Restore of database on 2-Node RAC
Introduction:
This document provides a high level overview and steps to restore a 2-node RAC database
which we did in one of our environments recently.
Environment Details:
DBName : TEST1
Oracle version: 11gR2
Steps:
1. Take a backup of the database or else use the last successful backup from tape / disk
2. Created the parameter file with the bare minimum parameters for the database to
startup.
vi initTEST1.ora
*.audit_file_dest='/u01/app/oracle/admin/TEST1/adump'
*.audit_trail='db'
*.compatible='11.2.0.2.0'
*.control_files='+DATA','+FRA'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_create_online_log_dest_1='+DATA'
*.db_name='RAC'
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_dest_1='LOCATION=+FRA'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=1658847232
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.cluster_database=false
3. Start the database in NOMOUNT stage for restore and recovery from the backup:
[oracle@MYHOST1 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Thu Aug 1 05:58:30 2013
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='initTEST1.ora'
2. ORACLE instance started.
Total System Global Area 1653518336 bytes
Fixed Size 2213896 bytes
Variable Size 956303352 bytes
Database Buffers 687865856 bytes
Redo Buffers 7135232 bytes
SQL> exit
4. Connect to the Oracle Recovery Manager and restore the control file associated with the
recent backup that is planned to be restored.
Connect to RMAN:
[oracle@MYHOST1 dbs]$ rman target /
Recovery Manager: Release 11.2.0.2.0 - Production on Thu Aug 1 05:59:28 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: RAC (not mounted)
RMAN> restore controlfile from autobackup
Starting restore at 17-JUN-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=29 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:08
output file name=+DATA/TEST1/controlfile/current.236.7445645
output file name=+FRA/TEST1/controlfile/current.235.7445645
Finished restore at 17-JUN-14
RMAN> alter database mount;
database mounted
released channel: ORA_DISK_1
5. Initiate a restore of the database once the control file is restored and the DB is in
mount state as shown below.
RMAN> restore database;
Starting restore at 17-JUN-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=29 device type=DISK
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/TEST1/system.356.1123822
3. channel ORA_DISK_1: restoring datafile 00004 to +DATA/TEST1/users. 356.1223822
channel ORA_DISK_1: reading from backup piece
channel ORA_DISK_1: piece
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to
+DATA/rac/datafile/undotbs1.314.822277039
channel ORA_DISK_1: restoring datafile 00005 to
+DATA/rac/datafile/undotbs2.315.822277039
channel ORA_DISK_1: reading from backup piece channel ORA_DISK_1: piece
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to +DATA/ TEST1/sysaux.311.822277081
channel ORA_DISK_1: reading from backup piece
channel ORA_DISK_1: piece
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
Finished restore at 17-JUN-14
Recover the database
RMAN> recover database;
Starting recover at 17-JUN-14
using channel ORA_DISK_1
starting media recovery
archived log for thread 1 with sequence 8 is already on disk as file
+FRA/TEST1/2014_06_17/thread_1_seq_8.412.822282953
archived log for thread 2 with sequence 6 is already on disk as file
+FRA/TEST1/2014_06_17/thread_2_seq_6.413.822282955
archived log file name=+FRA/TEST1/2014_06_17/thread_1_seq_8.412.822282953 thread=1
sequence=8
archived log file name=+FRA/TEST1/2014_06_17/thread_2_seq_6.413.822282955 thread=2
sequence=6
archived log file name=+FRA/TEST1/2014_06_17/thread_1_seq_9.415.822287039 thread=1
sequence=9
archived log file name=+FRA/TEST1/2014_06_17/thread_2_seq_7.414.822286061 thread=2
sequence=7
unable to find archived log
archived log thread=2 sequence=8
6. Open the database with resetlogs:
4. RMAN> alter database open resetlogs;
database opened
RMAN> exit
Recovery Manager complete.
7. Start the database
SQL> startup
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2220200 bytes
Variable Size 616566616 bytes
Database Buffers 444596224 bytes
Redo Buffers 5554176 bytes
Database mounted.
Database opened.
8. Once the DB is started, add the entries and start using the server control utility.
Start the database using SRVCTL:
[oracle@MYHOST1 dbs]$ srvctl status database -d RAC
Instance TEST1 is not running on node MYHOST1
[oracle@MYHOST1 dbs]$ srvctl start database -d RAC
[oracle@MYHOST1 dbs]$ srvctl status database -d RAC
Instance TEST1 is running on node MYHOST1