You are on page 1of 4
2017-529 HowTo- Create Prysical Standby Database - Managed Hosting Intra - Confluence Production Pages /... / OLD_DBHowTo HowTo - Create Physical Standby Database ‘Crone by Srenshar hana let ate on Sep 07,2072 HowTo - Create Physical Standby Database Procedure: 4. Identify the primary database server and standby database server Exar Primary database server: apirise-sreschara dot mary dstsbase name: [§_SORCE Physical standby catabate server: apimise-sreedhara-db02 2. On primary database, ble fores logging option SQL> ALTER DATABASE FORCE LOGGING; Database altered. 83, Make sure password file exists forthe primary database under SORACLE_ HOME/dbs. $ 15 -1 SoRACLE_NoE/dbs/orapwePrinary DS nane> Bxarple: 1s -1 SORACLE_HOME/cbs/oraputs_soRCE 4.\f the primary database ie not in ARCHIVELOG mode, put it in ARCHIVELOG mode SQL> shutdown ineediates SQL> startup rounes SQL> alter database archivelog: SQL> alter database open; SQL> archive log list; 5. Configure required TNS aliases in tnsnames.ora on both primary and standby database servers \We naed two TNS aliases fr standby setup. One forthe primary dstbase and anther one fr stay dotase, And bath those TNS aliases should exst on bath Dimary and slancoy dlatase eorvars nor Ineremos.oa ie, Below a the two exam TNS stages, You can copy ad madly them for you" savers databace, ‘a rece alases to SORACLE HOMEInsivedasmrinsnames.of leon ath pimary and sandy Serves 1s. soRce (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 172.24.5@.211)(PORT = 1522)) (Cowiect_parA = (Seaver = veoicateD) (SERVECE_NANE = LS_soRCE) > ) Usrreer = {(pescereri0N (ADDRESS = (PROTOCOL = TCP) (HOST = 172.24.50.112)(PORT (Comnect_parA = (seaveR = vevicareD) (SERVECE_NANE = LS_TRGET) > ) 6. On primary database, configure the standby database specific initialization paramotors 1 you use pile, oc the parmrater fle idbeint a flat config. these parameters. you use ap, you wil ead o une ‘ALTER SYSTEM statement to cenigue the parameters, 1 yu ae using spi, than ‘spi’ parareler would be configures in your databsse, You can use shaw parameter spi’ comma in SOLPha o find cu if you re ting aphle, See an example below = SQL> show parameter spéile hip icomuence hops jo 844aisplay MHINTHowTor-+CreatorPhysicaleStancby+Database 2017-529 HowTo- Create Prysical Standby Database - Managed Hosting Intra - Confluence Production nae ree vawwe spfile string Irone/oracle/preduct/10.2.0/¢0 s/spflels_SORCE.or3 CCorfigue below parameters - archive_lag_target=200 {al_client~" fal_server=” ogarchive_dest_1="locstion-carch log location Log archive dest _2="SERVICE= LGA ASYNC NOAFFIRN VALID_FOR=(ONLINE_LOGEILES, PRIMARY ROLE) og_archive_dest_state_i=" ENABLE og_archive_dest_state_2-"ENABLE* + .standby_(le_nanagenent-"suto bxanple: archive_lag_target~260 fal_client-15_SORCE fal_servers(S_TRGET +. og_archive_dest_1="LOCATION=/rone/oracle/arch/LS_SORCE/ VALIO_FOR=(ONLINE_LOGFILES,ALL_ROLES) D8_UNIQUE_NAME-LS_SORCE" Log_archive_dest_2-"SERVICE=LS_TRGET UGaR ASVNC MOAFFIRM VALID_FOR-(ONLINE_LOGFILE, PRLFARY_ROL: ogarchive_dest_atate_s-tNAsle Log archive dest_state_2=ENABLE*. standby_fSLe_managenent=AUT0 7.On standby database server, install Oracle software without cresting any database, ake sue you instal same sofware version 38 that on primary database server ©. Create initial tion parameter file for physical standby database using the same from primary database ‘Create pte rom spfile on atmay database and copy the pf o standby detabare server ‘On standby server, may te pile you just cope for the below parameters = .fal_elient=t5_1R6ET # fal_senverst5_SORCE * Log_arehive_dest_1="LOCATION=/Hone/oracle/areh/1S_TRGET/ VALIO_FOR=(ONLINE_LOGFILES,AL_ROLES) Of UNIQUE_NAMF=L5_TRGET = Log_arenive_dest_2="SFRVICE=IS_SACE LGMR ASYC NOAFFIAM VALTO_FOR=(OMLINF_LOGFTLF, PRTHAAY_ OF) * Log_arehive_dest_state_2eDISADLE 9, On standby server, make sure to create all the directories refered In Int ton parameter fle 410. Remote copy password le forthe primary datab: from primary serverto se location on standby server ‘11. Transfer all the datafiles from primary database serverto standby database server ‘One ofthe below 3 methods canbe used to transfer the datas = + Manual septs al datafilos whl the pray database vst Pul the database in backup mde * scpall atte fom primary database sear to standby database server + End atabaso Backup rods" Manuly stip al datatie whe databases down 2 *Shutcown tha pmary dates esl up using ‘shawn med + Sop al dats om pimary database sorver to datoguard database sover 1 Bring up tne simarycatapase using siarup, + Use RMAN to backup the primary dalabase, remote copy the RMAN backup las lo standby server and retort on stacy sewer Samal code ha canbe Used for RAN Backup aan run ALLOCATE CHANNEL disk DEVICE TYPE DISK FORMAT '/hone/oracle/backup/t4 RU. bus"; backup AS COMPRESSED backupset ‘ag "FoR SranDsy" database include current control#ile plus archivelog Filesperset 5; RELEASE CHANNEL disia; y 12, Create backup controle on primary database and romots copy ito standby server Use bolow command io create backup conte. SQL> ALTER DATABASE BACKUP CONTROLFILE TO "/hone/oracle/ackup/ctl.bkup' 5 hip ieouence hops 0 844aaisplayMHINTHowTor-+CreatorPhysicaleStancby+Database 218 2017-529 HowTo- Create Prysical Standby Database - Managed Hosting Intra - Confluence Production 13, On standby sorver, copy the controfile that you Just received from primary server to allocations specifid In control les paramet 14. l you copied the dataflles using RMAN backup, then on standby server, mount the databace and restore the datafiles Logi to rman using rman target Inocatalog and use below sample coe to restr te alah ron ( ALLOCATE CHANNEL isk1 DEVICE TYPE DISK FORMAT */ora_backups//standby/%d_XU. bus"; restore database; RELEASE CHANNEL ose; ) 15, On standby database server, shutdown the mounted database 416. 0n primary database, eveate standby controlile and remote copy Ito standby server SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS '/tmp/stoy ctl"; SQL> exit; $ scp -p /tup/sthy.ct schidanbaran@cstandby servers Fp 17, On standby database sorver, copy the standby controtfils that you Just copied to all the locations spacified In control fllos parameter 418, On standby database server, configure and start the listener 18. On standby database server, mount the database in standby mode SQL> startup nonount; ‘ORACLE instance started Total systen Globa? cea 2619612736 bytes Fixes size 2096652 bytes variable size 385876088 bytes Database suffers 1207959582 bytes Reéo but fers e80068 bytes SQL> alter database mount stancby database; Database altered, 20. On both primary and standby database, configure standby redo logs for Re: Corfiguing standby redo logs enables RealTime Acaly. “Tis enaies fog apply services to apply red data as is cv, without wath forthe cue stan redo log fle to be archived. Ths asus in faster shaver and Tallovartimos paceuso the stacy fda lg los have Boon apple aady to the slay database by the line falovor or switchover begs ‘The sizes of he standby rao og Hes shoud match the sizeof te cuenta dstabase ote red log Hes. To ind out the size ot your ont eo ges use low query me Apply SELECT OISTINCT bytes/2024/1024 "Reco Log group size in ME” From vSLog: there are N rede lop group, you shoud crete N+ standby redo log groups. Use the flowing query te determine your cuont ay fle eup: select count(*) from v$log; create standby reso og srs using below SAL ALTER DATABASE ADO STANDBY LOGFILE GROUP 10 ("clog member 1°, ‘clog menber 2>°) SIZE 150m; Exargle SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 20 Cinoreroracle/eco/rde1/1S_TRGET/redo_p1_Filet. log", "/howe/oracle/edo/rdo?/1S_TAGET/redo_p1_ile2. log") SIZE 250K reuses Database altered. To very the esuts ofthe standby edo log groups zation, un the allowing a6: SELECT GROUPH, BYTES/1024/1626 “Size in NOY FROM VSSTANDBY._LOS; hp icouence hops o-844aisplay MHINTHowTor-+CreatorPhysicaleStancby+Database 3a 2017-529 HowTo- Create Prysical Standby Database - Managed Hosting Intra - Confluence Production 21. On standby database sorver, put the standby database into automatic recovery mods Use below Sal to put the datas database in automate racove mode, alter database recover managed standby database disconect from session; 22, Perform few iog switches on primary database and make sure logs are shipped to dataguard server SQL> alter system archive log current; syster altered: 23, Check if standby database i stil in sync with primary database Use bol quay to chock they aon syne ~ SQL> select a.threace, applied, ratapald, notappld-applied delta fron 2 (select threacs, nax(sequence#) applied from gvfarchived log where applied="VES 3 group by thread#) A, 4 (Select threads, max(sequencet) notappid from gvfarenived_log group by thresdt) 8 were a.thresd# = b.threadts THREADE — APPLIED NOTAPPLO DELTA a 62 2 IDELIW ie and ‘APPLIED it same ay NOTAPPLD’, sandy daabase it in syne with primary database, This canhides craton of sandy daabase co hp icouence hops o-844aisplay MHINTHowTor-+CreatorPhysicaleStancby+Database aa

You might also like