Create Data Guard Physical Standby On Exadata
Create Data Guard Physical Standby On Exadata
Create Data Guard Physical Standby On Exadata
Purpose
This note describes the procedure of creating an Oracle 11.2.0.4 Data Guard Physical Standby
database with a two-node Real Application Cluster (RAC) Primary and Standby database on an
Oracle Exadata X5-2 eight rack.
The procedure will use RMAN for the creation of the Physical Standby database and will use the
DUPLICATE FROM ACTIVE DATABASE method which is available in Oracle 11g.
Note - creation of the Standby database is done online while the Primary database is open and
being accessed and no physical RMAN backups are utilized for the purpose of creating the
standby database.
The note also describes the process of configuring Data Guard Broker to manage the Data
Guard environment and also illustrates how to perform a database role-reversal via a Data
Guard switch over operation.
Environment
Copy the password file from the $ORACLE_HOME/dbs directories on both the Exadata compute nodes
to both the target Exadata compute nodes
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=DEVPD1)
)
)
Do this on both compute nodes and add the entries in the $TNS_ADMIN for both the grid as well as the
oracle user.
The AUXDB TNS alias will be used for RMAN standby database creation and the SOURCEDB TNS alias will
be used to connect to the source database and those connections will use the VIP
10.100.24.12: exadb01-vip.gav.com.au
10.101.24.12: exbdb01-vip.gav.com.au
AUXDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.24.12)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID=DEVPD1)
)
)
SOURCEDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.101.24.12)(PORT = 1521)) >>>
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = DEVPD1)
)
)
DEVPD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = exdb1-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DEVPD.gav.com.au)
)
)
DEVPD_SB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = exda1-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DEVPD_SB.GAV.COM.AU)
)
)
Connected to the source database DEVPD, create a temporary init.ora file from the existing source
database SPFILE.
File created.
Copy this file to one of the Exadata target compute nodes $ORACLE_HOME/dbs directory
*.cluster_database=false
*.control_files='+DATAC1','+DATAC1'
*.db_unique_name='DEVPD_SB'
*.fal_client='DEVPD_SB'
*.fal_server='DEVPD'
*.log_archive_config='dg_config=(DEVPD,DEVPD_SB)'
*.log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST
valid_for=(all_logfiles,all_roles) db_unique_name=DEVPD_SB'
*.remote_listener='exda1-scan:1521'
*.standby_file_management='AUTO'
In this case the same disk groups are available so no need to worry about setting parameters
DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT
for example
DB_FILE_NAME_CONVERT='+SOURCE_ASM_DISK_GROUP1','+TARGET_ASM_DISK_GROUP1','+SO
URCE_ASM_DISK_GROUP2','+TARGET_ASM_DISK_GROUP2'
Note: We have to connect using TNS names alias to both Primary Target as well as Auxiliary - otherwise
will see error like:
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Note: nofilenamecheck is required if the file names on the target will exactly match that of the source
run {
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate auxiliary channel c5 type disk;
duplicate target database for standby
from active database
nofilenamecheck
dorecover;
}
DATABASE_ROLE
----------------
PHYSICAL STANDBY
OPEN_MODE
--------------------
MOUNTED
File created.
File created.
System altered.
Database dismounted.
ORACLE instance shut down.
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY
PHYSICAL STANDBY READ ONLY
System altered.
System altered.
SQL>
alter system set log_Archive_dest_2='service=DEVPD_SB async noaffirm
reopen=15 valid_for=(all_logfiles,primary_role) db_unique_name=DEVPD_SB'
scope=both sid='*';
System altered.
System altered.
Note: we need to create the Standby Redo Log Files on both the Primary as well as the Standby
database.
Check the number and size of the redo log files on the Primary database.
We need to create Standby Redo log files same size but one more group in number that the online redo
log files
GROUP# THREAD#
---------- ----------
1 1
2 1
3 1
4 2
5 2
6 2
6 rows selected.
Database altered.
Database altered.
Database altered.
Database altered.
Database altered.
Database altered.
Database altered.
SQL>
As the Grid Infrastructure owner add the following lines to the listener.ora and restart the
listener.
On exbdb01
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=DEVPD_DGMGRL.gav.com.au)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=DEVPD1)
)
)
On exbdb02
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=DEVPD_DGMGRL.gav.com.au)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=DEVPD2)
)
)
As the Grid Infrastructure owner add the following lines to the listener.ora and restart the
listener.
On exadb01
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=DEVPD_SB_DGMGRL.gav.com.au)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
On exadb02
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=DEVPD_SB_DGMGRL.gav.com.au)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=DEVPD2)
)
)
Note: Restart the listener on both nodes after making changes to the listener.ora
SQL>
alter system set dg_broker_config_file1='+DATAC1/devpd/dr1.dat' sid='*'
scope=both;
System altered.
Configuration - devpd_dg
Configuration Status:
SUCCESS
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
RMAN> run {
2> allocate channel c1 type disk;
3> allocate channel c2 type disk;
4> allocate channel c3 type disk;
5> allocate channel c4 type disk;
6> allocate auxiliary channel c5 type disk;
7> duplicate target database for standby
8> from active database
9> nofilenamecheck
10> dorecover;
11> }
allocated channel: c2
channel c2: SID=1186 instance=DEVPD1 device type=DISK
allocated channel: c3
channel c3: SID=477 instance=DEVPD2 device type=DISK
allocated channel: c4
channel c4: SID=714 instance=DEVPD2 device type=DISK
allocated channel: c5
channel c5: SID=475 device type=DISK
archived log for thread 1 with sequence 8802 is already on disk as file
+RECOC1/devpd_sb/archivelog/2016_03_30/thread_1_seq_8802.325.907865887
archived log for thread 1 with sequence 8803 is already on disk as file
+RECOC1/devpd_sb/archivelog/2016_03_30/thread_1_seq_8803.362.907865889
archived log for thread 1 with sequence 8804 is already on disk as file
+RECOC1/devpd_sb/archivelog/2016_03_30/thread_1_seq_8804.374.907865891
RMAN>
RMAN>