Professional Documents
Culture Documents
Document 1617946.1
CreatingaStandbyusingRMANDuplicate(RACorNonRAC)(DocID1617946.1)
InthisDocument
Goal
Solution
References
APPLIESTO:
OracleDatabaseEnterpriseEditionVersion11.2.0.0to12.1.0.2[Release11.2to12.1]
Informationinthisdocumentappliestoanyplatform.
GOAL
MaximumAvailabilityArchitecture
TheMaximumAvailabilityArchitecture(MAA)definesOraclesmostcomprehensivearchitectureforreducingdowntimefor
scheduledoutagesaswellaspreventing,detectingandrecoveringfromunscheduledoutages.RealApplicationClusters
(RAC)andOracleDataGuardareintegralcomponentsoftheDatabaseMAAreferencearchitecturesandsolutions.
Moredetailedinformation,suchasadiscussionofthepurposeofMAAandthebenefitsitprovides,canbefoundonthe
OracleTechnologyNetwork(OTN)athttp://www.oracle.com/technetwork/database/features/availability/maa096107.html
PurposeofthisDocument
Thepurposeofthisdocumentistoprovideastepbystepguideforcreatingastandbydatabaseinan11.2or12c
environmentintegratingtheMAADataGuardconfigurationbestpractices.Thispaperassumesthatthefollowing
conditionsexist:
1.APrimaryRACorsingleinstancedatabaseutilizingASMfordatafilestorage
2.ThePrimarydatabaseisinarchivelogmode
3.AllStandbytargethostshaveexistingOraclesoftwareinstallation
4.TheStandbytargetdatabasestoragewillutilizeASM
ItisrecommendedthatyouconsulttheDataGuardConceptsandAdministrationguideaswellastheHABest
PracticeguideformoreinformationandfullMAABestPractices.
SupportedVersions
ThisdocumentappliestobothOracleServerversions11.2.0.xand12.1.0.xorhigher.Therearesomeimportant
differencesinhowtheDUPLICATEFORSTANDBYFROMACTIVEDATABASEfunctionsbetweenthetworeleaseswhichare
notedbelow:
11.2:
DUPLICATEFROMACTIVEDATABASEusesdatafileimagecopiesanddoesnotsupportsectionsize,compression,or
encryption.
12c:
DUPLICATEFROMACTIVEDATABASEsupportsbackupsets.
SECTIONSIZEsupportisavailable.Ifsectionsizeisused,thenusemultipleauxiliarychannelsforparallelism.
Compressionissupportedbutdonotusecompressiononbackupsordatathathasalreadybeencompressed(e.g.
usingOLTP,HCCcompression)orencryptedsincethecompressionbenefitsisverysmallandtheoverallimpact
(e.g.CPUresourcesandincreasedinelapsedtime)canbesignificant.
Encryptionissupported.
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
1/11
8/30/2016
Document 1617946.1
Alloftheexamplesillustratedinthisdocumentusethefollowingnaming:
Primary
Standby
Hosts
exa503,exa504
exa505,exa506
DatabaseUniqueName
chicago
boston
Instancenames
chicago1,chicago2
boston1,boston2
SOLUTION
Prerequisite:
ToexpediteactivedatabaseRMANduplicatecommands,usemultipleRMANchannelstospreadacrossprimarynodes.By
doingthiswecanutilizemorenetworkinterfacesforthedatatransfer.
Parallelizebackupsacrossallprimarydatabasenodesleveragingdiskandnetworkbandwidthasavailable.
MAAbestpracticerecommendusing8channelsminimumor2channelspernode.
UseautomaticloadbalancingtodistributeRMANchannelsamongtheallocatednodes.Withautoloadbalancingthe
channeldistributionisapproximatepointintime.Analyzetheimpactonexistingproductiondatabasesandreducethe
RMANparallelismifnecessary.
MakethefollowingRMANconfigurationchangesatthePrimary.Ourexampleuses16preconfiguredchannelsforRMANto
useduringthestandbycreationstep.These16channelswillsufficefor24nodeRACclustersbutwillneedtobe
increasedifyourProductionRACclusterislargerthan4nodes.
RMAN>CONFIGUREDEFAULTDEVICETYPETODISK
RMAN>CONFIGUREDEVICETYPEDISKPARALLELISM16
YouwilluseOracleNetserviceloadbalancingtodistributetheseRMANchannelsevenlyamongtheallocatedinstances.
1)CreateaservicetorunRMANonallocatedinstancesinthecluster:
srvctladdservicedbchicagoservicesrv_rmanpreferredchicago1,chicago2
srvctlstartservicedbchicagoservicesrv_rman
Note:IfyouneedtorestricttheRMANprocesstospecificinstancesonlyspecifythoseinstancesintheservice
definition
2)WhenrunningRMAN,usetheservicenameintheconnectstringforthetargetparameter:
rmantargetsys/<password>@<prim_scan>/srv_rman
StepstoDuplicatethePrimaryDatabase
ThefollowingarethestepsusedtocreatetheDataGuardStandbydatabase:
1.Createstandbyredologsontheprimarydatabasethatarethesamesizeoftheonlineredologs.Thiswillensurethat
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
2/11
8/30/2016
Document 1617946.1
standbyredologfilesareautomaticallycreatedatthestandbyduringtheRMANduplicationprocessandthatstandbyredo
logfilesareavailableonthecurrentPrimaryafteraroletransitionoccursinthefutureandthePrimarybecomesastandby.
Oraclerecommendshavingthesamenumberofstandbyredologfilesasthereareonlineredologfilesplusoneadditional
standbyredologforeachthread.Ourprimarydatabasehas6onlineredologfiles,3perthread.Wethereforeneed4
StandbyRedoLogfilesperthread(Primary3plus1)foratotalof8StandbyRedoLogfiles.Forexample:
SQL>alterdatabaseaddstandbylogfilethread1
group7size500M,
group8size500M,
group9size500M,
group10size500M
SQL>alterdatabaseaddstandbylogfilethread2
group11size500M,
group12size500M,
group13size500M,
group14size500M
2.DatabaseforceloggingisrecommendedasanMAADataGuardbestpractice.Toenableforcelogging,usethe
followingcommandontheprimary:
SQL>alterdatabaseforcelogging
3.FortheRMANduplicationprocessitisnecessarytosetupatemporarylistenerwhichwilllaterberemoved.
Inthestandbydatabasehome,createandstartalistenerthatoffersastaticSIDentryforthestandbydatabasewiththe
ORACLE_SIDforthestandby(boston1)andORACLE_HOMEforthestandby.
LISTENER_duplicate=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)
(HOST=exa505)
(PORT=1525)(IP=FIRST))))
SID_LIST_LISTENER_duplicate=
(SID_LIST=
(SID_DESC=
(SID_NAME=boston1)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)))
4.Inthedatabasehomeontheprimarynode,createanOracleNetaliastoconnecttothelistenercreatedintheabove
step.
dup=
(DESC
RIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=exa505)
(PORT=1525))
(CONNECT_DATA
=
(SERVER=DEDIC
ATED)
(SID=boston1)))
5.Foractivedatabaseduplication,youmustcreateapasswordfilefortheauxiliaryinstanceandestablishOracleNet
connectivity.Thisisatemporarypasswordfileasitwillbeoverwrittenduringtheduplicateoperation.
Createapasswordfileonthestandbyhostinthe$ORACLE_HOME/dbsdirectorywiththesameSYS(orSYSDGifyouuse
thatusernamein12c)asthePrimarydatabase.Forexample:
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
3/11
8/30/2016
Document 1617946.1
orapwdfile=orapwboston1password=<primarydatabasesyspassword>
6.OnthestandbyhostintheORACLE_HOME/dbsdirectorycreateapfile(initboston1.ora)withthefollowingparameters.
Itisrecommendedtosetthesga_targetsameasthatoftheprimarydatabase.Forexample:
db_name=chicago
db_unique_name=
boston
sga_target=5g
7.Onallstandbyhostscreatetheauditdirectoryforthebostondatabase:
mkdirp/u01/app/oracle/admin/boston/adump
8.OnallprimaryhostscreateanOracleNetaliastoreachthebostondatabaseonthestandbynodes.Makesurethatall
hostshavebothachicagoandbostonOracleNetaliasandthatallthealiasesreferencethescanlistenerandnotthenode
vip.Also,iflocal_listenerissettoanaliasontheprimarycreateacorrespondingentryonthestandbysidethatpointsto
thelocallisteneronthatsystem.Forexample:
Inalltnsnames.orafilesontheprimarynodes
Inalltnsnames.orafilesonthestandbynodes
chicago=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=prmyscan)
(PORT=1521))
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=chicago)
)
)
chicago=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=prmyscan)
(PORT=1521))
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=chicago)
)
)
boston=
boston=
(DESCRIPTION=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=stbyscan)(PORT (ADDRESS=(PROTOCOL=TCP)(HOST=stbyscan)(PORT
=1521))
=1521))
)
)
(CONNECT_DATA=
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVER=DEDICATED)
(SERVICE_NAME=boston)
(SERVICE_NAME=boston)
)
)
)
)
chicago_local_listener=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=prmyvip)(PORT
=1521))
)
)
boston_local_listener=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=stbyvip)(PORT
=1521))
)
)
9.OnthestandbyhostsettheSIDtothestandbySID(boston1)andstartupnomountthestandby/auxiliaryinstance.
$exportORACLE_SID=boston1
SQL>startupnomountpfile=
'initboston1.ora'
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
4/11
8/30/2016
Document 1617946.1
10.Ifthecluster_interconnectsparameterissetontheprimaryitwillbenecessarytotemporarilyunsetitintheSPFILE
only.ItwillbereturnedtotheoriginalvaluesinStep13.
Note:DoNOTrestartanyprimaryinstance.Theresetisdonetotemporarilyremovethecluster_interconnects
parameterfromthespfilesothatwhentheSPFILEiscopiedtothestandbysystemitwillavoidanyissuesifthe
standbydatabaseusesthesameinstancenamesastheprimarydatabase.
Thevaluesofcluster_interconnectsforeachinstanceshouldbenotedbeforeresettingtheSPFILEastheywillbereplaced
afterstandbyhasbeencreated.Forexample,executethefollowingcommandsandnotedownthevaluesforeachinstance
inthePrimarycluster.
SQL>selectp.inst_id,instance_name,name,valuefromgv$parameterp,gv$instanceiwhere
p.inst_id=i.inst_idandp.name='cluster_interconnects'
INST_IDINSTANCE_NAMENAMEVALUE
1chicago1cluster_interconnects192.168.10.149
2chicago2cluster_interconnects192.168.10.150
Nowresetthecluster_interconnectsparametertemporarilyintheSPFILEonly:
SQL>altersystemresetcluster_interconnectsscope=spfilesid='chicago1'
SQL>altersystemresetcluster_interconnectsscope=spfilesid='chicago2'
11.OntheprimaryhostrunanRMANscriptthatduplicatestheprimarydatabaseusingtheduplicatetargetdatabasefor
standbyfromactivedatabasecommand.Notethatthecontentsoftheduplicatecommandwillvarydependingonyour
environment.Thefollowingexamplecoversthemajorityofusecases.Foranycasenotcoveredbytheexamplesplease
consultchapter24oftheOracleDatabaseBackupandRecoveryUser'sGuideforcompleteinformation.
ThefirstexampleillustrateshowtoduplicatebetweentwosystemswheretheASMdiskgroupnamesarethesame:
rman<<EOF
connecttargetsys/<password>@<prim_scan>/srv_rman
connectauxiliarysys/<password>@dup
run{
duplicatetargetdatabaseforstandbyfromactivedatabase
spfile
parameter_value_convert'chicago','boston'
setdb_unique_name='boston'
SETCLUSTER_DATABASE='FALSE'
setcontrol_files='+DATA/boston/standby.ctl'
setlocal_listener=boston_local_listener
setremote_listener=stbyscan:1521
setaudit_file_dest='/u01/app/oracle/admin/boston/adump'
}
EOF
Thefollowingexampleillustrateshowtoduplicatebetweentwosystemswherethesourceisonafilesystemandthe
targetisusinganASMdiskgroup.ThesameprocesswillworkwherebothdatabasesuseASMbuttheyhavedifferentDisk
Groupnames.
InourexampleweusethefilesystemnamesforthePrimarybutifthiswasASMtoASMwithdifferentdiskgroupnames
youwouldsubstitutethePrimaryDiskgroupname.
rman<<EOF
connecttargetsys/<password>@<prim_scan>/srv_rman
connectauxiliarysys/<password>@dup
run{
duplicatetargetdatabaseforstandbyfromactivedatabase
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
5/11
8/30/2016
Document 1617946.1
spfile
parame
ter_value_convert'chicago','boston'
setdb_file_name_convert'/u01/data/','+DAT
A'
setdb_unique_name='boston'
SETCLUSTER_DATABASE='FALSE'
setdb_create_online_log_des
t_1='+DATA'
setdb_create_file_dest='+DATA'
setdb_recovery_file_dest='+RECO'
setlog_file_name_convert'/u01/da
ta/','+DATA','/u01/reco/','+RECO'
setcontrol_files='+DATA/boston/standby.ctl'
setlocal_listener=boston_local_listener
setremote_listener=stbyscan:1521
setaudit_file_dest='/u01/app/oracle/admin/boston/adump'
}
E
OF
12.ResetCLUSTER_INTERCONNECTStooriginalvaluefromStep11intheSPFILEwiththefollowingcommands.DoNOT
restartanyprimaryinstance.
SQL>altersystemsetcluster_interconnects='192.168.10.149'scope=spfilesid='chicago1'
SQL>altersystemsetcluster_interconnects='192.168.10.150'scope=spfilesid='chicago2'
13.Stopandremovethelistenercreatedinstep3.AlsoremovetheTNSentrycreatedinStep4.
14.Copythepasswordfiletotherespectivelocation.
Ifthestandbyisversion11.2thennoactionisrequired.
IfthestandbydatabaseisatVersion12.1orhighercopythepasswordfiletoASM.ForExample:
$asmcmdp
ASMCMD[+]>cd+DATA
AMSCMD[+DATA]>mkdirBOSTON/PASSWORD
ASMCMD[+DATA]>pwcopy/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/orapwboston1
+DATA/BOSTON/PASSWORD/pwboston
ASMCMD[+DATA]>exit
Removetheoriginalpasswordfile.
$rm/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/orapwboston1
15.CreatethestandbyspfileinASM.
Createaspfilein+DATAforthestandbydatabase:
SQL>createpfile='/tmp/p.ora'fromspfile
SQL>createspfile='+DATA/boston/spfileboston.ora'frompfile='/tmp/p.ora'
$rm/u01/app/oracle/product/12.1.0.2/dbhome_1/dbs/spfileboston1.ora
16.Onstandbyhostcreateaninitboston1.orafilethatpointstothespfilecreatedintheabovestep.
$catinitboston1.ora
spfile='+DATA/boston
/spfileboston
17.Restartthestandbyinstance.
SQL>shutdownimmediate
SQL>startupmount
18.Ifthestandbydatabaseissingleinstance(SI),thenonlyexecutethefollowingsteps.IfstandbyisaRACconfiguration
thisstepwillbeexecutedlateraspartofRACconfiguration.
Ifthestandbydatabaseisversion12.1thenaddthestandbyroleandpasswordfiletoASM.
11.2:
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
6/11
8/30/2016
Document 1617946.1
srvctladddatabasedbostono/u01/app/oracle/product/11.2.0/db_1xexa505iboston1
srvctlmodifydatabasedbostonrphysical_standbyp'+DATA/boston/spfileboston.ora'
12.1:
srvctladddatabasedbbostonoraclehome/u01/app/oracle/product/12.1.0.2/dbhome_1nodeexa505
instanceboston1
srvctlmodifydatabasedbbostonrolephysical_standbyspfile'+DATA/boston/spfileboston.ora'
pwfile'+DATA/BOSTON/PASSWORD/pwboston'
NOTE:Ifyourstandbydatabaseissingleinstance,thestandbydatabaseconfigurationiscompleteandyoushould
proceedtothesection:CreatingaDataGuardBrokerconfiguration.
IfyourstandbydatabaseisaRACconfigurationproceedtosection:CompleteStandbyRACConfiguration.
CompleteStandbyRACConfiguration
Aftercompletingthestepsintheabovesectionthestandbydatabasehasbeencreatedonthestandbyhost.Whenthe
primaryisRACconfigurationandyouwantthestandbytobeRACconfiguration,additionalconfigurationstepsneedtobe
completedonthestandby.Theseremainingconfigurationstepsarecoveredbelow.
1.Createatemporarypfilefromspfileonthestandby.
SQL>createpfile='/tmp/p.ora'fromspfile
2.ModifytheparametersontheStandbytoupdatetheinstancespecificRACparameters.Forexample:
Primary
Standby
*.cluster_database=TRUE
chicago2.instance_number=2
chicago1.instance_number=1
chicago2.thread=2
chicago1.thread=1
chicago2.undo_tablespace='UNDOTBS2'
chicago1.undo_tablespace='UNDOTBS1'
.
.
*.cluster_database=TRUE
boston2.instance_number=2
boston1.instance_number=1
boston2.thread=2
boston1.thread=1
boston2.undo_tablespace='UNDOTBS2'
boston1.undo_tablespace='UNDOTBS1'
.
.
3.Createaspfilein+DATAforthestandbydatabase:
SQL>createspfile='+DATA/boston/spfileboston.ora'frompfile='/tmp/p.ora'
4.Copythepasswordfiletotherespectivelocation.
Ifthestandbydatabaseisversion11.2,youmustcopythepasswordfiletothe$ORACLE_HOME/dbsdirectoryonallthe
otherstandbyhostsandnameitperthestandbySIDoneachhost.Forexampleonnode2youwouldnameit
$ORACLE_HOME/dbs/orapwboston2.
Ifthestandbydatabaseisversion12.1thennoactionisneeded.ThepasswordwascopiedtoASMinStep14,whichis
visibletoallnodesacrossthecluster.
5.Onallstandbyhostscreateaninitboston<SIDNumber>.orafilethatpointstothespfilecreatedintheabovestep.For
example:
$catinitboston1.ora
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
7/11
8/30/2016
Document 1617946.1
spfile='+DATA/boston/spfileboston.ora'
6.Restartallstandbyinstances.RegisterthedatabasewithCRS.
SQL>shutdownimmediate
11.2
srvc
tladddatabasedbostono/u01/app/oracle/product/11.2.0/db_1
srvctladdinstancedbostoniboston1nexa505
srvctladdinstancedbostoniboston2nexa506
srvctlmodifydatabasedbostonrphysical_stand
byp'+DATA/boston/spfileboston.ora'
12.1:
srvctl
adddatabasedbbostonoraclehome/u01/app/oracle/product/12.1.0.2/dbhome_1
srvctladdinstancedbbostoninstanceboston1nodeexa505
srvctladdinstancedbbostoninstanceboston2nodeexa506
srvctlmodifydatabasedbbostonrolephysical_standbyspf
ile'+DATA/boston/spfileboston.ora'
pwfile'+DATA/BOSTON/PASSWORD/pwboston'
Restartstandbydatabaseonallstandbyhosts:
srvctlstartdatabasedbostonomount
CreatingaDataGuardBrokerconfiguration:
ThefollowingsectiondescribesthebasicstepsonhowtocreateaDataGuardbrokerconfiguration.Forcomplete
informationontheDataGuardbrokerconsulttheOracleDataGuardBrokerguide.
1.OnboththeprimaryandstandbyconfiguretheDataGuardbrokermetadatafilesandenablethebroker:
Primary:
SQL>altersystemsetdg_broker_config_file1='+DATA/chicago/dr1.dat'scope=both
SQL>altersystemsetdg_broker_config_file2='+RECO/chicago/dr2.dat'scope=both
SQL>altersystemsetdg_broker_start=truescope=both
Standby
SQL>altersystemsetdg_broker_config_file1='+DATA/boston/dr1.dat'scope=both
SQL>altersystemsetdg_broker_config_file2='+RECO/boston/dr2.dat'scope=both
SQL>altersystemsetdg_broker_start=truescope=both
2.Addstaticsidentriesintothelocalnodelistener.oralocatedinthegridinfrastructurehomeonallhostsinthe
configuration.Pleasereferto<Note1387859.1>forinstructionsonhowtocompletethis):
Note:Static"_DGMGRL"entriesarenolongerneededasofOracleDatabase12.1.0.2inOracleDataGuardBroker
configurationsthataremanagedbyOracleRestart,RACOneNodeorRACastheBrokerwillusetheclusterwareto
restartaninstance.
Forexample:
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2))))
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3))))
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1))))
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=boston_DGMGRL)
(SID_NAME=boston1)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)))
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
8/11
8/30/2016
Document 1617946.1
NotethateachstaticentryreferencestheSIDforeachnode,boston1,boston2orchicago1,chicago2foranADMIN
managedRACcluster.IftheRACisaPolicyManagedRACpleaserefertothenoteaboveforspecificinstructionsonstatic
entriesin11gRelease2.
3.Bounceorreloadallthelistenerswheretheabovemodificationwasmade(primaryandstandbynodes):
srvctlstoplistener
srvctlstartlistene
r
4.Onaprimaryhostconnectwithdgmgrlandcreatetheconfiguration:
[oracle@exa503/etc]$dgmgrlsys/password
DGMGRL>createconfiguration'dg_config'asprimarydatabaseis'chicago'connectidentifieris
chicago
Configuration"dg_config"createdwithprimarydatabase"chicago"
DGMGRL>adddatabase'boston'asconnectidentifierisboston
Database"boston"added
DGMGRL>enableconfiguration
Enabled.
5.Verifythattheconfigurationcreatedsuccessfullybyusingtheshowconfigurationcommand:
DGMGRL>showconfiguration
Configurationdg_config
ProtectionMode:MaxPerformance
Databases:
chicagoPrimarydatabase
bostonPhysicalstandbydatabase
FastStartFailover:DISABLED
ConfigurationStatus:
SUCCESS
6.Flashbackdatabaseisrequiredtoreinstateafailedprimaryafterafailoverroletransition.Optionallyenableflashback
onboththeprimaryandstandby:
Primary:
SQL>alterdatabaseflashbackon
Toenableflashbackdatabaseonthestandbytheredoapplyprocessmustfirstbestopped.Onceflashbackhasbeen
enabledredoapplycanberestarted:
SQL>recovermanagedstandbydatabasecancel
SQL>alterdatabaseflashbackon
SQL>recovermanagedstandbydatabasedisconnectusingcurrentlogfile
Theabovestepscanalsobeaccomplishedusingthebrokerwiththefollowingcommands.(youmustbeconnectedtothe
standbydatabaseviaDGMGRL):
DGMGRL>CONNECTsys/<password>@boston
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
9/11
8/30/2016
Document 1617946.1
DGMGRL>EDITDATABASEbostonSETSTATE=APPLYOFF
DGMGRL>SQL"ALTERDATABASEFLASHBACKON"
DGMGRL>EDITDATABASEbostonSETSTATE=APPLYON
ApplicationServiceConsiderationswithDataGuard:
InanOracleDataGuardconfiguration,applicationsmustuseServicestoconnecttothedatabasesasthereismorethan
onedatabasewithdifferentSIDnamesthatcouldbethePrimarydatabase.AndwithOracleActiveDataGuard,any
physicalstandbydatabasecouldbemadeavailabletoprovidereadonlyaccesstothedata.Toenableclientconnections,
servicesneedtobecreatedfortheworkloadthatperformsupdateswhichwillonlybestartedonthedatabaseinthe
configurationthatiscurrentlyinthe'Primary'roleaswellasservicesforreadonlyreportsandqueriesthatshouldonlybe
presentonphysicalstandbysthatareopeninActiveDataGuard.
Note:RefertoMOSNote2123709.1forfullClientFailoverconfigurationMAABestPractices.
ThefollowingisanexampleofhowtoconfigureaRead/Writeservice(workload)andaRead/Onlyservice(reports)onthe
PrimaryandStandbydatabase.
Iftheprimary/standbyisconfiguredwithOracleRestart,RACOneNodeorRAC,theservicesarecreatedusingsrvctl.
(NoteforJDBCapplicationserversideTAFattributesshouldbesettoNONE).Ifyouarecreatingservicesforamultitenant
databasethenuseservicecommandsthatincludethepdboption.
Forexample,hereweaddshowaddingtwoservicestoeachdatabaseintheconfiguration.WORKLOADforRead/Write
connectionsandREPORTSforRead/Onlyconnections.WORKLOADwillonlyrunonthedatabasethatisrunninginthe
PrimaryroleandREPORTSwillonlyrunonthedatabasethatisinthePHYSICALSTANDBYrole.
Primarycluster:
srvctladdservicedchicagosworkloadrchicago1,chicago2lPRIMARYqTRUEeSESSIONm
BASICw10z150
srvctladdservice
dchicagosreportsrchicago1,chicago2lPHYSICAL_STANDBYqTRUEe
SESSIONmBASICw10z150
srvctlstartservicedchica
gosreports
srvctlstopservicedchicagosreports
Note:WeneedtostartandstoptheREPORTSservicesonthePrimarytocreatetheserviceinthedatabasesothatit
canbestartedontheStandby.IfwedonotfirststartitonthePrimarydatabasetheservicewillnotbeinthe
database.Servicesmetadataandastartofthatserviceonthestandbywillfailbecauseitneedstocreatetheservice,
whichitcannotdoinareadonlydatabase.
StandbyCluster:
srvctladdservicedbostonsworkloadrboston1,boston2lPRIMARYqTRUEeSESSIONmBASIC
w10z150
srvctladds
ervicedbostonsreportsrboston1,boston2lPHYSICAL_STANDBYqTRUEeSESSION
mBASICw10z150
srvctlstartservice
dchicagosreports
2.CreateOracleNetaliasesthatreferencetheaboveservicesfortheclientapplicationstouse.
WORKLOAD=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=prmyscan)(PORT=1521)))
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
10/11
8/30/2016
Document 1617946.1
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=workload)
REPORTS=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=stbyscan)(PORT=1521)))
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=reports)
)
)
Didn'tfindwhatyouarelookingfor?
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=18kvo1vh87_320&id=1617946.1
11/11