Professional Documents
Culture Documents
-------------
**For first time Dr setup in a particualr os user we need to change the group from oinstall to asmadmin for oracle binary.Please refer to below
for the process:-
*************MODIFICATION IN LISTENER.ORA*******************************
Before starting please check whether any listener viz. DGOPS is running or not.We will be using DGOPS listener to configure DG broker along
with its operations.
Please verify whether the DGOPS listener service is running or not.If not running you need to start it and if the listener is not present you need to
add in listener.ora localted in GRID_HOME/network/admin folder
DGOPS =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa-vip)(PORT = 1522))
)
)
********************************************************************************
1) On Primary
Validation
-------------
select NAME,inst_id,FORCE_LOGGING from gv$database;
b) ADD ONE MORE REDO LOG GROUP AND Create standby redo logs ( DO NOT MULTIPLEX)
EG
alter database add standby logfile thread 1 group 11 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 12 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 13 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 14 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 15 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 1 group 16 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 17 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 18 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 19 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 20 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 21 ('+FRA_ICOE') size 200M;
alter database add standby logfile thread 2 group 22 ('+FRA_ICOE') size 200M;
Validation
-------------
set line 200
col MEMBER for a100
select group#, MEMBER, type from v$logfile;
(it will show a total of 32 rows, 22 groups with group # 11 to group # 22 having one members each)
Eg
2) Setup Connectivity
*) Shutdown 2nd instance only and copy password from first instance of primary to second instance of primary and to rest of DR
instances
a) As per following example add the following Listener entry for the following nodes
Note:We need to create a test listener.That will be used for Dataguard configuration and then DGMGRL operations.
You may add below entries in the listener.ora (Please take backup of listener.ora before staring this)
++++++++++++
ON DR RAC NODE-1
SID_LIST_DGOPS=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME=vobpre01dr_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/
oraicoe/product/11.2.0.3)))
b) Set the tnsname entry as follows on all the nodes of RAC(Add in both grid and database owner user here oraicoe)
VOBPRE01PRI_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa)(PORT = 1522)) #change port
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pb)(PORT = 1522))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vobpre01pri_DGMGRL)
)
)
VOBPRE01DR_DGMGRL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orappa801pa)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vobpre01dr_DGMGRL)
)
)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++
a) copy the password file from the primary $ORACLE_HOME/dbs and rename it to the standby database name
i) copy the password file from primary node-1 to all dr nodes
DB_NAME=vobpre01
DB_UNIQUE_NAME=vobpre01dr
DB_BLOCK_SIZE=8192
pga_aggregate_target=512M
sga_target=1536M
c) Create the necessary directories in the standby location to place the datafiles and the trace files in the $ADR_HOME
(dbump,udump, adump etc.)
Eg --in node-1
mkdir -p /u01/app/oraicoe/diag/rdbms/vobpre01dr/vobpre011/trace
mkdir -p /u01/app/oraicoe/diag/rdbms/vobpre01dr/vobpre011/cdump
mkdir -p /u01/app/oraicoe/admin/vobpre01dr/adump
d) Set the environment variable ORACLE_SID to the standby service and start the standby-instance
$export ORACLE_SID=vobpre011
$sqlplus "/ as sysdba"
SQL> startup nomount pfile=$ORACLE_HOME/dbs/initvobpre011.ora
============================================
4) On Primary NODE-1
5) On the primary system invoke the RMAN executable and connect to the primary and the auxiliary database (connect tru
sys/password@****_DGMGRL for both target and aux)…then run the following
EXAMPLE
a) alter database recover managed standby database using current logfile disconnect;
b) for active DG ..stop the redo apply … open the db… start the redo apply
**** 7) On Standby NODE-1 : Edit the pfile and remove any references to primary db , except db_name this must be same as primary db. Set
instance specific instance_number, undo_tablespace, fal_client and thread.
8) On Standby NODE-1 : Shutdown the database and startup mount and create a spfile with +ASM diskgroup as the location
take the spfile name and create an alias for the spfile as recommended by oracle in the directory - '+DATA_ICOE/VOBPRE01DR'
9) On Standby NODE-1 : Create pfile file on each node's oracle home (ORACLE_HOME/dbs) that points to the spfile by adding one line that
referes to the spfile
edit the pfile and remove all the contents of the pfile and just put a link to the spfile in the ASM -
SPFILE='+DATA_ICOE/vobpre01dr/spfilevobpre01dr.ora'
10) Once above pfiles are created remove the spfile in $ORACLE_HOME/dbs that was created as part of the duplication.
11) Before bringing the standby instance start primary database.You need to do as below:-
On DR
12) To add the database and instances to the cluster configuration run (run this from oracle user using grid srvctl)
EXAMPLE
13) REMOVE ALL THE LISTENER ENTRY THAT WAS ADDEDD IN STEP 2 (a)
lsnrctl reload DGOPS
========================================================================================
SETUP listener_network
PRI01_LOCAL_NET1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa )(PORT = 1521)))
PRI01_LOCAL_NET2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa-vip )(PORT = 1522)))
PRI02_LOCAL_NET1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pb )(PORT = 1521)))
PRI02_LOCAL_NET2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pb-vip )(PORT = 1522)))
PRI_REMOTE_NET2 =
(DESCRIPTION_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pa-vip )(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = oramna801pb-vip )(PORT = 1522)))
DR01_LOCAL_NET1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orappa801pa )(PORT = 1521)))
DR01_LOCAL_NET2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orappa801pa-vip )(PORT = 1522)))
DR_REMOTE_NET2 =
(DESCRIPTION_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = orappa801pa-vip )(PORT = 1522)))
CONFIGURE DG BROKER -
1) Enter the following entry (in <<<<< >>>>>>> only)for listener.ora on each node of RAC. Change the entry as reqd. Plz. Note two entries are
reqd.
SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(GLOBAL_DBNAME =
vobpre01pri)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
<<<<< (SID_DESC=(GLOBAL_DBNAME = vobpre01pri_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
(SID_DESC=(GLOBAL_DBNAME = vobpre01dr_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3)) >>>>>> )
(SID_DESC=(GLOBAL_DBNAME = vobpre01pri_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
(SID_DESC=(GLOBAL_DBNAME = vobpre01dr_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
(SID_DESC=(GLOBAL_DBNAME = vobpre01pri_DGMGRL)(SID_NAME=vobpre012)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
(SID_DESC=(GLOBAL_DBNAME = vobpre01dr_DGMGRL)(SID_NAME=vobpre011)(ORACLE_HOME=/u01/app/oraicoe/product/11.2.0.3))
Now bounce the DGOPS listener for all primary and dr nodes(e.g. lsnrctl stop DGOPS and then lsnrctl start DGOPS)
ON PRIMARY NODE-1 :
alter system set dg_broker_config_file1 = '+DATA_ICOE/vobpre01pri/dgb1_vobpre01pri.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+FRA_ICOE/vobpre01pri/dgb2_vobpre01pri.dat' scope=both sid='*';
ON DR NODE-1 :
alter system set dg_broker_config_file1 = '+DATA_ICOE/vobpre01dr/dgb1_vobpre01dr.dat' scope=both sid='*';
alter system set dg_broker_config_file2 = '+FRA_ICOE/vobpre01dr/dgb2_vobpre01dr.dat' scope=both sid='*';
After Oracle confirmed these changes, start the broker on all databases:
$ dgmgrl
DGMGRL for Linux: Version 11.2.0.2.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> create configuration vobpre01_dgconfig as primary database is vobpre01pri connect identifier is vobpre01pri_dgmgrl;
=====================================================================
NOW ...DELETE ALL THE TNS ENTRY THAT WAS ADDED EARLIER FOR RMAN DUPLICATE COMMAND.
======================================================================================================================
=
======================
primary Site:-
srvctl add service -d vobpre01pri -s vobpre01app -r vobpre011,vobpre012 -l primary -z 180 -w 5 -m BASIC -e SELECT -y automatic
srvctl add service -d vobpre01pri -s vobpre01stb -r vobpre011,vobpre012 -l physical_standby -z 180 -w 5 -m BASIC -e SELECT -y automatic
After that
<<Once database is started,please check by srvctl status service -d vobpre01pri whether app service running and stb service is not running.If all
fine then do a switchover to DR ,once it is successfull do show configuration in dgmgrl prompt and verify.If all fine then move to DR for service
addition>>
<<Before proceeding to DR (after successfull switchover )please verify whether app service is not running and stb service is running in primary
site>>
DR site:-
srvctl add service -d vobpre01dr -s vobpre01app -r vobpre011 -l primary -z 180 -w 5 -m BASIC -e SELECT -y automatic
srvctl add service -d vobpre01dr -s vobpre01stb -r vobpre011 -l physical_standby -z 180 -w 5 -m BASIC -e SELECT -y automatic
VOBPRE01APP =
(DESCRIPTION = (CONNECT_TIMEOUT=10)(RETRY_COUNT=3)
(ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON)
(ADDRESS=(PROTOCOL=tcp)(HOST=oramna801p-scan)(PORT=1541))
(ADDRESS=(PROTOCOL=tcp)(HOST=orappa801p-scan)(PORT=1541))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vobpre01app)
)
)
VOBPRE01STB =
(DESCRIPTION = (CONNECT_TIMEOUT=10)(RETRY_COUNT=3)
(ADDRESS_LIST= (LOAD_BALANCE=on)(FAILOVER=ON)
(ADDRESS=(PROTOCOL=tcp)(HOST=oramna801p-scan)(PORT=1541))
(ADDRESS=(PROTOCOL=tcp)(HOST=orappa801p-scan)(PORT=1541))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = vobpre01stb)
)
)
========================
=============================