data guard configuration with dg broker on oracle 11g

22
Data Guard Configuration with DG Broker This document presents step by step procedure in setting up Data Guard  with Physical Standby using RMAN duplicate command. The set-up was done on Oracle 11g. The document is divided into below sections: ! "n# iro n$e nt Detai ls %! Data Guard Con figu ratio n Steps &! DG B roker Confi gurat ion '! (roubl esh oot ing )! "rrors "ncountered ! "n#iron$ent Details* SN Role  Mount + ,RAC-"./,M"  Mount + Data 0 Control files 0 Redo logs fast.reco#ery.area 1 Primary u01 /u12/primdb01/ /u12/primdb01/ast recovery area 2 Physical "tandby u0# /u#0/stdbydb01 /u#0/stdbydb01/ast!recovery area SN Description Pri$ary Database Physical Standby Database 1 $atabase %ame primdb01 primdb01 2 $&!'%()'* %+,* primdb01 stdbydb01 T%"%+,*".O+ prim01 stdby01 ocation - bacground!dump!d est: primdb01 - /u01/app/oracle/d iag/rdbms/primdb 01/primdb01/trace stdbydb01 - /u0#/app/oracle/d iag/rdbms/stdbyd b01/stdbydb01/tra ce Page  o %%

Upload: satyanrn3

Post on 12-Feb-2018

244 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 1/22

Data Guard Configuration with DG Broker

This document presents step by step procedure in setting up Data Guard  with

Physical Standby using RMAN duplicate command. The set-up was done on Oracle 11g.

The document is divided into below sections:

! "n#iron$ent Details%! Data Guard Configuration Steps&! DG Broker Configuration'! (roubleshooting)! "rrors "ncountered 

! "n#iron$ent Details*

SN Role Mount +

,RAC-"./,M"

 Mount + Data 0Control files 0

Redo logsfast.reco#ery.area

1 Primary u01 /u12/primdb01/ /u12/primdb01/ast!recovery!area

2Physical"tandby

u0# /u#0/stdbydb01 /u#0/stdbydb01/ast!recovery!area

SN Description Pri$ary Database Physical Standby Database

1 $atabase %ame primdb01 primdb01

2 $&!'%()'*!%+,* primdb01 stdbydb01

T%"%+,*".O+ prim01 stdby01

ocation - bacground!dump!dest:primdb01 - /u01/app/oracle/diag/rdbms/primdb01/primdb01/tracestdbydb01 - /u0#/app/oracle/diag/rdbms/stdbydb01/stdbydb01/trace

Page  o %%

Page 2: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 2/22

%! Data Guard Configuration Steps*

1. reated database using 1-aunch  dbca command 3use !2dbca rom 1-aunch toinitiate the wi4ard5. Gloabal Na$e  S3D given was pri$db4

 Note* "et any available database irst and launch dbca rom 5,RAC-"./,M"2bin directory.

2. On pri$ary host once database is created modiy

5,RAC-"./,M"2network2ad$in2listener!ora as mentioned below or primary databaseconnectivity:

6oracleuser7ser#erna$e ad$in85 cat listener!ora9 listener!ora Network Configuration :ile*2u42app2oracle2product2!%!42dbho$e.2network2ad$in2listener!ora9 Generated by ,racle configuration tools!

 ADR.BAS".-3S("N"R.)% ; 2u42app2oracle

-3S("N"R.)% ;  <D"SCR3P(3,N.-3S( ;

  <D"SCR3P(3,N ;  <ADDR"SS ; <PR,(,C,- ; (CP=</,S( ; punitpecs4)!ad!contoso!co$=<P,R( ;)%==  <ADDR"SS ; <PR,(,C,- ; 3PC=<>"? ; "1(PR,C)%==  =  =

S3D.-3S(.-3S("N"R.)% ;<S3D.-3S( ;  <S3D.D"SC ;  <G-,BA-.DBNAM" ; pri$db4=  <,RAC-"./,M" ; 2u42app2oracle2product2!%!42dbho$e.=

  <S3D.NAM" ; pri$db4=  ==

. On pri$ary host modiy 5,RAC-"./,M"2network2ad$in2tnsna$es!ora as mentionedbelow:

 pri$4 ;  <D"SCR3P(3,N ;  <ADDR"SS ; <PR,(,C,- ; (CP=</,S( ; @%!%!!&=<P,R( ; )%==  <C,NN"C(.DA(A ;  <S"R"R ; D"D3CA("D=  <S"R3C".NAM" ; pri$db4=  <S3D.NAM" ; pri$db4=  =  =

6. onirm that the ollowing path is set as archiving location:2u%2pri$db42fast.reco#ery.area

Page % o %%

Page 3: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 3/22

 erified abo#e with following co$$and*

")7 show para$eter reco#ery

To veriy the location o the datailes use below 8uery:")7 select file.na$e fro$ dba.data.files

#. Turn on orce logging using below command:")7 alter database force logging

9eriy i orce logging is enabled using below command:")7 select force.logging :R,M #5database

. ,odiy 5,RAC-"./,M"2network2ad$in2tnsna$es!ora on primary host as mentionedbelow or Physical Standby database connectivity:

stdby4 ;  <D"SCR3P(3,N ;  <ADDR"SS ; <PR,(,C,- ; (CP=</,S( ; 4!@E!!@'=<P,R( ; )%)==  <C,NN"C(.DA(A ;

<S"R"R ; D"D3CA("D=

<S"R3C".NAM" ; stdbydb4=  <S3D.NAM" ; stdbydb4=  =  =

;. ,odiy the parameter ile as below:

")7 alter syste$ set -,G.ARC/3".C,N:3G;FDG.C,N:3G;<pri$db4 stdbydb4=Fscope;spfile

")7 alter syste$ set -,G.ARC/3".D"S(.;F-,CA(3,N;HS".DB.R"C,"R?.:3-".D"S( A-3D.:,R;<A--.-,G:3-"SA--.R,-"S=F scope;spfile

")7 alter syste$ set -,G.ARC/3".D"S(.%;FS"R3C";stdby4 ARC/ AS?NC A-3D.:,R;<,N-3N".-,G:3-"SPR3MAR?.R,-"= DB.HN3IH".NAM";stdbydb4F scope;spfile

")7 alter syste$ set :A-.S"R"R; stdbydb4

")7 alter syste$ set :A-.C-3"N(; pri$db4

<. &ounce primary to bring parameters in eect:

")7 shutdown i$$ediate 

")7 startup $ount=

>. On secondary host modiied 5,RAC-"./,M"2network2ad$in2listener!ora asmentioned below or physical standby database connectivity:

6oracleuser%7punitpecs4' ad$in85 cat listener!ora9 listener!ora Network Configuration :ile*2u4)2app2oracle2product2!%!42dbho$e.)2network2ad$in2listener!ora9 Generated by ,racle configuration tools!

Page & o %%

Page 4: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 4/22

 ADR.BAS".-3S("N"R.)%) ; 2u4)2app2oracle

-3S("N"R.)%) ;  <D"SCR3P(3,N.-3S( ;  <D"SCR3P(3,N ;  <ADDR"SS ; <PR,(,C,- ; (CP=</,S( ; punitpecs4'!ad!contoso!co$=<P,R( ;)%)==  <ADDR"SS ; <PR,(,C,- ; 3PC=<>"? ; "1(PR,C)%)==  =

=

S3D.-3S(.-3S("N"R.)%) ;  <S3D.-3S( ;

<S3D.D"SC ;  <G-,BA-.DBNAM" ; stdbydb4=  <,RAC-"./,M" ; 2u4)2app2oracle2product2!%!42dbho$e.)=  <S3D.NAM" ; stdbydb4=  ==

10. On secondary host modiied 5,RAC-"./,M"2network2ad$in2tnsna$es!ora as

mentioned below or connectivity over networ:

 pri$4 ;<D"SCR3P(3,N ;

  <ADDR"SS ; <PR,(,C,- ; (CP=</,S( ; @%!%!!&=<P,R( ; )%==  <C,NN"C(.DA(A ;

<S"R"R ; D"D3CA("D=<S"R3C".NAM" ; pri$db4=

  <S3D.NAM" ; pri$db4=  =  =stdby4 ;

  <D"SCR3P(3,N ;  <ADDR"SS ; <PR,(,C,- ; (CP=</,S( ; 4!@E!!@'=<P,R( ; )%)==  <C,NN"C(.DA(A ;  <S"R"R ; D"D3CA("D=

<S"R3C".NAM" ; stdbydb4=  <S3D.NAM" ; stdbydb4=  =  =

11. an the ollowing 2 commands on the pri$ary host to set the re8uiredinitiali4ation parameters:

")7 alter syste$ set -,G.:3-".NAM".C,N"R(;F2u)42stdbydb42stdbydb42FF2u%2pri$db42 pri$db42F scope;spfile

")7 alter syste$ set DB.:3-".NAM".C,N"R(;F2u)42stdbydb42stdbydb42FF2u%2pri$db42pri$db42F scope;spfile

12. *?ecute the ollowing 8uery to see i your database was started with a P@(*or "P@(*:

Page ' o %%

Page 5: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 5/22

")7 S"-"C( D"C,D"<#alue NH-- FP:3-"F FSP:3-"F= J3nit :ile (ypeJ :R,Msys!#.5para$eter K/"R" na$e ; FspfileF

Aou can also use the 5SPPARAM"("R view to chec i you are using a P@(* or not:i the BvalueB column is %' or all parametersC you are using a P@(*.

1. &ounced the database on primary host and ran the ollowing command to createthe new pile:

")7 create pfile fro$ spfile

P:ile with the name initpri$db4!ora ile gets created in 5,RAC-"./,M"2dbs directory. The content o this ile created on primary host will loo lie below:

L!audit.file.dest;F2u42app2oracle2ad$in2pri$db42adu$pFL!audit.trail;FdbFL!co$patible;F!%!4!4!4FL!control.files;F2u%2pri$db42pri$db42control4!ctlFF2u%2pri$db42fast.reco#ery.area2pri$db42control4%!ctlFL!db.block.sie;%

L!db.do$ain;FFL!db.file.na$e.con#ert;F2u)42stdbydb42stdbydb42FF2u%2pri$db42pri$db42FL!db.na$e;Fpri$db4FL!db.reco#ery.file.dest;F2u%2pri$db42fast.reco#ery.areaFL!db.reco#ery.file.dest.sie;4@&@'%'L!diagnostic.dest;F2u42app2oracleFL!dispatchers;F<PR,(,C,-;(CP= <S"R3C";pri$db41DB=FL!fal.client;FPR3MDB4FL!fal.ser#er;FS(DB?DB4FL!log.archi#e.config;FDG.C,N:3G;<pri$db4 stdbydb4=FL!log.archi#e.dest.;F-,CA(3,N;HS".DB.R"C,"R?.:3-".D"S(

 A-3D.:,R;<A--.-,G:3-"SA--.R,-"S=F

L!log.archi#e.dest.%;FS"R3C";stdby4 N,A::3RM AS?NC A-3D.:,R;<,N-3N".-,G:3-"SPR3MAR?.R,-"= DB.HN3IH".NAM";stdbydb4FL!log.archi#e.dest.state.%;F"NAB-"FL!log.archi#e.for$at;Ft.s.r!dbfFL!log.file.na$e.con#ert;F2u)42stdbydb42stdbydb42FF2u%2pri$db42pri$db42FL!$e$ory.target;&E444L!open.cursors;&44L!processes;)4L!re$ote.login.passwordfile;F"1C-HS3"FL!standby.file.$anage$ent;FAH(,FL!undo.tablespace;FHND,(BSF

'sing scp copied the init$ydbpri$!ora  orapw$ydbpri$  ile rom pri$ary host tosecondary host in 2u4)

16. reated the ollowing directory manually on secondary host:

2u4)2app2oracle2ad$in2stdbydb42

2u4)2stdbydb42fast.reco#ery.area2stdbydb4

Page ) o %%

Page 6: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 6/22

2u4)2stdbydb42stdbydb4

1#. ,odiied init$ydbpri$!ora 3on secondary host5 as per below:

L!audit.file.dest;F2u4)2app2oracle2ad$in2stdbydb42adu$pFL!audit.trail;FdbFL!co$patible;F!%!4!4!4FL!control.files;F2u)42stdbydb42stdbydb42control4!ctlFF2u)42stdbydb42fast.reco#ery.area2stdbydb42control4%!ctlFL!db.block.sie;%L!db.do$ain;FFL!db.file.na$e.con#ert;F2u%2pri$db42pri$db42FF2u)42stdbydb42stdbydb42FL!db.na$e;Fpri$db4FL!db.reco#ery.file.dest;F2u)42stdbydb42fast.reco#ery.areaFL!db.reco#ery.file.dest.sie;4@&@'%'L!DB.HN3IH".NAM";Fstdbydb4FL!diagnostic.dest;F2u4)2app2oracleFL!dispatchers;F<PR,(,C,-;(CP= <S"R3C";stdbydb41DB=FL!fal.client;FS(DB?DB4FL!fal.ser#er;FPR3MDB4F

L!log.archi#e.config;FDG.C,N:3G;<pri$db4 stdbydb4=FL!log.archi#e.dest.;F-,CA(3,N;HS".DB.R"C,"R?.:3-".D"S(

 A-3D.:,R;<A--.-,G:3-"SA--.R,-"S=FL!log.archi#e.dest.%;FS"R3C"; pri$4 N,A::3RM AS?NC

 A-3D.:,R;<,N-3N".-,G:3-"SPR3MAR?.R,-"= DB.HN3IH".NAM"; pri$db4FL!log.archi#e.dest.state.%;F"NAB-"FL!log.archi#e.for$at;Ft.s.r!dbfFL!log.file.na$e.con#ert;F2u%2pri$db42pri$db42FF2u)42stdbydb42stdbydb42FL!$e$ory.target;&E444L!open.cursors;&44L!processes;)4L!re$ote.login.passwordfile;F"1C-HS3"F

L!standby.file.$anage$ent;FAH(,FL!undo.tablespace;FHND,(BSF

1. ,oved initpri$db4!ora orapwpri$db4 ile rom 2u4) to 25,RAC-"./,M"2dbs onsecondary host. 'sing $# command renamed initpri$db4!ora to initstdbydb4!oraand orapwpri$db4 to orapwstdbydb4.

1;. On secondary modiied the 2etc2oratab ile to include the ollowing:stdbydb4*2u4)2app2oracle2product2!%!42dbho$e.)*N

1<. "et the environment and connected to the idle instance stdbydb4 using

ollowing commands on secondary host:

! oraen#stdbydb4sOlplus 2 as sysdbastartup no$ount

1>. hec or connectivity rom primary host using below commands:

r$an target sys2 password 7 pri$4

Page E o %%

Page 7: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 7/22

r$an target sys2 password 7stdby4

'se below command to ind the location o the alert log ile and investigate theissue:

SI- show para$eter BAC>GR,HND.DHMP.D"S(

20. To mae sure the primary database is conigured or switchoverC we mustcreate the "tandby edo logs on the Primary server.

 A-("R DA(ABAS" ADD S(ANDB? -,G:3-" <F2u%2pri$db42pri$db42standby.redo4!logF=S3Q" )4M

 A-("R DA(ABAS" ADD S(ANDB? -,G:3-" <F2u%2pri$db42pri$db42standby.redo4%!logF=S3Q" )4M

 A-("R DA(ABAS" ADD S(ANDB? -,G:3-" <F2u%2pri$db42pri$db42standby.redo4&!logF=S3Q" )4M

 A-("R DA(ABAS" ADD S(ANDB? -,G:3-" <F2u%2pri$db42pri$db42standby.redo4'!logF=S3Q" )4M

21. "tart the au?illary instance on the standby server in no$ount mode bystarting it using the temporary Binit.oraB ile.

eport ,RAC-".S3D;stdbydb4sOlplus 2 as sysdbaSI- create spfile fro$ pfileSI- startup no$ount onnect to ,+%C speciying a ull connect string or both the (ARG"( and

 AH13--AR? instances. $O %OT attempt to use O" authentication:

6oracleuser7ser#erna$e dbs85 r$an (ARG"( sys2 password 7pri$4 AH13-3AR?sys2 password 7stdby4

Reco#ery Manager* Release !%!4!&!4 Production on Sat Mar E %4*'*4% %4&

Copyright <c= % %4 ,racle and2or its affiliates! All rights reser#ed!

connected to target database* PR3MDB4 <DB3D;'4@'@)=connected to auiliary database* PR3MDB4 <not $ounted=

22. %ow issue the ollowing $'P(+T* command which automatically creates thestandby dataile redo logs on the standby:

RMAN duplicate target database for standby fro$ acti#e database doreco#ernofilena$echeck

Starting Duplicate Db at EMAR&using target database control file instead of reco#ery catalogallocated channel* ,RA.AH1.D3S>.channel ,RA.AH1.D3S>.* S3D;4 de#ice type;D3S>

contents of Me$ory Script*T  backup as copy reuse  targetfile F2u42app2oracle2product2!%!42dbho$e.2dbs2orapwpri$db4Fauiliary for$at

Page @ o %%

Page 8: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 8/22

 F2u4)2app2oracle2product2!%!42dbho$e.)2dbs2orapwstdbydb4F Ueecuting Me$ory Script

Starting backup at EMAR&allocated channel* ,RA.D3S>.channel ,RA.D3S>.* S3D;&% de#ice type;D3S>:inished backup at EMAR&

contents of Me$ory Script*T  backup as copy current controlfile for standby auiliary for$atF2u)42stdbydb42stdbydb42control4!ctlF  restore clone controlfile toF2u)42stdbydb42fast.reco#ery.area2stdbydb42control4%!ctlF fro$  F2u)42stdbydb42stdbydb42control4!ctlFUeecuting Me$ory Script

Starting backup at EMAR&using channel ,RA.D3S>.

channel ,RA.D3S>.* starting datafile copycopying standby control fileoutput file na$e;2u42app2oracle2product2!%!42dbho$e.2dbs2snapcf.pri$db4!ftag;(AG%4&4&E(%4) R"C3D;% S(AMP;4%'@@)channel ,RA.D3S>.* datafile copy co$plete elapsed ti$e* 44*44*4@:inished backup at EMAR&

Starting restore at EMAR&using channel ,RA.AH1.D3S>.

channel ,RA.AH1.D3S>.* copied control file copy:inished restore at EMAR&

contents of Me$ory Script*T  sOl clone Falter database $ount standby databaseFUeecuting Me$ory Script

sOl state$ent* alter database $ount standby database

contents of Me$ory Script*T  set newna$e for te$pfile to J2u)42stdbydb42stdbydb42te$p4!dbfJ  switch clone te$pfile all  set newna$e for datafile to J2u)42stdbydb42stdbydb42syste$4!dbfJ  set newna$e for datafile % to J2u)42stdbydb42stdbydb42sysau4!dbfJ  set newna$e for datafile & to J2u)42stdbydb42stdbydb42undotbs4!dbfJ  set newna$e for datafile ' to J2u)42stdbydb42stdbydb42users4!dbfJ

Page  o %%

Page 9: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 9/22

  backup as copy reuse  datafile auiliary for$at J2u)42stdbydb42stdbydb42syste$4!dbfJ datafile % auiliary for$at J2u)42stdbydb42stdbydb42sysau4!dbfJ datafile & auiliary for$at J2u)42stdbydb42stdbydb42undotbs4!dbfJ datafile ' auiliary for$at J2u)42stdbydb42stdbydb42users4!dbfJ

  sOl Falter syste$ archi#e log currentFUeecuting Me$ory Script

eecuting co$$and* S"( N"KNAM"

rena$ed te$pfile to 2u)42stdbydb42stdbydb42te$p4!dbf in control file

eecuting co$$and* S"( N"KNAM"

eecuting co$$and* S"( N"KNAM"

eecuting co$$and* S"( N"KNAM"

eecuting co$$and* S"( N"KNAM"

Starting backup at EMAR&using channel ,RA.D3S>.channel ,RA.D3S>.* starting datafile copyinput datafile file nu$ber;4444 na$e;2u%2pri$db42pri$db42syste$4!dbfoutput file na$e;2u)42stdbydb42stdbydb42syste$4!dbf tag;(AG%4&4&E(%4)%Echannel ,RA.D3S>.* datafile copy co$plete elapsed ti$e* 44*4*4)channel ,RA.D3S>.* starting datafile copyinput datafile file nu$ber;4444% na$e;2u%2pri$db42pri$db42sysau4!dbf

output file na$e;2u)42stdbydb42stdbydb42sysau4!dbf tag;(AG%4&4&E(%4)%Echannel ,RA.D3S>.* datafile copy co$plete elapsed ti$e* 44*4*4)channel ,RA.D3S>.* starting datafile copyinput datafile file nu$ber;4444& na$e;2u%2pri$db42pri$db42undotbs4!dbfoutput file na$e;2u)42stdbydb42stdbydb42undotbs4!dbf tag;(AG%4&4&E(%4)%Echannel ,RA.D3S>.* datafile copy co$plete elapsed ti$e* 44*44*4@channel ,RA.D3S>.* starting datafile copyinput datafile file nu$ber;4444' na$e;2u%2pri$db42pri$db42users4!dbfoutput file na$e;2u)42stdbydb42stdbydb42users4!dbf tag;(AG%4&4&E(%4)%Echannel ,RA.D3S>.* datafile copy co$plete elapsed ti$e* 44*44*4:inished backup at EMAR&

sOl state$ent* alter syste$ archi#e log current

contents of Me$ory Script*T  backup as copy reuse  archi#elog likeJ2u%2pri$db42fast.reco#ery.area2PR3MDB42archi#elog2%4&.4&.E2o.$f..%4.n&n&ln.!arcJ auiliary for$at J2u)42stdbydb42fast.reco#ery.area2S(DB?DB42archi#elog2%4&.4&.E2o.$f..%4. u.!arcJ

Page  o %%

Page 10: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 10/22

  catalog clone reco#ery area  switch clone datafile allUeecuting Me$ory Script

Starting backup at EMAR&using channel ,RA.D3S>.channel ,RA.D3S>.* starting archi#ed log copyinput archi#ed log thread; seOuence;%4 R"C3D; S(AMP;4%'4%@

output filena$e;2u)42stdbydb42fast.reco#ery.area2S(DB?DB42archi#elog2%4&.4&.E2o.$f..%4

 .4bo'$pOs.!arc R"C3D;4 S(AMP;4channel ,RA.D3S>.* archi#ed log copy co$plete elapsed ti$e* 44*44*4:inished backup at EMAR&

searching for all files in the reco#ery area

-ist of :iles Hnknown to the Database;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:ile Na$e*2u)42stdbydb42fast.reco#ery.area2S(DB?DB42archi#elog2%4&.4&.E2o.$f..%4.4bo'

 $pOs.!arccataloging files!!!cataloging done

-ist of Cataloged :iles;;;;;;;;;;;;;;;;;;;;;;;:ile Na$e*2u)42stdbydb42fast.reco#ery.area2S(DB?DB42archi#elog2%4&.4&.E2o.$f..%4.4bo'

 $pOs.!arc

datafile switched to datafile copyinput datafile copy R"C3D;% S(AMP;4%'@) file

na$e;2u)42stdbydb42stdbydb42syste$4!dbfdatafile % switched to datafile copyinput datafile copy R"C3D;& S(AMP;4%'@) filena$e;2u)42stdbydb42stdbydb42sysau4!dbfdatafile & switched to datafile copyinput datafile copy R"C3D;' S(AMP;4%'@) filena$e;2u)42stdbydb42stdbydb42undotbs4!dbfdatafile ' switched to datafile copyinput datafile copy R"C3D;) S(AMP;4%'@) filena$e;2u)42stdbydb42stdbydb42users4!dbf

contents of Me$ory Script*T  set until scn '))&E'  reco#er  standby  clone database  delete archi#elog  Ueecuting Me$ory Script

Page 4 o %%

Page 11: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 11/22

eecuting co$$and* S"( until clause

Starting reco#er at EMAR&using channel ,RA.AH1.D3S>.

starting $edia reco#ery

archi#ed log for thread with seOuence %4 is already on disk as file2u)42stdbydb42fast.reco#ery.area2S(DB?DB42archi#elog2%4&.4&.E2o.$f..%4.4bo'

 $pOs.!arcarchi#ed log filena$e;2u)42stdbydb42fast.reco#ery.area2S(DB?DB42archi#elog2%4&.4&.E2o.$f..%4

 .4bo'$pOs.!arc thread; seOuence;%4 $edia reco#ery co$plete elapsed ti$e* 44*44*4:inished reco#er at EMAR&:inished Duplicate Db at EMAR&

2. hec the status o the standby database by maing sure it is in mount stage.onnect using sOlplus sys2 password 7stdby4 as sysdba

SI- select status instance.na$e database.role fro$ #5instance#5database

S(A(HS 3NS(ANC".NAM" DA(ABAS".R,-"

 M,HN("D stdbydb4 P/?S3CA- S(ANDB?

( you preerC you can set a delay or nodelay between the arrival o the archivedredo log and it being applied on the standby server using the ollowing commands.

SI- A-("R DA(ABAS" R"C,"R MANAG"D S(ANDB? DA(ABAS" CANC"-

+bove 8uery is used to stop ,P on Physical "tandby database.

SI- A-("R DA(ABAS" R"C,"R MANAG"D S(ANDB? DA(ABAS" D"-A? &4 D3SC,NN"C( :R,MS"SS3,NSI- A-("R DA(ABAS" R"C,"R MANAG"D S(ANDB? DA(ABAS" D3SC,NN"C( :R,M S"SS3,NSI- A-("R DA(ABAS" R"C,"R MANAG"D S(ANDB? DA(ABAS" N,D"-A? D3SC,NN"C( :R,M S"SS3,N

+bove 8uery is used to start ,P on Physical "tandby database with dierentoptions as re8uired.

SI- select process status seOuence9 fro$ #5$anaged.standby

PR,C"SS S(A(HS S"IH"NC"9

 ARC/ C,NN"C("D 4

 ARC/ C,NN"C("D 4 ARC/ C,NN"C("D 4 ARC/ C,NN"C("D 4 MRP4 KA3(.:,R.-,G %

DereC the ,P has been started and is waiting or the log se8uenceE 21. ( ,P isnot startedC then the above 8uery would not show up the ,P0 under the processcolumn. emember ,P needs to be started on Physical Standby and is used or

Page  o %%

Page 12: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 12/22

applying the logs being shipped rom Pri$ary database to Physical Standby database.

26. On the primary databaseC perorm a ew log switches and chec i the logs areapplied to the standby database.

sOlplus sys2 password 7pri$4 as sysdba

SI- alter syste$ switch logfile

The above command was hanging and not getting completed. 'sed below steps toresolve the issue:

SI- select GR,HP9 ARC/3"D S(A(HS fro$ #5log

  GR,HP9 ARC S(A(HS   N, 3NAC(3"  % N, CHRR"N(  & N, 3NAC(3"The systems probably waiting or an archive logC i.e. in the 8uery above ARC ;

 N,. 'se below commands to setup automatic archival:

SI- A-("R S?S("M S"( DB.R"C,"R?.:3-".D"S(.S3Q" ; G SC,P";B,(/ S3D;FLFSyste$ altered!

SI- alter syste$ archi#e log allSyste$ altered!

Once above commands were run alter syste$ switch logfile was successul.

%)! Check the current seOuence nu$ber of pri$db4*

SI- select $a<seOuence9= fro$ #5archi#ed.log

 MA1<S"IH"NC"9=  '&

SI- select thread9$a<seOuence9= fro$ #5archi#ed.log where applied;F?"SF group by thread9

  (/R"AD9 MA1<S"IH"NC"9=   '&

un the above 8ueries again this time on stdbydb4 and see i the output ismatching which conirms that log shipping is woring.

&! DG Broker Configuration

Foracleuser2Gpunitpecs06 adminHI dg$grl

Page % o %%

Page 13: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 13/22

$J,J or inu?: 9ersion 11.2.0..0 - 6bit Production

opyright 3c5 2000C 200>C Oracle. +ll rights reserved.

Kelcome to $J,JC type BhelpB or inormation.

$J,J7 connect sys2 password  onnected.

$J,J7 CR"A(" C,N:3GHRA(3,N FDGB%F AS PR3MAR? DA(ABAS" 3S Fstdbydb4F C,NN"C(3D"N(3:3"R 3S Fstdby4F

oniguration B$J&2B created with primary database Bstdbydb01B

$J,J7 ADD DA(ABAS" Fpri$db4F AS C,NN"C( 3D"N(3:3"R 3S F pri$4F

$atabase Bprimdb01B added

$J,J7 show configuration

oniguration - $J&2

  Protection ,ode: ,a?Perormance  $atabases:  stdbydb01 - Primary database  primdb01 - Physical standby database

@ast-"tart @ailover: $("+&*$

oniguration "tatus:$("+&*$

$J,J7 enable configuration

*nabled.

$J,J7 show database Fstdbydb4F

$atabase - stdbydb01

  ole: P(,+A  (ntended "tate: T+%"POT-O%  (nstance3s5:  stdbydb01

$atabase "tatus:"'*""

$J,J7 show database Fpri$db4F

$atabase - primdb01

  ole: PDA"(+ "T+%$&A  (ntended "tate: +PPA-O%

Page & o %%

Page 14: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 14/22

  Transport ag: 0 seconds  +pply ag: 0 seconds  eal Time )uery: O@@  (nstance3s5:  primdb01

$atabase "tatus:"'*""

$J,J7 show configuration

oniguration - $J&2

  Protection ,ode: ,a?Perormance  $atabases:  stdbydb01 - Primary database  primdb01 - Physical standby database

@ast-"tart @ailover: $("+&*$

oniguration "tatus:

"'*""

$J,J7 show database #erbose Fstdbydb4F

$atabase - stdbydb01

  ole: P(,+A  (ntended "tate: T+%"POT-O%  (nstance3s5:  stdbydb01

  Properties:

  $Jonnect(dentiier L Mstdby01M  Observeronnect(dentiier L MM  ogNpt,ode L M+"A%M  $elay,ins L M0M  &inding L MoptionalM  ,a?@ailure L M0M  ,a?onnections L M1M  eopen"ecs L M00M  %etTimeout L M0M  edoompression L M$("+&*M  og"hipping L MO%M  Preerred+pply(nstance L MM  +pply(nstanceTimeout L M0M

  +pplyParallel L M+'TOM  "tandby@ile,anagement L M+'TOM  +rchiveagTarget L M1<00M  og+rchive,a?Processes L M2M  og+rchive,in"ucceed$est L M1M  $b@ile%ameonvert L M/u12/primdb01/primdb01/C/u#0/stdbydb01/stdbydb01/M  og@ile%ameonvert L M/u12/primdb01/primdb01/C/u#0/stdbydb01/stdbydb01/M

Page ' o %%

Page 15: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 15/22

  @ast"tart@ailoverTarget L MM  (nconsistentProperties L M3monitor5M  (nconsistentogNptProps L M3monitor5M  "end)*ntries L M3monitor5M  ogNpt"tatus L M3monitor5M  ecv)*ntries L M3monitor5M  "id%ame L Mstdbydb01M  "taticonnect(dentiier L M3$*"(PT(O%L3+$$*""L3POTOOLtcp53DO"TLpunitpecs06.ad.contoso.com53POTL1#2155

3O%%*T!$+T+L3"*9(*!%+,*Lstdbydb01!$J,J53(%"T+%*!%+,*Lstdbydb0153"*9*L$*$(+T*$555M  "tandby+rchiveocation L M'"*!$&!*O9*A!@(*!$*"TM  +lternateocation L MM  og+rchiveTrace L M1M  og+rchive@ormat L Mlogt!s!r.arcM  TopKait*vents L M3monitor5M

$atabase "tatus:"'*""

$J,J7 show database #erbose Fpri$db4F

$atabase - primdb01

  ole: PDA"(+ "T+%$&A  (ntended "tate: +PPA-O%  Transport ag: 0 seconds  +pply ag: 0 seconds  eal Time )uery: O@@  (nstance3s5:  primdb01

  Properties:

  $Jonnect(dentiier L Mprim01M  Observeronnect(dentiier L MM  ogNpt,ode L M+"A%M  $elay,ins L M0M  &inding L MoptionalM  ,a?@ailure L M0M  ,a?onnections L M1M  eopen"ecs L M00M  %etTimeout L M0M  edoompression L M$("+&*M  og"hipping L MO%M  Preerred+pply(nstance L MM  +pply(nstanceTimeout L M0M

  +pplyParallel L M+'TOM  "tandby@ile,anagement L M+'TOM  +rchiveagTarget L M1<00M  og+rchive,a?Processes L M2M  og+rchive,in"ucceed$est L M1M  $b@ile%ameonvert L M/u#0/stdbydb01/stdbydb01/C/u12/primdb01/primdb01/M  og@ile%ameonvert L M/u#0/stdbydb01/stdbydb01/C/u12/primdb01/primdb01/M

Page ) o %%

Page 16: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 16/22

  @ast"tart@ailoverTarget L MM  (nconsistentProperties L M3monitor5M  (nconsistentogNptProps L M3monitor5M  "end)*ntries L M3monitor5M  ogNpt"tatus L M3monitor5M  ecv)*ntries L M3monitor5M  "id%ame L Mprimdb01M  "taticonnect(dentiier L M3$*"(PT(O%L3+$$*""L3POTOOLtcp53DO"TLpunitpecs0#.ad.contoso.com53POTL1#2155

3O%%*T!$+T+L3"*9(*!%+,*Lprimdb01!$J,J53(%"T+%*!%+,*Lprimdb0153"*9*L$*$(+T*$555M  "tandby+rchiveocation L M'"*!$&!*O9*A!@(*!$*"TM  +lternateocation L MM  og+rchiveTrace L M1M  og+rchive@ormat L Mlogt!s!r.arcM  TopKait*vents L M3monitor5M

$atabase "tatus:"'*""

'! (roubleshooting

1. Aou can use ,"RR  utility to investigate more about any O+ error messages:

Page E o %%

Page 17: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 17/22

Foracleuser2Gservername traceHI oerr ora 16607 

10;C 00000C Bone or more databases have ailedB// ause: + ailure was detected or one or more databases in the $ata// Juard broer coniguration.// +ction: ocate the database3s5 with a ailure status and correct it.

2. To rule out any connectivity issues use tnsping command or try connecting tothe (NS name using below commands rom each node*

-3NH1 tnsping pri$4-3NH1 tnsping stdby4

-3NH1 r$an target sys2 password 7 pri$4-3NH1 r$an target sys2 password 7stdby4

. To rule out any password ile issues use below 8ueries and see i connectivityis ine:

sOlplus sys2 password 7stdby4 as sysdbasOlplus sys2 password 7 pri$4 as sysdba

6. $ata Juard &roer log ile is saved in the location pointed by background.du$p.dest parameter. The name o the log ile starts with drc

(n above case the name o the log ile generated in respective background.du$p.dest were drcpri$db4  drcstdbydb4!

)! "rrors "ncountered 

1. "tep < o coniguration was ailing with error indicated below*

Page @ o %%

Page 18: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 18/22

")7 startup $ount=O+-102#: parameter OJ!+D(9*!$*"T!2 contains repeated or conlictingattributes

To resolve above error did the ollowing steps:

")7 create pfile fro$ spfile

'%(N7 cd 5,RAC-"./,M"2dbs

'%(N7 ls lart

'%(N7 #i init$ydbpri$!ora

,odiied -,G.ARC/3".D"S(.% to remove the DB.HN3IH".NAM"; stdbydb4

,rignal*L!log.archi#e.dest.%;FS"R3C";stdbydb4 ARC/ AS?NC

 A-3D.:,R;<,N-3N".-,G:3-"SPR3MAR?.R,-"= DB.HN3IH".NAM"; stdbydb4F

 Modified*

L!log.archi#e.dest.%;FS"R3C";stdby4 ARC/ AS?NC A-3D.:,R;<,N-3N".-,G:3-"SPR3MAR?.R,-"=F

'%(N7 sOlplus 2 as sysdba

")7 create spfile fro$ pfile=

")7 startup

2. reate Physical "tandby database 3stdbydb45 using $'P(+T* command wasailing:

&elow parameters in pile o both databases were set as mentioned which resolvedthe issue:

initpri$db4!ora

L!db.file.na$e.con#ert;F2u)42stdbydb42stdbydb42FF2u%2pri$db42pri$db42FL!log.file.na$e.con#ert;F2u)42stdbydb42stdbydb42FF2u%2pri$db42pri$db42F

initstdbydb4!ora

L!db.file.na$e.con#ert;F2u%2pri$db42pri$db42FF2u)42stdbydb42stdbydb42FL!log.file.na$e.con#ert;F2u%2pri$db42pri$db42FF2u)42stdbydb42stdbydb42F

. og shipping not woring rom Primary database <pri$db4= to Physical "tandbydatabase <stdbydb4=:

+s the archives were not getting applied disabled log shipping on stdbydb01 usingbelow command:

SI- A-("R DA(ABAS" R"C,"R MANAG"D S(ANDB? DA(ABAS" CANC"-

On the primary server went to the ollowing location:2u%2pri$db42fast.reco#ery.area2PR3MDB42archi#elog

Page  o %%

Page 19: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 19/22

'sing scp copied all the archive logs rom primary server to secondary server:

Foracleuser1Gpunitpecs0# archivelogHI scp r %4&.4&.oracleuser%7punitpecs4'!ad!contoso!co$*2u)42stdbydb42fast.reco#ery.area2S(DB?DB42archi#elog2

On secondary server went to ,+% prompt and ran ollowing command to apply thecopied archives which was successul:

,+%7 catalog start withF2u)42stdbydb42fast.reco#ery.area2S(DB?DB42archi#elog2F

This process was successul but automatic log shipping was not woring ase?pected.

an below command on primdb01: ")7 A-("R S?S("M S"( -,G.ARC/3".D"S(.%;FS"R3C";stdby4 N,A::3RM AS?NC

 A-3D.:,R;<,N-3N".-,G:3-"SPR3MAR?.R,-"= DB.HN3IH".NAM";stdbydb4F scope;both"ystem altered.

")7 A-("R S?S("M S"( -,G.ARC/3".D"S(.S(A(".%;"NAB-""ystem altered.

an below command on stdbydb01:

")7 A-("R S?S("M S"( -,G.ARC/3".D"S(.%;FS"R3C"; pri$4 N,A::3RM AS?NC A-3D.:,R;<,N-3N".-,G:3-"SPR3MAR?.R,-"= DB.HN3IH".NAM"; pri$db4F scope;both"ystem altered.

")7 A-("R S?S("M S"( -,G.ARC/3".D"S(.S(A(".%;"NAB-""ystem altered.

")7 A-("R DA(ABAS" R"C,"R MANAG"D S(ANDB? DA(ABAS" CANC"-$atabase altered.

")7 A-("R DA(ABAS" R"C,"R MANAG"D S(ANDB? DA(ABAS" D3SC,NN"C( :R,M S"SS3,N$atabase altered.

Once this was done automatic log shipping started woring as e?pected. an belowcommand in both the databases to update the pile:

")7 create pfile fro$ spfile@ile created.

6. *rror encountered while initiating below 8uery as part o manual "K(TDO9*:

")7 A-("R DA(ABAS" C,MM3( (, SK3(C/,"R (, PR3MAR?+T* $+T+&+"* O,,(T TO "K(TDO9* TO P(,+A*O at line 1:O+-11>: media recovery re8uiredeerred below lin:

an below 8ueries:Page  o %%

Page 20: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 20/22

")7 alter database reco#er $anaged standby database finish=$atabase altered.

Once this was done below 8uery was successul along with "K(TDO9*:

")7 A-("R DA(ABAS" C,MM3( (, SK3(C/,"R (, PR3MAR?$atabase altered.

#. $J &roer coniguration was not getting succeeded as shown in below output:

$J,J7 show configuration

oniguration - Test!$J&

  Protection ,ode: ,a?Perormance  $atabases:  stdbydb01 - Primary database  primdb01 - Physical standby database  *rror: O+-16: unable to receive the result rom a database

@ast-"tart @ailover: $("+&*$

oniguration "tatus:*O

+lso the archives were not getting applied. To resolve this we ran below 8ueries:

")7 alter database reco#er $anaged standby DA(ABAS" cancel

$atabase altered.

")7 alter database reco#er $anaged standby DA(ABAS" using current logfile

disconnect fro$ session

$atabase altered.

Once this was done the archives started getting applied but then ater certaintime again stopped as @+ was ull. $eleted the archives which were applied romboth the Primary and Physical "tandby database. +ter deleting the archive logsrom @+ location ran below command rom ,+% prompt on both the Primary and"tandby database:

,+%7 crosscheck archi#elog all=,+%7 delete epired archi#elog all

onirmed that there was enough ree space available in @+ location ater whichthe archive logs again started getting applied automatically.

. $J &roer coniguration was still not getting succeeded as shown in belowoutput:

$J,J7 show configuration

oniguration - Test!$J&

Page %4 o %%

Page 21: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 21/22

  Protection ,ode: ,a?Perormance  $atabases:  stdbydb01 - Primary database  Karning: O+-1;>2: conigurable property value is inconsistent withdatabase setting

  primdb01 - Physical standby database  Karning: O+-1;>2: conigurable property value is inconsistent with

database setting

@ast-"tart @ailover: $("+&*$

oniguration "tatus:K+%(%J

Ke were getting below errors in $J &roer logs:

Karning: Property M+rchiveagTargetM has inconsistent values:,*T+$+T+LM0MC"P@(*LMMC $+T+&+"*LM0MKarning: Property Mog+rchive,a?ProcessesM has inconsistent values:,*T+$+T+LM6MC

"P@(*LMMC $+T+&+"*LM6MKarning: Property Mog+rchive,in"ucceed$estM has inconsistentvalues:,*T+$+T+LM1MC "P@(*LMMC $+T+&+"*LM1M"P@(* is missing value or property Mog+rchiveTraceM with sidLMprimdb01MKarning: Property Mog+rchiveTraceM has inconsistent values:,*T+$+T+LM0MC"P@(*LM3missing5MC $+T+&+"*LM0M"P@(* is missing value or property Mog+rchive@ormatM with sidLMprimdb01MKarning: Property Mog+rchive@ormatM has inconsistent values:,*T+$+T+LMt!s!r.dbMC "P@(*LM3missing5MC $+T+&+"*LMt!s!r.dbM

,ade the ollowing changes on respective databases:

$J,J7 edit database stdbydb4 set property -ogArchi#e:or$at ; Flogt.s. r!arcF$J,J7 edit database stdbydb4 set property -ogArchi#e(race ; FF$J,J7 edit database stdbydb4 set property Archi#e-ag(arget ; F44F$J,J7 edit database stdbydb4 set property -ogArchi#eMaProcesses ; F%F$J,J7 edit database stdbydb4 set property -ogArchi#eMinSucceedDest ; FF=

$J,J7 edit database pri$db4 set property -ogArchi#e:or$at ; Flogt.s.r!arcF$J,J7 edit database pri$db4 set property -ogArchi#e(race ; FF$J,J7 edit database pri$db4 set property Archi#e-ag(arget ; F44F$J,J7 edit database pri$db4 set property -ogArchi#eMaProcesses ; F%F$J,J7 edit database pri$db4 set property -ogArchi#eMinSucceedDest ; FF

an the below 8uery so that the changes are relected in pile:")7 create pfile fro$ spfile

+s log!archive!ormat parameter was not getting set as e?pected made theollowing change in the pile o both databases 3one at a time5 by shutting itdown:

L!log.archi#e.for$at;Flogt.s.r!arcF

Page % o %%

Page 22: Data Guard Configuration With DG Broker on Oracle 11g

7/23/2019 Data Guard Configuration With DG Broker on Oracle 11g

http://slidepdf.com/reader/full/data-guard-configuration-with-dg-broker-on-oracle-11g 22/22

an the below 8uery so that the changes are relected in spile beore startingthe database:

")7 create pfile fro$ spfile

Once this was done $J &roer coniguration was successul.

Page %% o %%