You are on page 1of 25

Data Guard Configuration Example - (10g, Physical Stand y!

y "eff #unter, Sr$ Data ase %dministrator

Contents

&ntroduction &ntroduction to 'racle Data Guard #ard(are and ')S Configuration Configure the Primary Data ase Configure 'racle *et Components Configure the Stand y Data ase Start +emote %rchi,ing -erifying the Physical Stand y Data ase Deletion Policy for %rchi,ed +edo .og /iles &n /lash +eco,ery %rea Post-Creation Steps %cti,ating a Physical Stand y Data ase (+ole 0ransition! /urther +eading % out the %uthor

Introduction
'racle Data Guard (1no(n as 'racle Stand y Data ase prior to 'racle2i!, forms an extension to the 'racle +D34S and pro,ides organi5ations (ith high a,aila ility, data protection, and disaster reco,ery for enterprise data ases$ 'racle Data Guard pro,ides the D3% (ith ser,ices for creating, maintaining, managing, and monitoring one or more stand y data ases$ 0he functionality included (ith 'racle Data Guard ena les enterprise data systems to sur,i,e oth data corruption as (ell as ma6or disasters$ 0his article pro,ides instructions for creating and configuring a physical stand y data ase from a primary data ase using 'racle Data ase 10g +elease 7 (10$7! operating in maximum performance protection mode$ &t should e noted that se,eral different methods exist to create a physical stand y data ase configuration and that this is 6ust one of those (ays$ 0he methods outlined in this guide present a simple approach that should e easy to implement in most situations$ &n fact, if you rea1 do(n the essential tas1s re8uired to uild a physical stand y data ase, you (ill see that it is essentially nothing more than ta1ing a ac1up of the primary data ase, creating a stand y controlfile, transferring the files to the stand y host, mounting the stand y data ase, putting the stand y data ase in managed reco,ery mode (+edo %pply!, and starting remote archi,ing from the primary data ase (+edo 0ransport!$ ' ,iously there are a num er of smaller steps & am lea,ing out (hich (ill all e discussed in more depth throughout this guide$ %ll configuration parameters related to the 'racle instance and net(or1ing (ill e discussed as (ell as ho( to place the stand y data ase in Managed Recovery Mode$

Introduction to Oracle Data Guard


0he stand y data ase feature of 'racle (as first introduced (ith the release of 'racle 9 in the early 1220:s$ 0he design (as fairly simple$ 'racle used media reco,ery to apply archi,e logs to a remote stand y data ase, ho(e,er, none of the automation (e no( ta1e for granted (as present in this release of the product$ D3%:s (ere re8uired to (rite custom scripts that shipped and applied archi,e logs to the remote stand y data ase$ &t

(asn:t until 'racle;i (here some form of automation (as introduced that relied on 'racle *et Ser,ices to transfer and apply archi,e redo logs$ D3%:s (ere still re8uired to supply scripts that handled gap resolution and resynchroni5e the primary and stand y data ase (hen they lost connecti,ity (ith one another$ %lso included in 'racle;i (as a set of pre-(ritten scripts that simplified the s(itcho,er and failo,er process$ <ith the introduction of 'racle2i, the stand y data ase feature (as renamed to 'racle Data Guard$ &n addition to the re- randing of the product, 'racle deli,ered a comprehensi,e automated solution for disaster reco,ery that (as fully integrated (ith the data ase 1ernel$ /inally, a fully integrated disaster reco,ery solution (ithout the need to maintain custom (ritten scripts= 'racle2i also pro,ided a ,ast array of ne( features (hich included automatic gap resolution, enhanced redo transport methods (synchronous and asynchronous redo transport!, the a ility to configure 5ero data loss, and the concept of protection modes$ >ntil 'racle2i +elease 7, the only stand y data ase type a,aila le (as the physical stand y data ase$ % physical stand y data ase is an identical, loc1-for- loc1 copy of the primary data ase and is 1ept in sync (ith the primary using media reco,ery (also referred to as +edo %pply!$ 'racle introduced a ne( type of stand y data ase (ith 'racle2i +elease 7 named Logical Standby Database$ 0his ne( type of stand y data ase 1eeps in sync (ith the primary data ase using S?. %pply (,ersus +edo %pply used (ith a physical stand y data ase!$ % logical stand y data ase remains open for user access (hile logical records are eing recei,ed and applied from the primary data ase (hich ma1es this a great candidate for a reporting data ase$ <hen the stand y data ase site is hosted in a different geographical location than the primary site, it pro,ides for an excellent #igh %,aila ility (#%! solution$ <hen creating a stand y data ase configuration, the D3% should al(ays attempt to 1eep the primary and stand y data ase sites identical as (ell as 1eeping the physical location of the production data ase transparent to the end user$ 0his allo(s for an easy role transition scenario for oth planned and unplanned outages$ <hen the secondary (stand y! site is identical to the primary site, it allo(s predicta le performance and response time after failing o,er (or s(itching o,er! from the primary site$

Oracle Database Enterprise Edition Requirement


'racle Data Guard is only a,aila le as a undled feature included (ithin its Enterprise Edition release of the 'racle Data ase soft(are$ &t is not a,aila le (ith 'racle Data ase Standard Edition$ <ith the exception of performing a rolling data ase upgrade using logical stand y data ase, it is mandatory that the same release of 'racle Data ase Enterprise Edition e installed on the primary data ase and all stand y data ases= <hile it remains possi le to simulate a stand y data ase en,ironment running 'racle Data ase Standard Edition, it re8uires the D3% to de,elop custom scripts that manually transfer archi,ed redo log files and then manually applying them to the stand y data ase$ 0his is similar to the methods used to maintain a stand y data ase (ith 'racle 9$ 0he conse8uence (ith this type of configuration is that it does not pro,ide the ease-ofuse, managea ility, performance, and disaster-reco,ery capa ilities a,aila le (ith Data Guard$

Standby Database Types


0here are t(o types of stand y data ases that can e created (ith 'racle Data Guard @ physical or logical$ Deciding (hich of the t(o types of stand y data ases to create is critical and depends on the nature of the usiness needs the organi5ation is trying to satisfy$ % physical stand y data ase is an identical, loc1-for- loc1 copy of the primary data ase and is 1ept in sync (ith the primary using media reco,ery$ %s redo gets generated on the primary data ase, it gets transferred to the stand y data ase (here an +/S process recei,es the primary redo and applies the change ,ectors directly to the stand y data ase$ % physical stand y data ase is an excellent choice for disaster reco,ery$

% logical stand y data ase (or1s in a different manner (hich 1eeps in sync (ith the primary y transforming redo data recei,ed from the primary data ase into logical S?. statements and then executes those S?. statements against the stand y data ase$ <ith a logical stand y data ase, the stand y remains open for user access in read)(rite mode (hile still recei,ing and applying logical records from the primary$ <hile a physical stand y data ase is an exact physical replica of the primary, a logical stand y data ase is not$ 3ecause 'racle is applying S?. statements to the stand y data ase and not performing media reco,ery (as is done (ith a physical stand y data ase!, it is possi le for the logical stand y data ase to contain the same logical data, ut at the same time ha,e a different physical structure$ % logical stand y data ase is an excellent solution for a reporting data ase (hile at the same time retaining the attri utes of a disaster reco,ery solution$ *ot only does a logical stand y data ase contain the same logical information as the primary, it can also support the creation of additional o 6ects to support impro,ed reporting re8uirements$

Data Protection Modes


%fter deciding et(een a physical or logical stand y data ase, the next ma6or decision is (hich data protection mode should e used to operate the Data Guard configuration$ %t the heart of this decision lies the ans(er to one important 8uestion @ ho( much data loss is your organi5ation (illing to endure in the e,ent of a failo,erA 0he o ,ious ans(er to expect from management is none$ Configuring Data Guard (ith guaranteed no data loss, ho(e,er, re8uires a significant in,estment in e8uipment and other resources necessary to pro,ide support for this type of en,ironment$ %n 'racle Data ase 10g Data Guard configuration (ill al(ays run in one of three data protection modesB

4aximum Protection 4aximum %,aila ility 4aximum Performance

Each of the three modes pro,ide a high degree of data protectionC ho(e,er they differ (ith regards to data a,aila ility and performance of the primary data ase$ <hen selecting a protection mode, al(ays consider the one that est meets the needs of your usiness$ Carefully ta1e into account the need to protect the data against any loss ,s$ a,aila ility and performance expectations of the primary data ase$ %n in-depth discussion on the three a,aila le data protection modes and ho( redo transport (or1s to support them is eyond the scope of this guide$ 0o 1eep the article simple, & (ill e using the default protection mode of Maximum Performance$

/or a detailed discussion on the ,arious 'racle Data Guard protection modes, see my article entitled :Data Protection 4odes:$

Hardware and O S Con!i"uration


.et:s ta1e a loo1 at the 'racle configuration and a summary of the parameters that (ill e used to create the physical stand y data ase configuration descri ed in this guide$

Oracle Release

Primary Database 'racle 10g +elease 7 @ (10$7$0$D!

Host #ame Operatin" System Database #ame $db%name& Database Domain $db%domain& Oracle SID Database 'nique #ame $db%unique%name& T#S (lias Ser)ice #ames Database *iles + $db%create%!ile%dest& *las, Reco)ery (rea + $db%reco)ery%!ile%dest& -ocal Online Redo -o" *iles + $lo"%arc,i)e%dest%.& Remote (rc,i)e Destination + $lo"%arc,i)e%dest%/&

,mlinux1$ide,elopment$info @ (127$1E;$1$1E0! +ed #at .inux D @ (Cent'S D$D! modesto ide,elopment$info modesto modesto modesto$ide,elopment$info modesto$ide,elopment$info, modesto )u07)oradata )u0F)flashGreco,eryGarea locationHuseGd Greco,eryGfileGdest @ (allGlogfiles,allGroles! ser,iceHturloc1 @ (onlineGlogfiles,primaryGrole!

P,ysical Standby Database Oracle Release 'racle 10g +elease 7 @ (10$7$0$D! Host #ame ,mlinux7$ide,elopment$info @ (127$1E;$1$1E7! Operatin" System +ed #at .inux D @ (Cent'S D$D! Database #ame $db%name& modesto Database Domain $db%domain& ide,elopment$info Oracle SID turloc1 Database 'nique #ame $db%unique%name& turloc1 T#S (lias turloc1$ide,elopment$info Ser)ice #ames turloc1$ide,elopment$info, turloc1 Database *iles + $db%create%!ile%dest& )u07)oradata *las, Reco)ery (rea + $db%reco)ery%!ile%dest& )u0F)flashGreco,eryGarea -ocal Online Redo -o" *iles + locationHuseGd Greco,eryGfileGdest @ $lo"%arc,i)e%dest%.& (allGlogfiles,allGroles! Remote (rc,i)e Destination + ser,iceHmodesto @ (onlineGlogfiles,primaryGrole! $lo"%arc,i)e%dest%/& &t is assumed that 'racle Data ase 10g +elease 7 and all patchsets ha,e een installed on oth nodes in the 'racle Data Guard configuration$ Clic1 here for a guide on installing 'racle Data ase 10g +7 on the +ed #at .inux D platform$

Con!i"ure t,e Primary Database


0he first phase in creating an 'racle Data Guard configuration in,ol,es performing the necessary tas1s on the primary data ase$ <hile se,eral of the tas1s outlined in this section are not mandatory, & (ill pro,ide explanations to their enefits and ho( their application can result in a more sta le disaster reco,ery solution$ %s se,eral of the steps included in this section in,ol,e ouncing the primary data ase, try to consolidate those steps in order to reduce the num er of ounces$ 1$ Enable (rc,i)elo" Mode

'racle Data Guard relies on redo from the primary data ase in order to maintain the stand y$ 0his re8uires the primary data ase e placed into archi,elog mode$ >se the follo(ing to ,erify that the primary data ase is in archi,elog modeB

SQL> archive log list Database log mode Automatic archival Archive destination !ldest online log se'uence urrent log se'uence

No Archive Mode Disabled USE_DB_RE !"ER#_$%LE_DES& () (*

0he output from the a o,e command sho(s that the primary data ase is not in archi,elog mode$ Perform the follo(ing steps to place the primary data ase into archi,elog modeB

SQL> shutdown immediate Database closed+ Database dismounted+ !RA LE instance shut do,n+ SQL> startup mount !RA LE instance started+ &otal S-stem .lobal Area /)*/0/(12* b-tes $i3ed Si4e /)5(*)6 b-tes "ariable Si4e (/25750*6 b-tes Database Bu88ers 16017177* b-tes Redo Bu88ers /006((76 b-tes Database mounted+ SQL> alter database archivelog; Database altered+ SQL> alter database open; Database altered+ SQL> archive log list Database log mode Automatic archival Archive destination !ldest online log se'uence Ne3t log se'uence to archive urrent log se'uence Archive Mode Enabled USE_DB_RE !"ER#_$%LE_DES& (* (7 (7

Prior to 'racle Data ase 10g, it (as also re8uired to set the log_archive_start initiali5ation parameter to &RUE in order to ena le automatic archi,ing$ 0his is no longer necessary as automatic archi,ing is ena led y default (hen the data ase is placed into archi,elog mode (ith 'racle Data ase 10g or higher$ 7$ Create a Password *ile %s part of the ne( redo transport security and authentication features, it is no( mandatory that each data ase in an 'racle Data Guard configuration utili5e a pass(ord file$ &n addition, the SIS pass(ord

must e identical on e,ery data ase in order for redo transport to function$ &f a pass(ord file does not exist for the primary data ase, create one using the follo(ing stepsB

9oracle:vmlinu3/ ;<= cd $ORACLE_HOME dbs 9oracle:vmlinu3/ dbs<= orapwd !ile"orapwmodesto password"M#$#s%assword

%fter creating the pass(ord file, set the remote_login_>ass,ord8ile initiali5ation parameter to E? LUS%"E in the spfile on the primary data ase$ Since this parameter cannot e dynamically modified for the current running instance, the change (ill ha,e to e made to the spfile and ounced in order to ta1e effectB

SQL> alter s#stem set remote_login_password!ile"e&clusive scope"sp!ile; S-stem altered+ SQL> shutdown immediate Database closed+ Database dismounted+ !RA LE instance shut do,n+ SQL> startup open !RA LE instance started+ &otal S-stem .lobal Area /)*/0/(12* b-tes $i3ed Si4e /)5(*)6 b-tes "ariable Si4e (/25750*6 b-tes Database Bu88ers 16017177* b-tes Redo Bu88ers /006((76 b-tes Database mounted+ Database o>ened+

F$ Enable *orce -o""in" $optional& %ny nologging operations performed on the primary data ase do not get fully logged (ithin the redo stream$ %s 'racle Data Guard relies on the redo stream to maintain the stand y data ase, this can result in data inconsistencies et(een the primary and stand y along (ith a massi,e headache for the D3% to resol,e$ 0o pre,ent this from occurring, one solution is to place the primary data ase into force logging mode$ &n this mode, all nologging operations are permitted to run (ithout error, ho(e,er, the changes (ill e placed in the redo stream any(ay$ %lthough this is considered an optional step, & ma1e it mandatory (hen designing an 'racle Data Guard configuration for my clients$ ',erloo1ing this on a production en,ironment can result in the D3% spending considera le time during the implementation of a disaster reco,ery situation$ 0o place the primary data ase in forced logging mode, connect as SIS and run the follo(ingB

SQL> alter database !orce logging; Database altered+

0o ,erify force logging is ena led for the data aseB

SQL> select !orce_logging !rom v$database; $!R E_L!..%N. @@@@@@@@@@@@@@ #ES

J$ Create Standby Redo -o"s $optional& Certain data protection modes (ithin 'racle Data Guard, such as maximum a,aila ility and maximum protection, mandate the use of stand y redo logs$ +egardless of the protection mode (e,en (hen using maximum performance!, it is highly recommended to utili5e stand y redo logs as generally more data can e reco,ered during a failo,er than (ithout them$ <hen creating the stand y redo logs, it is recommended to ha,e one more stand y redo log file group than the num er of online redo log file groups on the primary data ase$ &n addition, the stand y redo log file groups must e the same si5e as the online redo log file groups$ 0he recommended num er of stand y redo log log file groups can e calculated using the follo(ing formulaB
AB o8 online redo log 8ile grou>s on >rimar- C /D E ma3imum B o8 threads

0he example data ase used in this guide is not configured for 'racle +%C and therefore only contains one thread$ 0he primary data ase is configured (ith three online redo log file groups si5ed at D043 eachB

SQL> select group'( thread'( b#tes( members !rom v$log; .R!UFB &GREADB B#&ES MEMBERS @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ @@@@@@@@@@ / / 0)*)2266 ) ) / 0)*)2266 ) ( / 0)*)2266 )

0he num er of stand y redo logs re8uired for the physical stand y data ase in this example is (F K 1! L 1 H 0 at D043 each$ % est practice generally follo(ed is to create the stand y redo logs on oth the primary and the stand y data ase so as to ma1e role transitions smoother$ 3y creating the stand y redo logs at this stage, it is assured that they (ill exist on oth the primary and the ne(ly created stand y data ase$ /rom the primary data ase, connect as SIS and run the follo(ing to create four stand y redo log file groupsB
SQL> alter database add standb# log!ile thread ) group * si+e ,-m; Database altered+ SQL> alter database add standb# log!ile thread ) group , si+e ,-m; Database altered+ SQL> alter database add standb# log!ile thread ) group . si+e ,-m; Database altered+

SQL> alter database add standb# log!ile thread ) group / si+e ,-m; Database altered+

0o ,erify the ne( stand y redo log filesB

SQL> select group'( t#pe( member !rom v$log!ile order b# group'( member; .R!UFB @@@@@@@@@@ / / ) ) ( ( * * 0 0 7 7 5 5 &#FE @@@@@@@ !NL%NE !NL%NE !NL%NE !NL%NE !NL%NE !NL%NE S&ANDB# S&ANDB# S&ANDB# S&ANDB# S&ANDB# S&ANDB# S&ANDB# S&ANDB# MEMBER @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Hu6)HoradataHM!DES&!HonlinelogHo/_m8_/_7IIc2hr2_+log Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_/_7IIc2I3'_+log Hu6)HoradataHM!DES&!HonlinelogHo/_m8_)_7IIc2mvI_+log Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_)_7IIc2nvv_+log Hu6)HoradataHM!DES&!HonlinelogHo/_m8_(_7IIc2'r,_+log Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_(_7IIc2r-)_+log Hu6)HoradataHM!DES&!HonlinelogHo/_m8_*_7hvg('J1_+log Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_*_7hvg(rnm_+log Hu6)HoradataHM!DES&!HonlinelogHo/_m8_0_7hvg*28(_+log Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_0_7hvg*1gr_+log Hu6)HoradataHM!DES&!HonlinelogHo/_m8_7_7hvg*m1I_+log Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_7_7hvg*nb*_+log Hu6)HoradataHM!DES&!HonlinelogHo/_m8_5_7hvg*,(d_+log Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_5_7hvg*3bl_+log

D$ Con!i"ure t,e Primary Database Initiali1ation Parameters 4ost of the configuration options for Data Guard are implemented using initiali5ation parameters for the 'racle instance$ <hen the primary and stand y machines are identical (memory, dis1s, CP>, etc$! the initiali5ation file for oth data ases should e nearly identical$ <hen configuring the initiali5ation parameters on the primary data ase, it is important to consider future role transitions$ 0he initiali5ation parameters that control redo transport and redo apply should e configured so that the data ase (ill seamlessly operate in either role (ith no parameter modifications re8uired$ <hen the data ase is mounted on a primary controlfile, the stand y parameters are not read and are not put into effect, so they (ill not affect the operation of the data ase (hile in the primary role$ 0he parameters listed elo( should e placed in the initiali5ation file for the primary data ase$ *otice that & (ill initially :DE/E+: log_archive_dest_state_) until the stand y data ase has een created,

mounted, and placed in managed reco,ery mode$ %lso note that the db_8ile_name_convert and log_8ile_name_convert parameters are only re8uired if the paths (ill e different et(een the primary and stand y host$

B @@@9 Dum> Destination Farameters < @@@ B audit_8ile_destKLHu6/Ha>>HoracleHadminHmodestoHadum>L bacJground_dum>_destKLHu6/Ha>>HoracleHadminHmodestoHbdum>L core_dum>_destKLHu6/Ha>>HoracleHadminHmodestoHcdum>L user_dum>_destKLHu6/Ha>>HoracleHadminHmodestoHudum>L B @@@9 Role@inde>endent Farameters < @@@ B archive_lag_targetK166 com>atibleKL/6+)+6+0+6L control_8ilesKLHu6)HoradataHM!DES&!Hcontrol8ileHo/_m8_7hc7stn1_+ctlLM LHu6(H8lash_recover-_areaHM!DES&!Hcontrol8ileHo/_m8_7hc7st--_+ctlL db_nameKLmodestoL db_domainKLidevelo>ment+in8oL db_create_8ile_destKLHu6)HoradataL db_recover-_8ile_destKLHu6(H8lash_recover-_areaL dis>atchersKLAFR!&! !LK& FD ASER"% EKmodesto?DBDL instance_nameKLmodestoL log_archive_con8igKLdg_con8igKAmodestoMturlocJDL log_archive_ma3_>rocessesK* remote_login_>ass,ord8ileKLe3clusiveL B @@@9 Frimar- Role Farameters < @@@ B db_uni'ue_nameKLmodestoL log_archive_dest_/KLlocationKuse_db_recover-_8ile_dest valid_8orKAall_log8ilesMall_rolesD db_uni'ue_nameKmodestoL log_archive_dest_)KLserviceKturlocJ+idevelo>ment+in8o valid_8orKAonline_log8ilesM>rimar-_roleD db_uni'ue_nameKturlocJL log_archive_dest_state_/KLenableL log_archive_dest_state_)KLde8erL service_namesKLmodesto+idevelo>ment+in8oM modestoL B @@@9 Standb- Role Farameters < @@@ B db_8ile_name_convertKLH&URL! NHLMLHM!DES&!HL log_8ile_name_convertKLH&URL! NHLMLHM!DES&!HL 8al_serverKLmodestoLMLturlocJL 8al_clientKLmodestoL standb-_8ile_managementKLautoL

Se,eral of the initiali5ation parameters listed a o,e can not e dynamically modified and therefore (ill re8uire the primary data ase to e ouncedB
SQL> shutdown immediate Database closed+ Database dismounted+ !RA LE instance shut do,n+ SQL> startup !RA LE instance started+ &otal S-stem .lobal Area /)*/0/(12* b-tes $i3ed Si4e /)5(*)6 b-tes "ariable Si4e (/25750*6 b-tes Database Bu88ers 16017177* b-tes

Redo Bu88ers Database mounted+ Database o>ened+

/006((76 b-tes

E$ Create a 2ac3up o! t,e Primary Database % physical stand y data ase can e created using either a hot or cold ac1up of the primary as long as all of the necessary archi,elogs are a,aila le to ring the stand y data ase to a consistent state$ /or the purpose of this guide, & (ill e performing an online (hot! ac1up of the primary data ase using +4%*$ 0he +4%* ac1upsets (ill e (ritten to a staging directory located outside of the /lash +eco,ery %reaC namely Hu6*HoracleHdg_staging$ & start y creating the staging directory on oth the primary and stand y hostsB

9oracle:vmlinu3/ ;<= m0dir 1p 9oracle:vmlinu3) ;<= m0dir 1p

u-* oracle dg_staging u-* oracle dg_staging

/rom the primary host, perform an +4%* ac1up of the primary data ase that places the ac1upset into the staging directoryB

9oracle:vmlinu3/ ;<= rman target s#s M#$#s%assword2modesto RMAN> bac0up device t#pe dis0 !ormat 3 u-* oracle dg_staging 453 database plus archivelog;

9$ Create a Standby Control!ile >sing the same process as a o,e, create a stand y controlfile in the staging directory using +4%*B

9oracle:vmlinu3/ ;<= rman target s#s M#$#s%assword2modesto RMAN> bac0up device t#pe dis0 !ormat 3 u-* oracle dg_staging 453 current control!ile !or standb#;

;$ Prepare an Initiali1ation Parameter !or t,e Standby Database Create an initiali5ation parameter for the stand y data ase using the primary as the source$ 0he primary data ase in this example is using an spfile (hich (ill need to e copied to a pfile so it can e modified and used y the stand y data ase$ <hen configuring the stand y data ase later in this guide, & (ill e con,erting the modified stand y pfile ac1 to an spfile$ /rom the primary data ase, create a pfile in the staging directoryB

SQL> create p!ile"3 u-* oracle dg_staging initturloc06ora3 !rom sp!ile; $ile created+

*ext, modify the necessary parameters in the ne( pfile to allo( the data ase to operate in the stand y role$ %ll modified parameters are indicated in redB

B @@@9 Memor- Farameters < @@@ B turlocJ+__db_cache_si4eK16017177* turlocJ+__Iava_>ool_si4eK/7555)/7 turlocJ+__large_>ool_si4eK/7555)/7 turlocJ+__shared_>ool_si4eK)20)/)75) turlocJ+__streams_>ool_si4eK6 B @@@9 Dum> Destination Farameters < @@@ B audit_8ile_destKLHu6/Ha>>HoracleHadminHturlocJHadum>L bacJground_dum>_destKLHu6/Ha>>HoracleHadminHturlocJHbdum>L core_dum>_destKLHu6/Ha>>HoracleHadminHturlocJHcdum>L user_dum>_destKLHu6/Ha>>HoracleHadminHturlocJHudum>L B @@@9 Role@inde>endent Farameters < @@@ B archive_lag_targetK166 com>atibleKL/6+)+6+0+6L control_8ilesKLHu6)HoradataH&URL! NHcontrol8ileHo/_m8_7hc7stn1_+ctlLM LHu6(H8lash_recover-_areaH&URL! NHcontrol8ileHo/_m8_7hc7st--_+ctlL db_nameKLmodestoL db_domainKLidevelo>ment+in8oL db_create_8ile_destKLHu6)HoradataL db_recover-_8ile_destKLHu6(H8lash_recover-_areaL dis>atchersKLAFR!&! !LK& FD ASER"% EKturlocJ?DBDL instance_nameKLturlocJL log_archive_con8igKLdg_con8igKAmodestoMturlocJDL log_archive_ma3_>rocessesK* remote_login_>ass,ord8ileKLe3clusiveL B @@@9 Frimar- Role Farameters < @@@ B db_uni'ue_nameKLturlocJL log_archive_dest_/KLlocationKuse_db_recover-_8ile_dest valid_8orKAall_log8ilesMall_rolesD db_uni'ue_nameKturlocJL log_archive_dest_)KLserviceKmodesto+idevelo>ment+in8o valid_8orKAonline_log8ilesM>rimar-_roleD db_uni'ue_nameKmodestoL log_archive_dest_state_/KLenableL log_archive_dest_state_)KLenableL service_namesKLturlocJ+idevelo>ment+in8oM turlocJL B @@@9 Standb- Role Farameters < @@@ B db_8ile_name_convertKLHM!DES&!HLMLH&URL! NHL log_8ile_name_convertKLHM!DES&!HLMLH&URL! NHL 8al_serverKLmodestoLMLturlocJL 8al_clientKLturlocJL standb-_8ile_managementKLautoL

2$ Trans!er *iles to t,e Standby Host >sing an 'S remote copy utility, transfer the ac1up of the primary data ase, stand y controlfile, and stand y initiali5ation parameter file to the stand y host (vmlinu3)!B

9oracle:vmlinu3/ ;<= scp 6blv)s>a_/_/ 6clv)s>d_/_/ 6dlv)s'g_/_/ 6elv)s'I_/_/ 68lv)ss*_/_/ initturlocJ+ora

u-* oracle dg_staging 7 vmlinu&89 u-* oracle dg_staging /66O /)*NB /)*+6NBHs 66P66 /66O 77*MB 1+/MBHs 6/P/( /66O 51(7NB 5+2MBHs 66P6/ /66O (65) (+6NBHs 66P66 /66O 516*NB 5+5MBHs 66P6/ /66O /560 /+5NBHs 66P66

Con!i"ure Oracle #et Components


'racle Data Guard depends on 'racle *et as the transport mechanism to propagate changes made on the primary data ase to the stand y$ 0he 'racle *et listener and 'racle *et aliases must e configured on oth the primary and stand y host in order to facilitate Data Guard:s communication re8uirements$ /rom a high le,el, the follo(ing 'racle *et components need to e configuredB

%n 'racle *et listener running on the primary host %n 'racle *et listener running on the stand y host %n 'racle *et alias on the primary that points to the stand y data ase %n 'racle *et alias on the stand y that points to the primary data ase

Oracle #et -istener


%lthough not mandatory, create a named static listener entry in the listener+ora file for each data ase in the Data Guard configurationB

Primary Host

S%D_L%S&_L%S&ENER K AS%D_L%S& K AS%D_DES K AS%D_NAME K FLSE3tFrocD A!RA LE_G!ME K Hu6/Ha>>HoracleH>roductH/6+)+6Hdb_/D AFR!.RAM K e3t>rocD D AS%D_DES K A.L!BAL_DBNAME K M!DES&!+%DE"EL!FMEN&+%N$!D AS%D_NAME K modestoD A!RA LE_G!ME K Hu6/Ha>>HoracleH>roductH/6+)+6Hdb_/D D D %NB!UND_ !NNE &_&%ME!U&_L%S&ENER K 6 L%S&ENER K ADES R%F&%!N_L%S& K ADES R%F&%!N K AADDRESS K AFR!&! !L K & FDAG!S& K vmlinu3/+idevelo>ment+in8oDAF!R& K /0)/DD AADDRESS K AFR!&! !L K %F DANE# K E?&FR! 6DD D D

Standby Host

S%D_L%S&_L%S&ENER K AS%D_L%S& K AS%D_DES K AS%D_NAME K FLSE3tFrocD A!RA LE_G!ME K Hu6/Ha>>HoracleH>roductH/6+)+6Hdb_/D AFR!.RAM K e3t>rocD D AS%D_DES K A.L!BAL_DBNAME K &URL! N+%DE"EL!FMEN&+%N$!D AS%D_NAME K turlocJD A!RA LE_G!ME K Hu6/Ha>>HoracleH>roductH/6+)+6Hdb_/D D D %NB!UND_ !NNE &_&%ME!U&_L%S&ENER K 6 L%S&ENER K ADES R%F&%!N_L%S& K ADES R%F&%!N K AADDRESS K AFR!&! !L K & FDAG!S& K vmlinu3)+idevelo>ment+in8oDAF!R& K /0)/DD AADDRESS K AFR!&! !L K %F DANE# K E?&FR! 6DD D D

Restart Oracle #et -istener Ser)ice


%fter ma1ing changes to the listener+ora, restart the 'racle *et listener ser,ice on the primary and stand y hostB

9oracle:vmlinu3/ ;<= lsnrctl reload 9oracle:vmlinu3) ;<= lsnrctl reload

4eri!y Oracle #et -istener Ser)ices

9oracle:vmlinu3/ ;<= lsnrctl services : grep 3;$ervice3 Services Summar-+++ Service QM!DES&!+%DE"EL!FMEN&+%N$!Q has ) instanceAsD+ Service QFLSE3tFrocQ has / instanceAsD+ Service Qmodesto?DB+idevelo>ment+in8oQ has / instanceAsD+ Service Qmodesto_?F&+idevelo>ment+in8oQ has / instanceAsD+ 9oracle:vmlinu3) ;<= lsnrctl services : grep 3;$ervice3 Services Summar-+++ Service QFLSE3tFrocQ has / instanceAsD+ Service Q&URL! N+%DE"EL!FMEN&+%N$!Q has / instanceAsD+

Oracle #et (liases


0he primary and stand y host should contain an 'racle *et alias in the tnsnames+ora file for all primary and stand y net ser,ice namesB

M!DES&!+%DE"EL!FMEN&+%N$! K ADES R%F&%!N K AADDRESS K AFR!&! !L K & FDAG!S& K vmlinu3/+idevelo>ment+in8oDAF!R& K /0)/DD A !NNE &_DA&A K ASER"ER K DED% A&EDD ASER"% E_NAME K modesto+idevelo>ment+in8oD D D &URL! N+%DE"EL!FMEN&+%N$! K ADES R%F&%!N K AADDRESS K AFR!&! !L K & FDAG!S& K vmlinu3)+idevelo>ment+in8oDAF!R& K /0)/DD A !NNE &_DA&A K ASER"ER K DED% A&EDD ASER"% E_NAME K turlocJ+idevelo>ment+in8oD D D

*ote that each of the 'racle *et alias entries a o,e contain the domain %DE"EL!FMEN&+%N$!$ &n my 'racle net(or1 configuration, & defined the default domain in the s'lnet+ora file on e,ery host (hich pro,ides name resolution for 'racle *et clients$ <hen this parameter is set, the default domain name is automatically appended to any un8ualified net ser,ice name or aliasB

NAMES+DE$AUL&_D!MA%N K %DE"EL!FMEN&+%N$!

Con!i"ure t,e Standby Database


0his section contains the steps used to create, mount, and start +edo %pply ser,ices for the physical stand y data ase$ 1$ Create t,e Standby Password *ile %s part of the ne( redo transport security and authentication features, it is no( mandatory that each data ase in an 'racle Data Guard configuration utili5e a pass(ord file$ &n addition, the SIS pass(ord must e identical on e,ery data ase in order for redo transport to function$ Create the pass(ord file on the stand y data ase using the follo(ing stepsB

9oracle:vmlinu3) ;<= cd $ORACLE_HOME dbs 9oracle:vmlinu3) dbs<= orapwd !ile"orapwturloc0 password"M#$#s%assword

7$ Create an sp!ile !or t,e Standby Instance

>sing the prepared stand y initiali5ation parameter file created and copied from the primary host, con,ert the pfile to an spfile y entering the follo(ing command on the stand y instanceB

9oracle:vmlinu3) ;<= s<lplus

as s#sdba

SQLEFlusP Release /6+)+6+0+6 @ Froduction on &ue Dec 5 ))P/*P6) )6/6 o>-right AcD /12)M )6/6M !racle+ onnected to an idle instance+ SQL> create sp!ile !rom p!ile"3 u-* oracle dg_staging initturloc06ora3; $ile created+ SQL> =ls 1l $ORACLE_HOME dbs total /) @r,@r@@@@@ / oracle oinstall /0(7 Dec @r,@r@@@@@ / oracle oinstall *762 Dec All Rights Reserved+

2 ))P)6 ora>,turlocJ 2 ))P)6 s>8ileturlocJ+ora

0he a o,e command assumes that the stand y initiali5ation parameter file copied from the primary host is located in the staging directory Hu6*HoracleHdg_staging$ F$ Create and Start t,e Standby Instance Start y creating the Mdump directoriesM on the stand y host as referenced in the stand y initiali5ation parameter fileB

9oracle:vmlinu3) 9oracle:vmlinu3) 9oracle:vmlinu3) 9oracle:vmlinu3) 9oracle:vmlinu3) 9oracle:vmlinu3) 9oracle:vmlinu3)

;<= ;<= ;<= ;<= ;<= ;<= ;<=

m0dir m0dir m0dir m0dir m0dir m0dir m0dir

1p 1p 1p 1p 1p 1p 1p

u-) u-) u-) u-) u-) u-) u-)

app app app app app app app

oracle oracle oracle oracle oracle oracle oracle

admin admin admin admin admin admin admin

turloc0 turloc0 turloc0 turloc0 turloc0 turloc0 turloc0

adump bdump cdump dpdump p!ile scripts udump

*ext, create and ,erify all directories on the stand y host that (ill e used for data ase files and the /lash +eco,ery %reaB

9oracle:vmlinu3) ;<= m0dir 1p 9oracle:vmlinu3) ;<= m0dir 1p 9oracle:vmlinu3) ;<= m0dir 1p 9oracle:vmlinu3) 9oracle:vmlinu3) 9oracle:vmlinu3) 9oracle:vmlinu3) 9oracle:vmlinu3) ;<= ;<= ;<= ;<= ;<= m0dir m0dir m0dir m0dir m0dir 1p 1p 1p 1p 1p

u-8 oradata >5RLOC? control!ile u-8 oradata >5RLOC? data!ile u-8 oradata >5RLOC? onlinelog u-@ u-@ u-@ u-@ u-@ !lash_recover#_area !lash_recover#_area !lash_recover#_area !lash_recover#_area !lash_recover#_area >5RLOC? >5RLOC? >5RLOC? >5RLOC? >5RLOC? archivelog autobac0up bac0upset control!ile onlinelog

%fter ,erifying the appropriate en,ironment ,aria les are set on the stand y host (=!RA LE_S%D, =!RA LE_G!ME, =FA&G, =LD_L%BRAR#_FA&G!, start the physical stand y instanceB

9oracle:vmlinu3) ;<= echo $ORACLE_$AB turlocJ 9oracle:vmlinu3) ;<= s<lplus as s#sdba

SQLEFlusP Release /6+)+6+0+6 @ Froduction on &ue Dec 5 ))P(0P(* )6/6 o>-right AcD /12)M )6/6M !racle+ onnected to an idle instance+ SQL> startup nomount !RA LE instance started+ &otal S-stem .lobal Area /)*/0/(12* b-tes $i3ed Si4e /)5(*)6 b-tes "ariable Si4e (/25750*6 b-tes Database Bu88ers 16017177* b-tes Redo Bu88ers /006((76 b-tes All Rights Reserved+

J$ Create t,e P,ysical Standby Database /rom the stand y host (here the stand y instance (as 6ust started, duplicate the primary data ase as a stand y using +4%*B

9oracle:vmlinu3) ;<= rman target s#s M#$#s%assword2modesto au&iliar# s#s M#$#s%assword2turloc0 Recover- ManagerP Release /6+)+6+0+6 @ Froduction on &ue Dec 5 ))P0/P)) )6/6 o>-right AcD /12)M )665M !racle+ All rights reserved+

connected to target databaseP M!DES&! ADB%DK)6)7565)*)D connected to au3iliar- databaseP M!DES&! Anot mountedD RMAN> duplicate target database !or standb#; Starting Du>licate Db at 62@DE @)6/6 ))P)*P0) using target database control 8ile instead o8 recover- catalog allocated channelP !RA_AU?_D%SN_/ channel !RA_AU?_D%SN_/P sidK/07 devt->eKD%SN contents o8 Memor- Scri>tP R restore clone standb- control8ileS s'l clone Lalter database mount standb- databaseLS T e3ecuting Memor- Scri>t Starting restore at 62@DE @)6/6 ))P)*P0( using channel !RA_AU?_D%SN_/ channel !RA_AU?_D%SN_/P starting data8ile bacJu>set restore channel !RA_AU?_D%SN_/P restoring control 8ile channel !RA_AU?_D%SN_/P reading 8rom bacJu> >iece Hu6*HoracleHdg_stagingH68lv)ss*_/_/ channel !RA_AU?_D%SN_/P restored bacJu> >iece / >iece handleKHu6*HoracleHdg_stagingH68lv)ss*_/_/ tagK&A.)6/6/)62&))66(7 channel !RA_AU?_D%SN_/P restore com>leteM ela>sed timeP 66P66P6/ out>ut 8ilenameKHu6)HoradataH&URL! NHcontrol8ileHo/_m8_7I6m60vI_+ctl out>ut 8ilenameKHu6(H8lash_recover-_areaH&URL! NHcontrol8ileHo/_m8_7I6m672b_+ctl $inished restore at 62@DE @)6/6 ))P)*P0* s'l statementP alter database mount standb- database contents o8 Memor- Scri>tP R set ne,name 8or tem>8ile / to QHu6)HoradataH&URL! NHdata8ileHo/_m8_tem>_7hc7v(Id_+tm>QS s,itch clone tem>8ile allS set ne,name 8or data8ile / to QHu6)HoradataH&URL! NHdata8ileHo/_m8_s-stem_7hc7t7l6_+db8QS set ne,name 8or data8ile ) to QHu6)HoradataH&URL! NHdata8ileHo/_m8_undotbs/_7hc7trl6_+db8QS set ne,name 8or data8ile ( to QHu6)HoradataH&URL! NHdata8ileHo/_m8_s-sau3_7hc7t-vd_+db8QS set ne,name 8or data8ile * to QHu6)HoradataH&URL! NHdata8ileHo/_m8_e3am>le_7hc7v851_+db8QS set ne,name 8or data8ile 0 to QHu6)HoradataH&URL! NHdata8ileHo/_m8_users_7hc7vl86_+db8QS restore checJ readonlclone database S T e3ecuting Memor- Scri>t e3ecuting commandP SE& NEUNAME

0he +4%* duplicate process a o,e (ill read the ac1upset that (as transferred to the staging directory, clone the stand y controlfile, mount the data ase on the ne( stand y controlfile, and restore the physical data ase files$ D$ Start Redo (pply on t,e Standby Database *o( that the stand y is in place, start +edo %pply on the stand y data ase y putting it in managed reco,ery mode$ 0his instructs the stand y data ase to egin applying changes from archi,ed redo logs transferred from the primary data aseB

SQL> alter database recover managed standb# database disconnect; Database altered+

0o use Real Time Apply, run the follo(ing alternate ,ersion of the alter database command to place the stand y data ase in managed reco,ery modeB
SQL> alter database recover managed standb# database using current log!ile disconnect; Database altered+

Start Remote (rc,i)in"


<ith the stand y data ase no( in managed reco,ery mode, the next and final phase is to start shipping redo data to the stand y from the primary$ Earlier (ithin this guide in the section MConfigure the Primary Data ase &nitiali5ation ParametersM, & mentioned that it is good practice to initially set the log_archive_dest_state_) initiali5ation parameter to DE/E+ on the primary until the stand y data ase (as created, mounted, and placed in managed reco,ery mode$ 0his is the destination defined that (ill transfer redo data to the stand y data ase$ /rom the primary data ase, ena le S?. 0ransport Ser,ices y issuing the follo(ing statementB

SQL> alter s#stem set log_archive_dest_state_8"enable scope"both; S-stem altered+

<ith the protection mode used in this guide (maximum performance!, archi,ing of redo data to the remote stand y does not occur until after a log s(itch$ 3y default, a log s(itch occurs (hen an online redo log ecomes full (hich means the stand y data ase does not get updated until then$ 0o force the current redo logs to e archi,ed immediately, use the follo(ing statement on the primary data aseB

SQL> alter s#stem archive log current; S-stem altered+

%t this point, the stand y data ase (ill continue to apply changes from archi,e redo logs eing transferred from the primary$

4eri!yin" t,e P,ysical Standby Database


<ith the stand y and primary data ases no( in operation, the next step is to ,erify the Data Guard configuration$ 0his (ill ensure that +edo 0ransport on the primary and +edo %pply on the physical stand y are (or1ing correctly$ Gi,en this Data Guard configuration is running in maximum performance mode, the ,alidation tas1s (ill in,ol,e s(itching redo log files from the primary and ,erifying those log files are eing shipped and applied to the physical stand y data ase$

Redo Transport
/rom the primary data ase, perform a log s(itch and then ,erify the transmissions of the archi,e redo log file (as successfulB

SQL> alter s#stem switch log!ile; S-stem altered+ SQL> select status( error !rom v$archive_dest where dest_id " 8; S&A&US ERR!R @@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ "AL%D

&f the transmission (as successful, the status of the destination (ill e -%.&D as sho(n a o,e$ &f for any reason the transmission (as unsuccessful, the status (ill e &*-%.&D and the full text of the error message (ill e populated in the ERR!R column (hich can e used to in,estigate and correct the issue$

Redo (pply
0o ,erify +edo %pply, identify the existing archi,ed redo logs on the stand y, archi,e a log or t(o from the primary, and then chec1 the stand y data ase again$ 0his test (ill ensure that redo data (as shipped from the primary and then successfully recei,ed, archi,ed, and applied to the stand y$ /irst, identify the existing archi,ed redo redo logs on the stand y data aseB
9oracle:vmlinu3) ;<= s<lplus s#s M#$#s%assword2turloc0 as s#sdba SQL> alter session set nls_date_!ormat " 3BB1MOC1DDDD HH8*9MA9$$3; Session altered+

SQL> select se<uence'( !irst_time( ne&t_time( archived( applied !rom v$archived_log order b# se<uence'; SEQUEN EB @@@@@@@@@@ ()6 ()/ ()) ()( ()* ()0 ()7 ()5 ()2 $%RS&_&%ME @@@@@@@@@@@@@@@@@@@@ /6@DE @)6/6 62P(*P67 /6@DE @)6/6 62P*1P(1 /6@DE @)6/6 61P60P/0 /6@DE @)6/6 61P)6P*2 /6@DE @)6/6 61P(7P)6 /6@DE @)6/6 61P0/P0) /6@DE @)6/6 /6P65P)5 /6@DE @)6/6 /6P/*P)( /6@DE @)6/6 /6P/*P*1 NE?&_&%ME @@@@@@@@@@@@@@@@@@@@ /6@DE @)6/6 62P*1P(1 /6@DE @)6/6 61P60P/0 /6@DE @)6/6 61P)6P*2 /6@DE @)6/6 61P(7P)6 /6@DE @)6/6 61P0/P0) /6@DE @)6/6 /6P65P)5 /6@DE @)6/6 /6P/*P)( /6@DE @)6/6 /6P/*P*1 /6@DE @)6/6 /6P(6P)( AR G%"ED @@@@@@@@ #ES #ES #ES #ES #ES #ES #ES #ES #ES AFFL%ED @@@@@@@ #ES #ES #ES #ES #ES #ES #ES #ES #ES

/rom the primary data ase, archi,e the current log using the follo(ing S?. statementB

SQL> alter s#stem archive log current; S-stem altered+

Go ac1 to the stand y data ase and re-8uery the "=AR G%"ED_L!. ,ie( to ,erify redo data (as shipped, recei,ed, archi,ed, and appliedB

SQL> select se<uence'( !irst_time( ne&t_time( archived( applied !rom v$archived_log order b# se<uence'; SEQUEN EB @@@@@@@@@@ ()6 ()/ ()) ()( ()* ()0 ()7 ()5 ()2 ()1 $%RS&_&%ME @@@@@@@@@@@@@@@@@@@@ /6@DE @)6/6 62P(*P67 /6@DE @)6/6 62P*1P(1 /6@DE @)6/6 61P60P/0 /6@DE @)6/6 61P)6P*2 /6@DE @)6/6 61P(7P)6 /6@DE @)6/6 61P0/P0) /6@DE @)6/6 /6P65P)5 /6@DE @)6/6 /6P/*P)( /6@DE @)6/6 /6P/*P*1 /6@DE @)6/6 /6P(6P)( NE?&_&%ME @@@@@@@@@@@@@@@@@@@@ /6@DE @)6/6 62P*1P(1 /6@DE @)6/6 61P60P/0 /6@DE @)6/6 61P)6P*2 /6@DE @)6/6 61P(7P)6 /6@DE @)6/6 61P0/P0) /6@DE @)6/6 /6P65P)5 /6@DE @)6/6 /6P/*P)( /6@DE @)6/6 /6P/*P*1 /6@DE @)6/6 /6P(6P)( /6@DE @)6/6 /6P(1P07 AR G%"ED @@@@@@@@ #ES #ES #ES #ES #ES #ES #ES #ES #ES #ES AFFL%ED @@@@@@@ #ES #ES #ES #ES #ES #ES #ES #ES #ES #ES

Monitorin" t,e alert5lo" o! t,e Standby Database


?uerying the "=AR G%"ED_L!. ,ie( from the stand y data ase is a good (ay to ensure +edo 0ransport and +edo %pply is doing their 6o correctly$ &n addition, & also li1e to tail the alert+log file of the stand y data ase as a dou le chec1$

/rom the stand y data ase, perform a tail @8 against the alert+log (hile issuing the Malter s-stem archive log currentM statement from the primaryB

9oracle:vmlinu3) ;<= cd

u-) app oracle admin turloc0 bdump

9oracle:vmlinu3) bdum><= tail 1! alert_turloc06log R$S9)<P Success8ull- o>ened standb- log 0P LHu6)HoradataH&URL! NHonlinelogHo/_m8_0_7I6ml5n,_+logL $ri Dec /6 /6P/*P0/ ES& )6/6 Media Recover- Log Hu6(H8lash_recover-_areaH&URL! NHarchivelogH)6/6_/)_/6Ho/_m8_/_()7_7I*I4b>c_+arc Media Recover- Log Hu6(H8lash_recover-_areaH&URL! NHarchivelogH)6/6_/)_/6Ho/_m8_/_()5_7I*I4cbm_+arc Media Recover- Uaiting 8or thread / se'uence ()2 $ri Dec /6 /6P(6P)* ES& )6/6 R$S9/<P Success8ull- o>ened standb- log *P LHu6)HoradataH&URL! NHonlinelogHo/_m8_*_7I6mJ-nJ_+logL $ri Dec /6 /6P(6P)7 ES& )6/6 Media Recover- Log Hu6(H8lash_recover-_areaH&URL! NHarchivelogH)6/6_/)_/6Ho/_m8_/_()2_7I*J,Ib0_+arc Media Recover- Uaiting 8or thread / se'uence ()1 $ri Dec /6 /6P(1P05 ES& )6/6 R$S9)<P Success8ull- o>ened standb- log *P LHu6)HoradataH&URL! NHonlinelogHo/_m8_*_7I6mJ-nJ_+logL $ri Dec /6 /6P(1P02 ES& )6/6 Media Recover- Log Hu6(H8lash_recover-_areaH&URL! NHarchivelogH)6/6_/)_/6Ho/_m8_/_()1_7I*lg8sr_+arc Media Recover- Uaiting 8or thread / se'uence ((6

Deletion Policy !or (rc,i)ed Redo -o" *iles In *las, Reco)ery (rea
3y default, archi,ed redo log files in a flash reco,ery area that (ere ac1ed up to a tertiary de,ice or made o solete (as defined y the +4%* retention policy! are eligi le for deletion$ 0he archi,ed redo log files that are ac1ed up or o solete can e,entually e deleted automatically to ma1e space if the dis1 space in the flash reco,ery area ecomes full$ #o(e,er, you can change this default deletion policy on either the primary or stand y data ase using the follo(ing +4%* command$

!N$%.URE AR G%"EL!. DELE&%!N F!L% # &! 9 LEAR V N!NE V AFFL%ED !N S&ANDB#<S

0his section descri es the command 8ualifiers and pro,ides examples for setting up a deletion policy for archi,ed redo log files (hich are already applied on stand y data ase in 'racle Data ase 10g and a o,e$

'sin" t,e (PP-IED O# ST(#D26 Clause

>se the AFFL%ED !N S&ANDB# clause so that archi,ed redo log files that ha,e een applied on all mandatory stand y destinations (ill e deleted$ 0he actions ta1en (hen you specify this clause are descri ed in the follo(ing ta le$ %PP.&ED '* S0%*D3I Clause 7,en t,e A%%LAEB OC $>ACBED clause is con!i"ured on 555 0he primary data ase % stand y data ase that has one or more mandatory cascading stand y data ases$ % stand y data ase that has no cascading stand y data ases$ T,en8 t,ese !iles are eli"ible !or deletion 555 %rchi,ed redo log files in the flash reco,ery area that (ere applied on all mandatory stand y data ases$ %rchi,ed redo log files in the flash reco,ery area that (ere applied on all mandatory cascading stand y data ases$ %rchi,ed redo log files in the flash reco,ery area that (ere applied on the stand y data ase$

'sin" t,e C-E(R Clause


>se the LEAR clause to disa le the deletion policy that (as pre,iously set up (ith the +4%* !N$%.URE AR G%"EL!. DELE&%!N F!L% # command$ 0he 'racle data ase (ill resume the default deletion policy eha,ior, (hich is to delete archi,ed redo log files that are ac1ed up or o solete to ma1e space if dis1 space in the flash reco,ery area ecomes full$

'sin" t,e #O#E Clause


>se the N!NE clause so that archi,ed redo logs in flash reco,ery area that (ere ac1ed up or o solete as per the +4%* retention policy are eligi le for deletion$ 0his is the default configuration$ %rchi,ed redo log files that are ac1ed up or o solete are deleted to ma1e space if the dis1 space in the flash reco,ery area ecomes full$

'sin" t,e CO#*IG'RE (RCHI4E-OG DE-ETIO# PO-IC6 Command


%s descri ed in the a o,e ta le, the AFFL%ED !N S&ANDB# setting can e configured on oth the primary and stand y data ase$ &n most cases, the AFFL%ED !N S&ANDB# setting should not e set on the data ase that is performing and maintaining +4%* ac1ups for the purpose of reco,ery$ /or example$ <hen ac1ups of archi,ed redo log files are ta1en on the primary data aseB 1$ &ssue the follo(ing command on the stand y data aseB
!N$%.URE AR G%"EL!. DELE&%!N F!L% # &! AFFL%ED !N S&ANDB#S

7$ &ssue the follo(ing command on the primary data aseB

!N$%.URE AR G%"EL!. DELE&%!N F!L% # &! N!NES

<hen ac1ups of archi,ed redo log files are ta1en on the stand y data aseB 1$ &ssue the follo(ing command on the primary data aseB

!N$%.URE AR G%"EL!. DELE&%!N F!L% # &! AFFL%ED !N S&ANDB#S

7$ &ssue the follo(ing command on the stand y data aseB

!N$%.URE AR G%"EL!. DELE&%!N F!L% # &! N!NES

Post+Creation Steps
%t this point, the physical stand y data ase is running and can pro,ide the maximum performance le,el of data protection (the default!$ 0he follo(ing list descri es additional preparations you can ta1e on the physical stand y data aseB

'p"rade t,e data protection mode 0he Data Guard configuration is initially set up in the maximum performance mode (the default!$ See MSetting the Data Protection 4ode of a Data Guard ConfigurationM for information a out the data protection modes and ho( to upgrade or do(ngrade the current protection mode$

Enable *las,bac3 Database /lash ac1 Data ase remo,es the need to re-create the primary data ase after a failo,er$ /lash ac1 Data ase ena les you to return a data ase to its state at a time in the recent past much faster than traditional point-in-time reco,ery, ecause it does not re8uire restoring datafiles from ac1up nor the extensi,e application of redo data$ Iou can ena le /lash ac1 Data ase on the primary data ase, the stand y data ase, or oth$ See M>sing /lash ac1 Data ase %fter a /ailo,erM and M>sing /lash ac1 Data ase %fter &ssuing an 'pen +esetlogs StatementM for scenarios sho(ing ho( to use /lash ac1 Data ase in a Data Guard en,ironment$ %lso, see 'racle Data ase 3ac1up and +eco,ery %d,anced >ser:s Guide for more information a out /lash ac1 Data ase$

(cti)atin" a P,ysical Standby Database $Role Transition&


% data ase can operate in one of t(o mutually exclusi,e modes in an 'racle Data Guard configurationB primary or standby$ <hene,er the role is changed et(een the primary and stand y, this is referred to as a role transition$ +ole transition plays an important part in Data Guard y pro,iding an interface that allo(s D3%:s to acti,ate a stand y data ase to ta1e o,er as the primary production data ase or ,ice ,ersa$ 0here are t(o types of role transitions supported in 'racle 10g Data GuardB switchover and failover$ Nno(ing the difference et(een the t(o role transition methods is crucial$ Clic1 here for a guide on ho( to perform role transitions and acti,ating a physical stand y data ase$

*urt,er Readin"
%dditional information on 'racle 10g +elease 7 Data Guard can e found in the Data uard !oncepts and Administration$ 0his guide is a,aila le from the 'racle Documentation .i rary (e site located at the follo(ing address httpB))do(nload$oracle$com)docs)cd)312F0EG01)ser,er$107) 1J7F2$pdf$

(bout t,e (ut,or


"effrey #unter is an 'racle Certified Professional, "a,a De,elopment Certified Professional, %uthor, and an 'racle %CE$ "eff currently (or1s as a Senior Data ase %dministrator for 0he D3% Oone, &nc$ located in Pitts urgh, Pennsyl,ania$ #is (or1 includes ad,anced performance tuning, "a,a and P.)S?. programming, de,eloping high a,aila ility solutions, capacity planning, data ase security, and physical ) logical data ase design in a >*&P, .inux, and <indo(s ser,er en,ironment$ "eff:s other interests include mathematical encryption theory, programming language processors (compilers and interpreters! in "a,a and C, .D%P, (riting (e - ased data ase administration tools, and of course .inux$ #e has een a Sr$ Data ase %dministrator and Soft(are Engineer for o,er 1; years and maintains his o(n (e site site atB httpB))((($iDe,elopment$info$ "eff graduated from Stanislaus State >ni,ersity in 0urloc1, California, (ith a 3achelor:s degree in Computer Science$

You might also like