Create Physical Standby on Normal File System for ASM Primary
Source Setup Details:
Host Name: SUN1
IP: 192.168.126.2
Oracle Home: /export/home/oracle/oracle/product/db_1
DB Name: INDIAN
PORT: 1521
ASM DISK GROUP: DB_DATA01
Target Setup Details:
Host Name: SUN2
IP: 192.168.126.3
Oracle Home: /export/home/oracle/oracle/product/db_1
DB Name: INDIAN
INSTANCE Name: STANDBY
DB_UNIQUE_NAME: STANDBY
PORT: 1521
Standby database can be created using the following 2 methods:
1. Normal Restore and Recovery using RMAN.
2. Creating a Duplicate database for Standby using RMAN.
Method 1:
Step 1 Perform the backup of the ASM primary database (Datafiles, Control file for standby & Archive logs)
$ rman target /
RMAN>backup database format ‘/export/home/oracle/rman/database_%U.bkp’;
RMAN>backup archivelog format ‘/export/home/oracle/rman/archivelog_%U.bkp’;
RMAN>backup current controlfile for standby format ‘/export/home/oracle/rman/stdb_cntl_%U.bkp’;
Step 2 Make the backup pieces available on the Standby server
• FTP or SCP the backup pieces to standby server. While doing FTP make sure to do it in binary mode only. OR
• NFS mount then mount the NFS on standby server with the same name as you mounted on primary database. OR
• If the backups are on tape then make sure that you make proper changes on standby server so that you can restore the backups on standby server.
Step 3 Copy the primary database parameter file to Standby host and make necessary changes.
Copy initINDIAN.ora file to Standby Host Machine and Rename with initSTANDBY.ora
Control_files=’/export/home/oracle/database/standby.ctl’
db_unique_name=’STANDBY’
instance_name=’STANDBY’
standby_archive_dest=’/export/home/oracle/arch’
db_file_name_convert=’+DB_DATA01/INDIAN/datafile/’,’/export/home/oracle/database/’,’+DB_DATA01/INDIAN/tempfile/’,’/export/home/oracle/database’ log_file_name_convert=’+DB_DATA01/INDIAN/onlinelog/’,’//export/home/oracle/database/’
Step 4 Create the password file for standby database with the same password as primary
$ export ORACLE_SID=STANDBY
$orapwd file=orapwSTANDBY password=
In standby server
– configure listener.
In Primary server
– configure tnsnames for standby.
– check connectivity using tnsping.
Step 6 Perform restore and Recovery on standby database.
$ export ORACLE_SID=STANDBY
SQL> startup nomount
$ rman target /
RMAN>reatore standby controlfile from ‘
RMAN> restore database;
Note: If the backup pieces are in different location you need to catalog them manually
Example
RMAN> catalog backuppiece ‘
Step 7 Configure the primary database to transfer the archives to standby
• Set the following parameter in the primary database: log_archive_dest_2=’SERVICE=STANDBY’
• Perform a log switch and make sure that archive are getting transfer to standby destination.
Step 8 Start the Redo applies by putting the database in Recover managed mode.
In Standby database start the managed recovery process
SQL> Recover managed standby database disconnect from session;
Method 2:
Complete all Step 1 to 5, which is in Method 1
Step 6 Perform restore and Recovery on standby database.
$ export ORACLE_SID=STANDBY
SQL> startup nomount
$ rman target sys/anup123@indiandba auxiliary /
RMAN> duplicate target database for standby;
Step 7 Configure the primary database to transfer the archives to standby
• Set the following parameter in the primary database: log_archive_dest_2=’SERVICE=STANDBY’
• Perform a log switch and make sure that archive are getting transfer to standby destination.
Step 8 Start the Redo applies by putting the database in Recover managed mode.
In Standby database start the managed recovery process
SQL>; Recover managed standby database disconnect from session;
Thanks this was very helpful. Thank you for posting it.
Hi Anup
how to implement a data guard where both primary and standby databases use ASM filesystem
can you please tell me steps how to implement
warm Regards
Vijay.S