Professional Documents
Culture Documents
Step By Step Guide To Create Physical Standby Database Using RMAN Backup and Restore (Doc
ID 469493.1)
In this Document
Goal
Solution
References
APPLIES TO:
Oracle Database - Enterprise Edition - Version 9.0.1.0 to 11.2.0.3 [Release 9.0.1 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 12-Dec-2010***
GOAL
Step by step guide on how to create a physical standby database using RMAN without using duplicate
command.
SOLUTION
Step 1: Backup the database that includes backup of datafiles, archivelogs and controlfile for standby
Step 2: Move the backups to the standby server
Step 3: Make proper changes in the parameter files of both primary and standby database
Step 4: Do the restore and recover on standby database
Step 5: Put the standby database in recover managed mode
Example :
=======
Step 1: Backup the primary database that includes backup of datafiles, archivelogs and controlfile for standby
RMAN> run
2> {
3> allocate channel c1 type disk;
4> allocate channel c2 type disk;
5> allocate channel c3 type disk;
6> backup database plus archivelog;
7> }
allocated channel: c2
channel c2: sid=138 devtype=DISK
allocated channel: c3
channel c3: sid=137 devtype=DISK
1 of 10 26/07/16 12:44
Document 469493.1 https://support.oracle.com/epmos/faces/Documen...
2 of 10 26/07/16 12:44
Document 469493.1 https://support.oracle.com/epmos/faces/Documen...
RMAN> run
2> {
3> allocate channel c1 type disk;
4> backup current controlfile for standby;
5> }
allocated channel: c1
channel c1: sid=159 devtype=DISK
Step 3: Make proper changes in the parameter files of both primary and standby database
log_archive_dest_2='SERVICE=STANDBY'
3 of 10 26/07/16 12:44
Document 469493.1 https://support.oracle.com/epmos/faces/Documen...
Copy the primary database parameter file and make necessary changes :
db_unique_name='standby'
instance_name='standby'
db_file_name_convert='/u01/oracle/product/oradata/ora10g/data/','/u01/oracle/product/ora10g/oradata/standby
/data/','/tmp/','/u01/oracle/product/ora10g/oradata/standby/data/'
log_file_name_convert='/u01/oracle/product/oradata/ora10g/log/','/u01/oracle/product/ora10g/oradata
/standby/log'
standby_archive_dest='/u01/oracle/product/ora10g/oradata/standby/arch1'
Comment:
---------
# The below convert parameters are only applicable only when you use RMAN DUPLICATE . They donot work for
Normal RMAN RESTORE operation (You would need to use Set newname for datafile )
#
db_file_name_convert=
log_file_name_convert=
o Exception:
If "STANDBY CONTROLFILE" is used/restored o like use option 'standby controlfile'
o After STANDBY CONTROLFILE is restored, you can mount the AUX Instance and verify DB_FILE_NAME_CONVERT
parameter is used and show correct datafile path/name using for example:
Note : After the restore try to identify the last archivelog sequence that is backed up and add 1 to it and do the recovery
using it. In the below example the last archivelog that is backed up is sequence 36 and we added 1 to it that becomes 37
and we recovered till sequence 37.
4 of 10 26/07/16 12:44
Document 469493.1 https://support.oracle.com/epmos/faces/Documen...
From 10g onwards you need to use the below command to restore controlfile :
# Sample script:
# ---------------
# If filesystem layout is different at standby, use SET NEWNAME to restore files
# for more details see RMAN documentation
RMAN> run {
ALLOCATE CHANNEL c1 DEVICE TYPE DISK ;
...
Starting restore at 09:DEC:2007:15:20:18
Starting implicit crosscheck backup at 09:DEC:2007:15:20:18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
Crosschecked 14 objects
Finished implicit crosscheck backup at 09:DEC:2007:15:20:20
5 of 10 26/07/16 12:44
Document 469493.1 https://support.oracle.com/epmos/faces/Documen...
..
datafile 1 switched to datafile copy
datafile 2 switched to datafile copy
datafile 3 switched to datafile copy
datafile 4 switched to datafile copy
..
RMAN>
# The below command will list all the archivelogs which are backed up and from this list we need to
identify the maximum sequence for recovery.
6 of 10 26/07/16 12:44
Document 469493.1 https://support.oracle.com/epmos/faces/Documen...
7 of 10 26/07/16 12:44
Document 469493.1 https://support.oracle.com/epmos/faces/Documen...
RMAN> exit
Note : No need to worry about the errors, you can safely ignore and move to step 5.
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/oracle/product/ora10g/oradata/standby/data/sys01.dbf'
After ensuring connectivity from primary to standby using the service specified in LOG_ARCHIVE_DEST_2 parameter of
primary and creating a password file on standby with the same sys password as primary, we can start managed recovery
on standby.
8 of 10 26/07/16 12:44
Document 469493.1 https://support.oracle.com/epmos/faces/Documen...
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> alter database recover managed standby database disconnect from session;
Database altered.
Community Discussion
You can directly participate in the Discussion about this article below. The Frame is the interactive live
Discussion - not a Screenshot ;-)
9 of 10 26/07/16 12:44
Document 469493.1 https://support.oracle.com/epmos/faces/Documen...
All Places > My Oracle Support Community > Oracle Database (MOSC) > Database Backup and Recovery (MOSC)
This is a good note on creating a physical standby database, including examples and screen shots:
Step By Step Guide To Create Physical Standby Database Using RMAN Backup and Restore (
Reem
(0 ratings)
These notes are written for users, so input from you is very important.
REFERENCES
NOTE:838828.1 - Step-By-Step Guide To Create Physical Standby On Normal File System For ASM Primary using RMAN
Didn't find what you are looking for?
10 of 10 26/07/16 12:44