You are on page 1of 13

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page1of13

StepByStepofConfiguringOracle11gR2(11.2.0.1)RACtoRACDataguard:
ByBhavinHingu bhavin@oracledba.org <<HOME>> Thisdocumentexplainsthestepbystepprocessofbuildingthe11gR2(11.2.0.1)3-NodeRACprimaryto2-NodeRACPhysicalStandbyDataGuardonOracleEnterpriseLinux

TechnicalArchitectureof11gR2RACprimarytoRACstandbyDataGuardConfiguration:

Clusterware ClusterNodes SCAN SCANlistenerHost/port VIPs DB_UNIQUE_NAME DB_NAME DBInstances DBLISTENER DBListenerHost/port DBSTORAGE FileManagement ASMdiskgroupforDBfiles ASMDiskgroupforRecoveryFiles ORACLE_HOME 11gR2RACversion OS PRIMARY 11gR2GridInfrastructure(11.2.0.1) node1,node2,node3(3-nodeRAC) lab-scan.hingu.net SCANVIPs(port1525) node1-vip,node2-vip,node3-vip USA BHAVIN bhavin1,bhavin2,bhavin3 BHAVIN_LISTENER node1-vip,node2-vip,node3-vip(port1530) ASM OMF DATA FRA /u01/app/oracle/db11201 11.2.0.1 OracleEnterpriseLinux5.5(32bit) STANDBY 11gR2GridInfrastructure(11.2.0.1) dr-node1,dr-node2(2-nodeRAC) dr-lab-scan.hingu.net SCANVIPs(port1525) dr-node1-vip,dr-node2-vip INDIA BHAVIN bhavin1,bhavin2 BHAVIN_LISTENER dr-node1-vip,dr-node2-vip(port1530) ASM OMF DATA FRA /u01/app/oracle/db11201 11.2.0.1 OracleEnterpriseLinux5.5(32bit)

Existing Setup (Before the Dataguard Setup):


ItisassumedthatpreliminaryrequirementtoconfigureRACtoRAC11gR2Dataguardhasbeenestablished.HerearethescreenshotsfortheexistingSetupofPrimaryaswellasStandby site.

PRIMARYSite:
3-node11gR2GridInfrastructure(11.2.0.1)hasbeeninstalledandconfigured. 3-nodeRACsoftware(11.2.0.1)hasbeeninstalledandconfigured. ASMdiskgroupDATAandFRAhasbeencreated. DatabaseBHAVINiscreatedonASMandconfiguredtouseOMFs. DBlistenerBHAVIN_LISTENERhasbeencreatedandrunningonport1530. DatabaseInstancesareconfiguredwithLOCAL_LISTENERandREMOTE_LISTENERparameters.

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page2of13

DRSite: 2-node11gR2GridInfrastructure(11.2.0.1)hasbeeninstalledandconfigured. 2-nodeRACsoftware(11.2.0.1)hasbeeninstalledandconfigured. ASMdiskgroupDATAandFRAhasbeencreated. DBlistenerBHAVIN_LISTENERhasbeencreatedandrunningonport1530. Clickhereforthedetailinformationoninstalling/configuring11gR2GridInfrastructure,Installing11gR2RAC,creatingLISTENERsandcreatingaRACdatabaseonASM.

RAC to RAC Physical Dataguard:


PreparePrimarySite PrepareStandbySite CreateRACPhysicalStandbyDatabase ConfigureDataGuardBroker PerformSwitchover/FailoverusingDGBroker Prepare Primary RAC database for DR configuration: EnableForceLogging. ModifyinitParameters. EnableArchivelogMode. CreatetheSLRs(StandbyRedoLogs). BackuptheDatabaseforStandby Createpfileforstandbydatabase. Updatethetnsnames.ora. EnableForceLogging: alterdatabaseforcelogging; ModifyDataguardrelatedinitParameters: DB_NAME=BHAVIN DB_UNIQUE_NAME=USA
LOG_ARCHIVE_CONFIG='DG_CONFIG=(USA,INDIA)' LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DESTVALID_FOR=(ALL_LOGFILES,ALL_ROLES)DB_UNIQUE_NAME=USA' LOG_ARCHIVE_DEST_2='SERVICE=INDIAARCHVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)DB_UNIQUE_NAME=INDIA' LOG_ARCHIVE_DEST_STATE_1=ENABLE LOG_ARCHIVE_DEST_STATE_2=ENABLE REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE LOG_ARCHIVE_FORMAT=%t_%s_%r.arc LOG_ARCHIVE_MAX_PROCESSES=8 FAL_SERVER=INDIA DB_FILE_NAME_CONVERT='INDIA','USA' LOG_FILE_NAME_CONVERT='INDIA','USA' STANDBY_FILE_MANAGEMENT=AUTO

Thedb_unique_nameparameterhasalreadybeensettotheappropriatevalueduringtheinitialcreationoftheRACdatabase.Thelog_archive_dest_state_nand remote_login_passwordfilehavedefaultvaluessettoENABLEandEXCLUSIVErespectively.So,onlybelowmentionedparameterneededtobechangedhere.

altersystemsetLOG_ARCHIVE_CONFIG='DG_CONFIG=(USA,INDIA)'scope=bothsid='*'; altersystemsetLOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DESTVALID_FOR=(ALL_LOGFILES,ALL_ROLES)DB_UNIQUE_NAME=USA'scope=bothsid='*'; altersystemsetLOG_ARCHIVE_DEST_2='SERVICE=INDIAARCHVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)DB_UNIQUE_NAME=INDIA'scope=bothsid='*'; altersystemsetlog_archive_format='%t_%s_%r.arc'scope=spfilesid='*'; altersystemsetlog_archive_max_processes=8scope=bothsid='*'; altersystemsetfal_server=INDIAscope=bothsid='*'; altersystemsetdb_file_name_convert='INDIA','USA'scope=spfilesid='*'; altersystemsetlog_file_name_convert='INDIA','USA'scope=spfilesid='*'; altersystemsetstandby_file_management=AUTOscope=bothsid='*';

setlinesize500pages0 colvaluefora90 colnamefora50 selectname,value fromv$parameter wherenamein('db_name','db_unique_name','log_archive_config','log_archive_dest_1','log_archive_dest_2', 'log_archive_dest_state_1','log_archive_dest_state_2','remote_login_passwordfile', 'log_archive_format','log_archive_max_processes','fal_server','db_file_name_convert', 'log_file_name_convert','standby_file_management')

Verifythatthevaluesaresetcorrectlyfortheseparametersafterbouncingthedatabase.

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page3of13

EnableArchivelogMode:
srvctlstopdatabasedusa startupmount(onlyoneinstance) alterdatabasearchivelog alterdatabaseopen srvctlstartdatabasedusaThiswillstarttheremainingInstancesonthecluster.

CreatetheStandbyRedoLogs(SRLs)onPrimaryandStandby: Thereshouldbeminimumof(threads)*(groupsPerThreads+1)SLRscreatedonthestandbydatabase.Thereare3threadswith2groupsperthreadinthisconfigurationonthe primarysidesothereshouldbetotalof9SLRsatminimumneedstobecreated.LetsgetthetotalGroupsandMaxsizeofthelogfilefromv$log.


SQL>selectmax(bytes),count(1)fromv$log; MAX(BYTES)COUNT(1) -------------------- 524288006

Here,thetotalno.ofonlineredogroupsare6andthemaximumsizeofthesegroupsis52M.So,3StandbyRedoLoggroupsperthreadwithsizeof52Meachshouldbecreatedon Primaryaswellasstandbydatabase.
altersystemsetstandby_file_management=manualscope=bothsid='*'; alterdatabaseaddstandbylogfilethread1group7'+fra/usa/standbylog/standby_group_07.log'size52M; alterdatabaseaddstandbylogfilethread1group8'+fra/usa/standbylog/standby_group_07.log'size52M; alterdatabaseaddstandbylogfilethread1group9'+fra/usa/standbylog/standby_group_07.log'size52M; alterdatabaseaddstandbylogfilethread2group10'+fra/usa/standbylog/standby_group_10.log'size52M; alterdatabaseaddstandbylogfilethread2group11'+fra/usa/standbylog/standby_group_11.log'size52M; alterdatabaseaddstandbylogfilethread2group12'+fra/usa/standbylog/standby_group_12.log'size52M; alterdatabaseaddstandbylogfilethread3group13'+fra/usa/standbylog/standby_group_13.log'size52M; alterdatabaseaddstandbylogfilethread3group14'+fra/usa/standbylog/standby_group_14.log'size52M; alterdatabaseaddstandbylogfilethread3group15'+fra/usa/standbylog/standby_group_15.log'size52M; altersystemsetstandby_file_management=autoscope=bothsid='*';

ASMCMD>mkdir+fra/usa/STANDBYLOG(connectedasgriduserusingasmcmd)

BackupThePrimaryDatabaseForStandby. Takethebackupoftheprimarydatabaseandthestandbycontrolfile.CreatethestagingdirectorytoholdtheRMANbackup.
mkdir/home/oracle/backup rmantarget/nocatalog run { sql"altersystemswitchlogfile"; allocatechannelch1typediskformat'/home/oracle/backup/Primary_bkp_for_stndby_%U'; backupdatabase; backupcurrentcontrolfileforstandby; sql"altersystemarchivelogcurrent"; }

CreatepfileForStandby.
createpfile='pfile_for_standby.txt'fromspfile;

UpdateTNSNAMES.ora Addthetnsaliasforeachoftheinstancesoftheprimarydatabase.

USA1= (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip.hingu.net)(PORT=1530)) (CONNECT_DATA=

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page4of13

(SERVER=DEDICATED) (SERVICE_NAME=usa.hingu.net) (SID=bhavin1) ) ) USA2= (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=node2-vip.hingu.net)(PORT=1530)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=usa.hingu.net) (SID=bhavin2) ) ) USA3= (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=node3-vip.hingu.net)(PORT=1530)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=usa.hingu.net) (SID=bhavin3) ) )

Copythetnsnames.oraonalltheinstancesunder$ORACLE_HOME/network/admintokeepthesametnsnames.oraonalltheinstances.

Prepare Standby Site for Dataguard Configuration:


CopytheRMANbackupandpfile_for_standby.txt. Copythepasswordfile. CreaterequireddirectoriesforStandbyInstance. Modifythepfile. Copythetnsnames.orafromPrimaryandaddtheTNSAliasforthestandbydatabaseinstances. CreatetheASMdirectoriesundertheDATAandFRAdiskgroup. CopytheRMANBackupfilesandinit.orafromPrimarytoStandby: Copythebackupsfromprimarynode1todr-node1underthesamelocationasprimarynode1(/home/oracle/backup).Alsocopythepfilethatwascreatedforstandbyon primarynode1tothedr-node1.
scp$ORACLE_HOME/dbs/pfile_for_standby.txtdr-node1:$ORACLE_HOME/dbs/pfile_for_standby.txt scpr/home/oracle/backupdr-node1:/home/oracle

CopythePasswordFilefromPrimarytoallthenodesinStandby. Copythefile$ORACLE_HOME/dbs/orapwbhavin1fromPrimarynode1toboththestandbynodesunderthedirectory$ORACLE_HOME/dbswiththenameoforapwbhavin1 andorapwbhavin2fordr-node1anddr-node2respectively.


scp$ORACLE_HOME/dbs/orapwbhavin1dr-node1:$ORACLE_HOME/dbs/orapwbhavin1 scp$ORACLE_HOME/dbs/orapwbhavin1dr-node2:$ORACLE_HOME/dbs/orapwbhavin2

CreaterequireddumpfiledirectoriesfortheStandbyInstances Ondr-node1:
mkdirp/u01/app/oracle/admin/india/adump mkdirp/u01/app/oracle/diag/rdbms/india/bhavin1 cd/u01/app/oracle/diag/rdbms/india/bhavin1 mkdirtracecdump

Ondr-node2:
mkdirp/u01/app/oracle/admin/india/adump mkdirp/u01/app/oracle/diag/rdbms/india/bhavin2 cd/u01/app/oracle/diag/rdbms/india/bhavin2 mkdirtracecdump

Modifypfile_for_standby.txtfile(under$ORACLE_HOME/dbs) TheonesinREDcoloraremodifiedforthestandbydatabase.Therestoftheparametersremainsameonboththeprimaryandstandby.
*.audit_file_dest='/u01/app/oracle/admin/india/adump' *.audit_trail='db' *.cluster_database=true *.compatible='11.2.0.0.0' *.control_files='+DATA/india/controlfile/control01.ctl','+FRA/india/controlfile/control02.ctl' *.db_block_size=8192 *.db_create_file_dest='+DATA' *.db_create_online_log_dest_1='+DATA' *.db_create_online_log_dest_2='+FRA' *.db_domain='hingu.net' *.db_file_name_convert='USA','INDIA' *.db_name='bhavin' *.db_recovery_file_dest='+FRA' *.db_recovery_file_dest_size=4039114752 *.db_unique_name='india' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP)(SERVICE=bhavinXDB)' *.fal_server='USA' bhavin1.instance_number=1 bhavin2.instance_number=2 bhavin1.local_listener='LISTENER_BHAVIN1' bhavin2.local_listener='LISTENER_BHAVIN2' *.log_archive_config='DG_CONFIG=(USA,INDIA)' *.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DESTVALID_FOR=(ALL_LOGFILES,ALL_ROLES)DB_UNIQUE_NAME=INDIA'

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page5of13

*.log_archive_dest_2='SERVICE=USAARCHVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)DB_UNIQUE_NAME=USA' *.log_archive_format='%t_%s_%r.arc' *.log_archive_max_processes=8 *.log_file_name_convert='USA','INDIA' *.memory_target=1484783616 *.open_cursors=300 *.processes=1024 *.remote_listener='dr-lab-scan.hingu.net:1525' *.remote_login_passwordfile='exclusive' *.service_names='INDIA','india.hingu.net' *.sessions=1131 *.standby_file_management='AUTO' bhavin2.thread=2 bhavin1.thread=1 bhavin1.undo_tablespace='UNDOTBS1' bhavin2.undo_tablespace='UNDOTBS2'

Copythetnsnames.orafilefromprimary(under$ORACLE_HOME/network/admin) Fromprimarynode1:
scp$ORACLE_HOME/network/admin/tnsnames.oradr-node1:$ORACLE_HOME/network/admin/tnsnames.ora scp$ORACLE_HOME/network/admin/tnsnames.oradr-node2:$ORACLE_HOME/network/admin/tnsnames.ora

Now,ModifytheLOCAL_LISTENERparametersinthetnsnames.oratoreflectthedrspecificviphostnames(OntheStandbyNodesonly).
LISTENER_BHAVIN1=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dr-node1-vip.hingu.net)(PORT=1530))) LISTENER_BHAVIN2=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dr-node2-vip.hingu.net)(PORT=1530)))

CreatetheASMdirectories ConnecttotheasmcmdasagridOperatingSystemuserandcreatethebelowdirectories.
ASMCMD>mkdirdata/INDIA ASMCMD>cddata/india ASMCMD>mkdirPARAMETERFILEDATAFILECONTROLFILETEMPFILEONLINELOG ASMCMD>mkdirfra/INDIA ASMCMD>cdfra/india ASMCMD>mkdirARCHIVELOGCONTROLFILEONLINELOGSTANDBYLOG

Create the Physical Standby Database:


StarttheInstanceinNOMOUNTusingthepfile_for_standby.txt. RestoretheStandbyDatabaseusingRMANDUPLICATEcommand. CreatetheOnlineRedologsandStandbyredologs. ModifytheTNSNAMES.ORAofStandbytoaddtheStandbyDatabasesTNSalias. ModifytheTNSNAMES.ORAofPrimarytoaddtheStandbyDatabasesTNSalias. StarttheManagedRecoveryProcess Createthespfileandstartthedatabaseonboththenodesusingspfile. RegistertheNewStandbydatabasetotheOCR. StarttheActiveDataguard. StarttheInstanceinNOMOUNTstate: Connecttothedr-node1asoracleuserandstarttheInstancebhavin1usingthe$ORACLE_HOME/dbs/pfile_for_standby.txtparameterfile.
exportORACLE_SID=bhavin1 exportORACLE_BASE=/u01/app/oracle exportORACLE_HOME=/u01/app/oracle/db11201 exportPATH=$PATH:$ORACLE_HOME/bin:. sqlplus/assysdba startupnomountpfile=$ORACLE_HOME/dbs/pfile_for_standby.txt

RestoretheRMANbackupusingDUPLICATEDATABASEoption: ConnecttotheTargetdatabase(USA)andauxiliaryinstance(INDIA)fromdr-node1hosttostarttheDUPLICATE.
rmantargetsys/oracle@usa1auxiliary/ DUPLICATETARGETDATABASEFORSTANDBYNOFILENAMECHECK;

Modifytnsnames.oraonStandby: Existingtnsnames.oradoesnotcontaintheTNSaliasofthestandbydatabase.ItonlycontainsTNSaliasesforthePrimarydatabasebecausethistnsnames.orawascopiedover fromprimary.AddthebelowTNSaliasforstandbydatabase/instancesintothetnsnames.orafileonboththestandbyhosts.

INDIA= (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dr-lab-scan.hingu.net)(PORT=1525)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=india.hingu.net) ) ) INDIA1= (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dr-node1-vip.hingu.net)(PORT=1530)) (CONNECT_DATA=

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page6of13

(SERVER=DEDICATED) (SERVICE_NAME=india.hingu.net) (SID=bhavin1) ) ) INDIA2= (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dr-node2-vip.hingu.net)(PORT=1530)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=india.hingu.net) (SID=bhavin2) ) )

INDIA= (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dr-lab-scan.hingu.net)(PORT=1525)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=india.hingu.net) ) ) INDIA1= (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dr-node1-vip.hingu.net)(PORT=1530)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=india.hingu.net) (SID=bhavin1) ) ) INDIA2= (DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=dr-node2-vip.hingu.net)(PORT=1530)) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=india.hingu.net) (SID=bhavin2) ) )

Modifytnsnames.oraonPrimary: AddthebelowTNSaliasforstandbydatabase/instancesintothetnsnames.orafileonalltheprimaryhosts.

ALTERDATABASERECOVERMANAGEDSTANDBYDATABASEDISCONNECTFROMSESSION;

StarttheManagedRecoveryProcess: StarttheManagedrecoveryprocessondr-node1andverifythatthelogtransportandlogapplicationishappening.Alertlogisaquickandeasywaytoseeifthingslog transport/Gapresolutionandlogapplicationisworkingasexpected.StartthetailfonalertlogsonboththestandbynodesbeforestartingtheMRP. PerformthelogswitchontheprimarydatabasesoinitiatethelogTransport.

altersystemswitchlogfile

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page7of13

select*fromv$archive_gap; selectprocess,client_process,sequence#,statusfromv$managed_standby; selectsequence#,first_time,next_time,appliedfromv$archived_log; selectarchived_thread#,archived_seq#,applied_thread#,applied_seq#fromv$archive_dest_status; selectthread#,max(sequence#)fromv$log_historygroupbythread#; selectthread#,max(sequence#)fromv$archived_logwhereAPPLIED='YES'groupbythread#;

SimilarinformationcanbeverifiedbyrunningbelowSQLsonstandbydatabase.

Createspfilefrompfile:

createspfile='+data/india/parameterfile/spfileINDIA.ora'frompfile='/u01/app/oracle/db11201/dbs/pfile_for_standby.txt';

Aftercreatingthespfile,createthebelowinit.orafilesunder$ORACLE_HOME/dbsonboththedrnodeswiththespfileentrysothattheinstancecanstartwiththenewlycreated spfile. Ondr-node1:


[oracle@dr-node1dbs]$catinitbhavin1.ora spfile='+data/india/parameterfile/spfileINDIA.ora'

[oracle@dr-node1dbs]$catinitbhavin2.ora spfile='+data/india/parameterfile/spfileINDIA.ora'

Ondr-node2:

AddStandbydatabaseandInstancestotheOCR: AddthestandbydatabaseanditsinstancestotheOCRsothatitismanagedbyCRS.
srvctladddatabase-dindia-nbhavin-o/u01/app/oracle/db11201-mhingu.net-p+data/india/parameterfile/spfileindia.ora-rphysical_standby-a DATA,FRA srvctladdinstance-dindia-ibhavin1-ndr-node1 srvctladdinstance-dindia-ibhavin2-ndr-node2 srvctlstartdatabase-dindia srvctlmodifydatabase-dindia-smount

Ifthestandbydatabaseshouldnotstartinopenmode,thenitcanbechangedbybelowcommand.Thevalidoptionsareopen(default),mountandnomount.
srvctlmodifydatabase-dindia-smount

srvctlconfigdatabase-dindia

Verifytheconfigurationofstandbydatabaseindia.

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page8of13

Start the Active Dataguard: InActiveDataguard,theMRPcanberunningwhilethePhysicalStandbydatabaseisopenedinREADONLYmode.So,starttheMRPafterthedatabaseisopenedinreadonlymode toactivatetheActiveDataguard.


srvctlstartdatabasedindiaoopen alterdatabaserecovermanagedstandbydatabasedisconnectfromsession;

OnPrimary: altersystemsetLOG_ARCHIVE_DEST_2='SERVICE=INDIASYNCNOAFFIRMVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)DB_UNIQUE_NAME=INDIA'scope=bothsid='*'; alterdatabasesetstandbydatabasetomaximizeavailability; OnStandby: altersystemsetLOG_ARCHIVE_DEST_2='SERVICE=USASYNCNOAFFIRMVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)DB_UNIQUE_NAME=USA'scope=bothsid='*'; alterdatabasesetstandbydatabasetomaximizeavailability;

CreatetheStandbyRedoLogs(SRLs)onStandby: DUPLICATEDATABASEcommandhasreplicatedthesameno.ofOnlineRedoLogsandStandbyRedologsfromprimarydatabasetotheStandbydatabase.So,theywerenotneeded tocreatehere. ChangetheProtectionMode: NewProtectionMode:MaximumAvailability.

FinalConfigurationFiles: Hereisthefinallookofparameterfile,tnsnames.oraandlistener.orafilesatthisstageofsuccessfulconfigurationof3-nodeRACprimaryto2-nodeRACPhysicalDataGuard.

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page9of13

Configure Dataguard Broker: StoptheMRP ModifytheListener.orafiles ModifytheinitParameters CreateConfiguration EnableConfiguration VerifytheConfiguration StoptheMRPonstandbydatabase:
alterdatabaserecovermanagedstandbydatabasecancel;

PrimaryNode1 SID_LIST_BHAVIN_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=bhavin1)(GLOBAL_DBNAME=usa_DGMGRL.hingu.net)(ORACLE_HOME=/u01/app/oracle/db11201))) PrimaryNode2 SID_LIST_BHAVIN_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=bhavin2)(GLOBAL_DBNAME=usa_DGMGRL.hingu.net)(ORACLE_HOME=/u01/app/oracle/db11201))) PrimaryNode3 SID_LIST_BHAVIN_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=bhavin3)(GLOBAL_DBNAME=usa_DGMGRL.hingu.net)(ORACLE_HOME=/u01/app/oracle/db11201))) StandbyNode1 SID_LIST_BHAVIN_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=bhavin1)(GLOBAL_DBNAME=india_DGMGRL.hingu.net)(ORACLE_HOME=/u01/app/oracle/db11201))) StandbyNode2 SID_LIST_BHAVIN_LISTENER=(SID_LIST=(SID_DESC=(SID_NAME=bhavin2)(GLOBAL_DBNAME=india_DGMGRL.hingu.net)(ORACLE_HOME=/u01/app/oracle/db11201)))

Modifythelistener.orafiles: Updatethelistener.oraonallthenodesinDataguardconfigurationtoregisteraservicewiththelocallistenerforeachinstancefortheproperfunctioningofDGMGRL.Addthe belowlinestothelistener.orafileforeachofthespecifiedinstances.

Afterupdatingtheselistener.orafiles,restartlistenersoneachofthesenodes. Modifytheinitparameters: ModifythesebelowDataGuardBrokerrelatedparametersonboththesides.


Standby: mkdir+fra/india/DATAGUARDCONFIG mkdir+data/india/DATAGUARDCONFIG ALTERSYSTEMSETDG_BROKER_CONFIG_FILE1='+fra/india/DATAGUARDCONFIG/dgb_config02.ora'SCOPE=BOTHsid='*'; ALTERSYSTEMSETDG_BROKER_CONFIG_FILE2='+data/india/DATAGUARDCONFIG/dgb_config01.ora'SCOPE=BOTHsid='*'; altersystemsetdg_broker_start=truescope=bothsid='*'; primary: mkdir+fra/usa/DATAGUARDCONFIG mkdir+data/usa/DATAGUARDCONFIG ALTERSYSTEMSETDG_BROKER_CONFIG_FILE1='+fra/usa/DATAGUARDCONFIG/dgb_config02.ora'SCOPE=BOTHsid='*'; ALTERSYSTEMSETDG_BROKER_CONFIG_FILE2='+data/usa/DATAGUARDCONFIG/dgb_config01.ora'SCOPE=BOTHsid='*'; altersystemsetdg_broker_start=truescope=bothsid='*';

CreateConfiguration: ConnecttotheDGMGRLandrunthebelowstatementstocreateandenabletheDataGuardconfiguration.VerifythattheDGBrokerisconfiguredcorrectlyandithasallthe databasesandinstancesregisteredasexpected.


CREATECONFIGURATION'DG_Config'ASPRIMARYDATABASEIS'usa'CONNECTIDENTIFIERIS'usa'; ADDDATABASE'india'ASCONNECTIDENTIFIERISindia;

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page10of13

EnableConfiguration:
enableconfiguration;

VerifyConfiguration:
showconfiguration; showdatabaseverboseindia; showdatabaseverboseusa showinstanceverbosebhavin1ondatabaseusa showinstanceverbosebhavin2ondatabaseusa showinstanceverbosebhavin3ondatabaseusa showinstanceverbosebhavin1ondatabaseindia showinstanceverbosebhavin2ondatabaseindia

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page11of13

Performing Switchover/Failover with Dataguard Broker


IreceivedthebelowerrorwhileperformingeitherswitchoverorfailoveroperationusingDataGuardBroker.ThisisduetotheOraclebug(9645789)occurringwhenDGBroker tryingtostopanycustomservicesinthedatabase.TheworkaroundistoremoveallthecustomservicesusingsrvctlcommandandaddthembackintheOCRattheendoftherole transitionoperation.
DGMGRL>switchovertoindia PerformingswitchoverNOW,pleasewait... Error:ORA-16535:OracleRestartorOracleClusterwarepreventedcompletionofbrokeroperation Failed. Unabletoswitchover,primarydatabaseisstill"usa" srvctlstopservicedusasoltp srvctlremoveservicedusasoltp showparameterservice_names(SQLPLUS)

Switchover: ShutdownalltheinstanceonPrimarybutone. ShutdownalltheinstanceonStandbybutone. Connecttodgmgrlonprimary. Execute switchovertoindiaondgmgrl.

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page12of13

srvctlmodifydatabasedusarphysical_standbysmount srvctlmodifydatabasedindiarprimarysopen srvctladdservice-dindia-soltp-rbhavin1,bhavin2-rprimary-esession-mbasic-BSHORT(onthenewPrimarycluster) srvctladdservice-dusa-soltp-rbhavin1,bhavin2,bhavin3-rphysical_standby-esession-mbasic-BSHORT(onthenewstandbycluster)

AfterthesuccessfulSwitchoveroperation,starttheremaininginstancesonboththedatabases.ModifythedatabaseconfigurationinOCRwiththeirappropriateroleandstart option.AddanycustomservicestothenewPrimary(india)databasethatwereremovedearlier.

FortheFailover,useDGMGRLcommandfailovertousa

<<HOME>>

Comments
Name Enteryourcommenthere

Comment

(Sept5,2012)Sami Maliksaid: Perfectworkdone.Keepupthegreatwork.

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013

11gR2RACtoRACDataguardwithDataguardBrokerMAA

Page13of13

(Aug30,2012)Linhtt@atnavn.comsaid: Thankyousomuch!

(Aug8,2012)Evgenysaid: Thanksalot!

(Aug2,2012)Ruan Keysersaid: Veryinterestingarticle.Iambusycreating1physicalstbyona3RACinstance. IfweareconfiguringitforONLYlogshipping,canwestopatthe"Startrecoveryprocess"step? Regards

(July14,2012)Bhavin (mod)said: @Ramandall:ThanksGuys...

(July14,2012)Bhavin (mod)said: @Shravan:HeyShravan,Idoremmeber.Howareyoudoing.letskeepintouchinLinkedin. Bhavin

(July11,2012)Shravansaid: HiBhavin, Thisisshravan..urjuniorinMS..hopeurememberme:-)greatworkhereandagreatsiteindeed~

(Apr27,2012)Sansaid: Excellent...ButcanyouexplainthePreRequisiteofIPaddressinlittlemoredetail...likePrivateIP,VIP,PublicIP,SCANetcetc. IwouldliketotryitonRHEL5.5HowmanyNICcardsshoulmymymachinehave...Thanksinadvance.

(Mar26,2012)Manusaid: Verydetailedandcomprehensive.ThankYouBhavin.

(Mar15,2012)Fernandosaid: WhydoyoubackupthedatabasewithRMANifyouafterwordsmakeaduplicateofthedatabase?

(Showing1to10)

http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html

3/18/2013