You are on page 1of 6

STEPS TO SETUP A DATAGUARD ============================= 1] Put Database in archive log mode ] Resi!e the redo log "iles to a si!

e #hich is more convenient to send over the net#or$%1&' or (') *] +reate standb, control "ileS./0 Alter database create standb, control"ile as 1+23stb,ctl-ctl45

6 a recent co] Restore ld bac$ u7 "rom the 7rimar, to the secondar,(] Rename the original control"iles o" the cold bac$u7 and ma$e co7ies o" the standb, control"ile and name them as the original control"iles ie +O8TRO/&1-ctl9 +O8TRO/& -ctl9 +O8TRO/&*-ctl:] 'a$e the necessar, changes in the init-ora "ile;" ,ou #ant to setu7 dataguard in a s#itchover environment then9 ,ou need to create a standb, init-ora as #ell as the init-ora used b, the actual databaseEg2 Primar, init-ora on Primar, host2 log<archive<dest<1==/O+AT;O8=>e?7ort>home>oracle>oracle>arch= log<archive<dest< ==SER@;+E=DGD&1<hasunclu arch noa""irm= log<archive<dest<state<1=enable log<archive<dest<state< =enable log<archive<"ormat=At<As-db" log<archive<start=true remote<archive<enable=true Standb, init-ora on Primar, host2 log<archive<dest<1==/O+AT;O8=>e?7ort>home>oracle>oracle>arch= log<archive<dest<state<1=enable log<archive<"ormat=At<As-db" log<archive<start=true standb,<archive<dest=4>e?7ort>home>oracle>tem7>oracle>arch>4 standb,<"ile<management=auto "al<server=BT8S8A'E o" the Production Server0 "al<client=BT8S8A'E o" the Standb, Server0 remote<archive<enable=true %o7tional) db<"ile<name<convert =%17rimar, server4 9 1secondar, server4) log<"ile<name<convert=%17rimar, server4 9 1secondar, server4)

Eg2

;ncase the "ile 7ath o" Primar, and secondar, do not coincide then use last t#o 7arameters in the standb,Also9 tr, and add 7arameters to both the "iles%similar) so that it hel7s in time o" s#itch over9 onl, the value "or CA/ server are di""erent-

TCS Confidential

D]

'a$e changes in T8S8A'ES-ora PDO8DS = %DES+R;PT;O8 = %ADDRESS</;ST = %ADDRESS = %PROTO+O/ = T+P)%EOST = B7rimar, i70)%PORT = 1( 1)) ) %+O88E+T<DATA = %S;D = PDO8DS) %SER@ER = DED;+ATED) ) ) PDO8DSSTD= %DES+R;PT;O8 = %ADDRESS</;ST = %ADDRESS = %PROTO+O/ = T+P)%EOST = Bsecondar, i70)%PORT = 1( 1)) ) %+O88E+T<DATA = %S;D = PDO8DS) %SER@ER = DED;+ATED) ) )

The "irst entr, is the normal entr, that the database has in its T8S8A'ES-ora The second entr, is the entr, that is made #ith re"erence to Standb, Database'a$e similar changes to standb, database PDO8DS = %DES+R;PT;O8 = %ADDRESS</;ST = %ADDRESS = %PROTO+O/ = T+P)%EOST = B7rimar, i70)%PORT = 1( 1)) ) %+O88E+T<DATA = %S;D = PDO8DS) %SER@ER = DED;+ATED) ) ) PDO8DSSTD= %DES+R;PT;O8 = %ADDRESS</;ST = %ADDRESS = %PROTO+O/ = T+P)%EOST = Bsecondar, i70)%PORT = 1( 1)) ) %+O88E+T<DATA = %S;D = PDO8DS) %SER@ER = DED;+ATED) ) )

TCS Confidential

F-Ensuring the net#or$ connectivit, bet#een 7rimar, and secondar, b, 7inging and tns7inging bet#een themG-At Primar, Startu7 7rimar, database S./0startu7 7"ile=4Bne# init-ora04 At Standb, Do not mount or o7en restored standb, S./0Startu7 nomount 7"ile=4ne# init-ora4 1&-At Standb, S./0 Alter database mount standb, database5

At Primary S./0 select status9error "rom vHarchive<dest #here dest<id= STATUS ERROR IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII @A/;D The above Juer, shouldn4t return an, error- ;" an error occurs the dataguard #ill not #or$ 7ro7erl, until the error is solved'ost o" the errors are T8S8A'ES relateda)Corce a logs#itch using S./0alter s,stem s#itch log"ile5 b) T8SP;8G to the standb, "rom 7rimar,c)+hec$ "or the entries in the T8S8A'ES-ora "ile11- At Standb, Put the database in recover, mode using S./0alter database recover managed standb, database disconnect "rom session5 S./0select message "rom vHdataguard<status5 S./0select threadK9seJuenceK9status9archived9a77lied "rom vHarchived<log5 At Primar, +hec$ the current seJuence number in the log S./0select L "rom vHlog5 1 - The S./ Jueries in ste7 F is used "or chec$ing i" dataguard is #or$ing in good conditionI %The last log seJuence a77lied at the standb, should coincided #ith the last active log seJuence number M1)

TCS Confidential

1*- Cor o7ening the database in readonl, mode At standb, S./0alter database recover managed standb, database cancel5 S./0alter database o7en readonl,5 16- +reate s7"ile "rom the 7"ile in both 7rimar, and standb, S./0create s7"ile=4BORA+/E<EO'E0>database>s7"ileBsid0-ora4 "rom 7"ile=4Binit-ora used during startu7045%"or Nindo#s) S./0create s7"ile=4BORA+/E<EO'E03dbs3s7"ileBsid0-ora4 "rom 7"ile=4Binit-ora used during startu7045%"or Uni?) 1 - Shutdo#n standb, and 7ut it bac$ in recover, mode "or it to be active againSTEPS TO SWITCHOVER IN A DATAGUARD A s#itchover is a role reversal bet#een the 7rimar, database and one o" its standb, databases- A s#itchover o7eration guarantees no data loss- This is t,7icall, done "or 7lanned maintenance o" the 7rimar, s,stem- During a s#itchover9 the 7rimar, database transitions to a standb, role and the standb, database transitions to the 7rimar, role- The transition occurs #ithout having to reI create either database1@eri", that both the 7rimar, and standb, init-ora su77ort role transition-

%'a$e entries as mentioned above in both 7rimar, and secondar,) @eri", that there is net#or$ connectivit, bet#een the 7rimar, and standb, locations-

%T8SP;8G A8D P;8G Tests and the a77ro7riate changes in the T8S8A'ES-ora) *Cor a Real A77lication +lusters database9 onl, one 7rimar, instance and one standb, instance can 7er"orm the s#itchover o7eration- Shut do#n all other instances be"ore the s#itchover o7eration68o +lient connections are allo#ed to the databaseS./0 select s#itchover<status "rom vHdatabase5 SN;T+EO@ER<STATUS IIIIIIIIIIIIIIIIII TO STA8DOP ;" SN;T+EO@ER<STATUS returns SESS;O8S A+T;@E then ,ou should either disconnect all sessions(To 7er"orm s#itchover +onvert the 7rimar, database to the ne# standb,2 S./0 alter database commit to s#itchover to 7h,sical standb, #ith session shutdo#n55

TCS Confidential

:- Shutdo#n the "ormer 7rimar, and mount as a standb, database2 S./0 shutdo#n immediate ORAI&1(&D2 database not mounted ORA+/E instance shut do#nS./0 startu7 nomount ORA+/E instance startedTotal S,stem Global Area F(& &G66 b,tes Ci?ed Si!e 6(6G F b,tes @ariable Si!e D1*&*1:F b,tes Database Ou""ers 1 (F G1 b,tes Redo Ou""ers :DGG*: b,tes S./0 alter database mount standb, database5 Database alteredF- De"er the remote archive destination on the old 7rimar,2 S./0 alter s,stem set log<archive<dest<state< =de"er5 G- @eri", that the 7h,sical standb, can be converted to the ne# 7rimar,2%at the ne# 7rimar, node) S./0 select s#itchover<status "rom vHdatabase5 SN;T+EO@ER<STATUS IIIIIIIIIIIIIIIIII SN;T+EO@ER PE8D;8G 1&- +onvert the 7h,sical standb, to the ne# 7rimar,2 S./0 alter database commit to s#itchover to 7rimar,5 Database altered11- Shutdo#n and startu7 the ne# 7rimar,2 S./0 shutdo#n immediate ORAI&1(&D2 database not mounted ORA+/E instance shut do#nS./0 startu7 ORA+/E instance startedTotal S,stem Global Area F(& &G66 b,tes Ci?ed Si!e 6(6G F b,tes @ariable Si!e D1*&*1:F b,tes Database Ou""ers 1 (F G1 b,tes Redo Ou""ers :DGG*: b,tes

TCS Confidential

Database mountedDatabase o7enedS./0 1 - Enable remote archiving on the ne# 7rimar, to the ne# standb,2 S./0 alter s,stem set log<archive<dest<state< =enable5 1*- Start managed recover on the ne# standb, database2 S./0 recover managed standb, database disconnect5 'edia recover, com7lete-

STEPS TO CA;/O@ER ;8 A DATAGUARD The Di""erence bet#een a S#itchover and a Cailover is9 that a"ter a Cailover9the Standb, Database becoming a Primar, no#9 cannot s#itchbac$ to become a Standb, Database again- ;n O77osition a S#itchover e?changes the Database Roles %The Primar, becomes a Standb, and the Standb, becomes a Primar,)- S#itchovers can be 7er"ormed arbitraril,9 a Cailover onl, onceThe ste7s to test a Cailover scenario is as described1*Shutdo#n the 7rimar, and standb, databasesTa$e a coldbac$u7 o" ,our 7rimar, and standb, databasePut the standb, bac$ in recover, using ste7s as "ollo#s

At standb, S./0startu7 nomount S./0alter database mount standb, database5 S./0 alter database recover managed standb, database disconnect "rom session5

6-Then issue the "ollo#ing S./ statements S./0 A/TER DATAOASE RE+O@ER 'A8AGED STA8DOP DATAOASE +A8+E/5 S./0 A/TER DATAOASE RE+O@ER 'A8AGED STA8DOP DATAOASE C;8;SE SQ;P STA8DOP /OGC;/E5 S./0 A/TER DATAOASE +O'';T TO SN;T+EO@ER TO PR;'ARP (-Shutdo#n and startu7 again S./0shutdo#n immeditate S./0startu7

TCS Confidential

You might also like