Data Guard Configuration(2)
Transcript of Data Guard Configuration(2)
-
8/13/2019 Data Guard Configuration(2)
1/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 ransition! /urther +eading % out the %uthor
Introduction'racle Data Guard ( no n as 'racle Stand y Data ase prior to 'racle2 i!, forms an extension to the 'racle+D34S and pro ides organi5ations ith high a aila ility, data protection, and disaster reco ery for enterprisedata ases$ 'racle Data Guard pro ides the D3% ith ser ices for creating, maintaining, managing, andmonitoring one or more stand y data ases$ he functionality included ith 'racle Data Guard ena lesenterprise data systems to sur i e oth data corruption as ell as ma6or disasters$
his article pro ides instructions for creating and configuring a physical stand y data ase from a primarydata ase using 'racle Data ase 10 g +elease 7 (10$7! operating in maximum performance protection mode$ &tshould e noted that se eral different methods exist to create a physical stand y data ase configuration andthat this is 6ust one of those ays$ he methods outlined in this guide present a simple approach that should eeasy to implement in most situations$ &n fact, if you rea do n the essential tas s re8uired to uild a physicalstand y data ase, you ill see that it is essentially nothing more than ta ing a ac up of the primary data ase,creating a stand y controlfile, transferring the files to the stand y host, mounting the stand y data ase, puttingthe stand y data ase in managed reco ery mode (+edo %pply!, and starting remote archi ing from the primarydata ase (+edo ransport!$ ' iously there are a num er of smaller steps & am lea ing out hich ill all ediscussed in more depth throughout this guide$
%ll configuration parameters related to the 'racle instance and net or ing ill e discussed as ell as ho to place the stand y data ase in Managed Recovery Mode $
Introduction to Oracle Data Guardhe stand y data ase feature of 'racle as first introduced ith the release of 'racle 9 in the early 1220:s$he 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 ta e for granted as present in this release of the product$ D3%:sere re8uired to rite custom scripts that shipped and applied archi e logs to the remote stand y data ase$ &t
http://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Introductionhttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Introduction%20to%20Oracle%20Data%20Guardhttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Hardware%20and%20O/S%20Configurationhttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Configure%20the%20Primary%20Databasehttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Configure%20Oracle%20Net%20Componentshttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Configure%20the%20Standby%20Databasehttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Start%20Remote%20Archivinghttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Verifying%20the%20Physical%20Standby%20Databasehttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Deletion%20Policy%20for%20Archived%20Redo%20Log%20Files%20In%20Flash%20Recovery%20Areahttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Post-Creation%20Stepshttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Activating%20a%20Physical%20Standby%20Database%20(Role%20Transition)http://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Further%20Readinghttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#About%20the%20Authorhttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Introductionhttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Introduction%20to%20Oracle%20Data%20Guardhttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Hardware%20and%20O/S%20Configurationhttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Configure%20the%20Primary%20Databasehttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Configure%20Oracle%20Net%20Componentshttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Configure%20the%20Standby%20Databasehttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Start%20Remote%20Archivinghttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Verifying%20the%20Physical%20Standby%20Databasehttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Deletion%20Policy%20for%20Archived%20Redo%20Log%20Files%20In%20Flash%20Recovery%20Areahttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Post-Creation%20Stepshttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Activating%20a%20Physical%20Standby%20Database%20(Role%20Transition)http://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Further%20Readinghttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#About%20the%20Author -
8/13/2019 Data Guard Configuration(2)
2/25
asn:t until 'racle; i here some form of automation as introduced that relied on 'racle *et Ser ices totransfer 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$ %lsoincluded in 'racle; i as a set of pre- ritten scripts that simplified the s itcho er and failo er process$
ntil 'racle2 i +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, loc -for- loc copy of the primary data ase and is ept in sync
ith the primary using media reco ery (also referred to as +edo %pply!$ 'racle introduced a ne type ofstand y data ase ith 'racle2 i +elease 7 named Logical Standby Database $ his ne type of stand ydata ase eeps in sync ith the primary data ase using S?. %pply ( ersus +edo %pply used ith a physicalstand y data ase!$ % logical stand y data ase remains open for user access hile logical records are eingrecei ed and applied from the primary data ase hich ma es this a great candidate for a reporting data ase$
-
8/13/2019 Data Guard Configuration(2)
3/25
% logical stand y data ase or s in a different manner hich eeps in sync ith the primary y transformingredo data recei ed from the primary data ase into logical S?. statements and then executes those S?.statements against the stand y data ase$
-
8/13/2019 Data Guard Configuration(2)
4/25
Host #ame mlinux1$ide elopment$info @ (127$1 ;$1$1 0!Operatin" System +ed #at .inux @ (Cent'S $ !Database #ame $db%name& modestoDatabase Domain $db%domain& ide elopment$infoOracle SID modestoDatabase 'nique #ame $db%unique%name& modestoT#S (lias modesto$ide elopment$info
Ser)ice #ames modesto$ide elopment$info, modestoDatabase *iles + $db%create%!ile%dest& )u07)oradata*las, Reco)ery (rea + $db%reco)ery%!ile%dest& )u0F)flash reco ery area-ocal Online Redo -o" *iles +$lo"%arc,i)e%dest%.&
locationHuse d reco ery file dest @(all logfiles,all roles!
Remote (rc,i)e Destination +$lo"%arc,i)e%dest%/&
ser iceHturloc @ (online logfiles,primary role!
P,ysical Standby DatabaseOracle Release 'racle 10 g +elease 7 @ (10$7$0$ !Host #ame mlinux7$ide elopment$info @ (127$1 ;$1$1 7!Operatin" System +ed #at .inux @ (Cent'S $ !Database #ame $db%name& modestoDatabase Domain $db%domain& ide elopment$infoOracle SID turloc Database 'nique #ame $db%unique%name& turloc T#S (lias turloc $ide elopment$infoSer)ice #ames turloc $ide elopment$info, turloc Database *iles + $db%create%!ile%dest& )u07)oradata*las, Reco)ery (rea + $db%reco)ery%!ile%dest& )u0F)flash reco ery area-ocal Online Redo -o" *iles +$lo"%arc,i)e%dest%.&
locationHuse d reco ery file dest @(all logfiles,all roles!
Remote (rc,i)e Destination +$lo"%arc,i)e%dest%/&
ser iceHmodesto @ (online logfiles,primary role!
&t is assumed that 'racle Data ase 10 g +elease 7 and all patchsets ha e een installed on oth nodes in the'racle Data Guard configuration$ Clic here for a guide on installing 'racle Data ase 10 g +7 on the +ed #at.inux platform$
Con!i"ure t,e Primary Databasehe first phase in creating an 'racle Data Guard configuration in ol es performing the necessary tas s on the
primary data ase$
-
8/13/2019 Data Guard Configuration(2)
5/25
'racle Data Guard relies on redo from the primary data ase in order to maintain the stand y$ hisre8uires 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 listDatabase log mode No Archive ModeAutomatic archival Disabled
Archive destination USE_DB_RE !"ER#_$%LE_DES&!ldest online log se'uence ()urrent log se'uence (*
he 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 immediateDatabase 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-tesDatabase Bu88ers 16017177* b-tesRedo Bu88ers /006((76 b-tesDatabase mounted+
SQL> alter database archivelog;
Database altered+
SQL> alter database open;
Database altered+
SQL> archive log listDatabase log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RE !"ER#_$%LE_DES&!ldest online log se'uence (*Ne3t log se'uence to archive (7
urrent log se'uence (7
Prior to 'racle Data ase 10 g , it as also re8uired to set the log_archive_start initiali5ation parameter to &RUE in order to ena le automatic archi ing$ his is no longer necessary as automaticarchi ing is ena led y default hen the data ase is placed into archi elog mode ith 'racle Data ase10 g or higher$
7$ Create a Password *ile
%s part of the ne redo transport security and authentication features, it is no mandatory that eachdata ase in an 'racle Data Guard configuration utili5e a pass ord file$ &n addition, the SIS pass ord
-
8/13/2019 Data Guard Configuration(2)
6/25
must e identical on e ery data ase in order for redo transport to function$ &f a pass ord file does notexist for the primary data ase, create one using the follo ing stepsB
9oracle:vmlinu3/ ;
-
8/13/2019 Data Guard Configuration(2)
7/25
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 usingmaximum performance!, it is highly recommended to utili5e stand y redo logs as generally more datacan e reco ered during a failo er than ithout them$
-
8/13/2019 Data Guard Configuration(2)
8/25
SQL> alter database add standb# log!ile thread ) group / si+e ,-m;
Database altered+
o erify the ne stand y redo log filesB
SQL> select group'( t#pe( member !rom v$log!ile order b# group'( member;
.R!UF FE MEMBER@@@@@@@@@@ @@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ / !NL%NE Hu6)HoradataHM!DES&!HonlinelogHo/_m8_/_7IIc2hr2_+log / !NL%NE Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_/_7IIc2I3'_+log ) !NL%NE Hu6)HoradataHM!DES&!HonlinelogHo/_m8_)_7IIc2mvI_+log ) !NL%NE Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_)_7IIc2nvv_+log ( !NL%NE Hu6)HoradataHM!DES&!HonlinelogHo/_m8_(_7IIc2'r,_+log ( !NL%NE Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_(_7IIc2r-)_+log * S&ANDB# Hu6)HoradataHM!DES&!HonlinelogHo/_m8_*_7hvg('J1_+log * S&ANDB# Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_*_7hvg(rnm_+log 0 S&ANDB# Hu6)HoradataHM!DES&!HonlinelogHo/_m8_0_7hvg*28(_+log 0 S&ANDB# Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_0_7hvg*1gr_+log 7 S&ANDB# Hu6)HoradataHM!DES&!HonlinelogHo/_m8_7_7hvg*m1I_+log 7 S&ANDB# Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_7_7hvg*nb*_+log
5 S&ANDB# Hu6)HoradataHM!DES&!HonlinelogHo/_m8_5_7hvg*,(d_+log 5 S&ANDB# Hu6(H8lash_recover-_areaHM!DES&!HonlinelogHo/_m8_5_7hvg*3bl_+log
$ Con!i"ure t,e Primary Database Initiali1ation Parameters
4ost of the configuration options for Data Guard are implemented using initiali5ation parameters forthe 'racle instance$ , etc$!the initiali5ation file for oth data ases should e nearly identical$
-
8/13/2019 Data Guard Configuration(2)
9/25
mounted, and placed in managed reco ery mode$ %lso note that the db_8ile_name_convert andlog_8ile_name_convert parameters are only re8uired if the paths ill e different et een the
primary and stand y host$
@@@9 Dum Destination Farameters < @@@ audit_8ile_destK Hu6/Ha HoracleHadminHmodestoHadumbacJground_dum _destK Hu6/Ha HoracleHadminHmodestoHbdumcore_dum _destK Hu6/Ha HoracleHadminHmodestoHcdumuser_dum _destK Hu6/Ha HoracleHadminHmodestoHudum
@@@9 Role@inde endent Farameters < @@@ archive_lag_targetK166com atibleK /6+)+6+0+6control_8ilesK Hu6)HoradataHM!DES&!Hcontrol8ileHo/_m8_7hc7stn1_+ctl Hu6(H8lash_recover-_areaHM!DES&!Hcontrol8ileHo/_m8_7hc7st--_+ctldb_nameK modestodb_domainK idevelo ment+in8odb_create_8ile_destK Hu6)Horadatadb_recover-_8ile_destK Hu6(H8lash_recover-_areadis atchersK FR!&! !LK& F SER"% EKmodesto?DB
instance_nameK modestolog_archive_con8igK dg_con8igK modesto turlocJlog_archive_ma3_ rocessesK*remote_login_ ass,ord8ileK e3clusive
@@@9 Frimar- Role Farameters < @@@ db_uni'ue_nameK modestolog_archive_dest_/K locationKuse_db_recover-_8ile_destvalid_8orK all_log8iles all_roles db_uni'ue_nameKmodestolog_archive_dest_)K serviceKturlocJ+idevelo ment+in8ovalid_8orK online_log8iles rimar-_role db_uni'ue_nameKturlocJlog_archive_dest_state_/K enablelog_archive_dest_state_)K de8erservice_namesK modesto+idevelo ment+in8o modesto
@@@9 Standb- Role Farameters < @@@ db_8ile_name_convertK H&URL! H HM!DES&!Hlog_8ile_name_convertK H&URL! H HM!DES&!H8al_serverK modesto turlocJ8al_clientK modestostandb-_8ile_managementK auto
Se eral of the initiali5ation parameters listed a o e can not e dynamically modified and therefore illre8uire the primary data ase to e ouncedB
SQL> shutdown immediateDatabase 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-tesDatabase Bu88ers 16017177* b-tes
-
8/13/2019 Data Guard Configuration(2)
10/25
Redo Bu88ers /006((76 b-tesDatabase mounted+Database o ened+
$ Create a 2ac3up o! t,e Primary Database
% physical stand y data ase can e created using either a hot or cold ac up of the primary as long asall 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! ac up of the primary data ase using+4%*$ he +4%* ac upsets ill e ritten to a staging directory located outside of the /lash+eco ery %rea namely Hu6*HoracleHdg_staging $ & start y creating the staging directory on oth the
primary and stand y hostsB
9oracle:vmlinu3/ ;
-
8/13/2019 Data Guard Configuration(2)
11/25
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 yrole$ %ll modified parameters are indicated in red B
@@@9 Memor- Farameters < @@@ turlocJ+__db_cache_si4eK16017177*turlocJ+__Iava_ ool_si4eK/7555)/7turlocJ+__large_ ool_si4eK/7555)/7turlocJ+__shared_ ool_si4eK)20)/)75)turlocJ+__streams_ ool_si4eK6
@@@9 Dum Destination Farameters < @@@ audit_8ile_destK Hu6/Ha HoracleHadminHturlocJHadumbacJground_dum _destK Hu6/Ha HoracleHadminHturlocJHbdum
core_dum _destK Hu6/Ha HoracleHadminHturlocJHcdumuser_dum _destK Hu6/Ha HoracleHadminHturlocJHudum
@@@9 Role@inde endent Farameters < @@@ archive_lag_targetK166com atibleK /6+)+6+0+6control_8ilesK Hu6)HoradataH&URL! Hcontrol8ileHo/_m8_7hc7stn1_+ctl Hu6(H8lash_recover-_areaH&URL! Hcontrol8ileHo/_m8_7hc7st--_+ctldb_nameK modestodb_domainK idevelo ment+in8odb_create_8ile_destK Hu6)Horadatadb_recover-_8ile_destK Hu6(H8lash_recover-_areadis atchersK FR!&! !LK& F SER"% EKturlocJ?DBinstance_nameK turlocJlog_archive_con8igK dg_con8igK modesto turlocJlog_archive_ma3_ rocessesK*remote_login_ ass,ord8ileK e3clusive
@@@9 Frimar- Role Farameters < @@@ db_uni'ue_nameK turlocJlog_archive_dest_/K locationKuse_db_recover-_8ile_destvalid_8orK all_log8iles all_roles db_uni'ue_nameKturlocJlog_archive_dest_)K serviceKmodesto+idevelo ment+in8ovalid_8orK online_log8iles rimar-_role db_uni'ue_nameKmodestolog_archive_dest_state_/K enablelog_archive_dest_state_)K enableservice_namesK turlocJ+idevelo ment+in8o turlocJ
@@@9 Standb- Role Farameters < @@@ db_8ile_name_convertK HM!DES&!H H&URL! Hlog_8ile_name_convertK HM!DES&!H H&URL! H8al_serverK modesto turlocJ8al_clientK turlocJstandb-_8ile_managementK auto
2$ Trans!er *iles to t,e Standby Host
>sing an 'S remote copy utility, transfer the ac up of the primary data ase, stand y controlfile, andstand y initiali5ation parameter file to the stand y host ( vmlinu3) !B
-
8/13/2019 Data Guard Configuration(2)
12/25
9oracle:vmlinu3/ ;
-
8/13/2019 Data Guard Configuration(2)
13/25
S%D_L%S&_L%S&ENER K S%D_L%S& K S%D_DES K S%D_NAME K FLSE3tFroc !RA LE_G!ME K Hu6/Ha HoracleH roductH/6+)+6Hdb_/ FR!.RAM K e3t roc S%D_DES K .L!BAL_DBNAME K M!DES&!+%DE"EL!FMEN&+%N$! S%D_NAME K modesto !RA LE_G!ME K Hu6/Ha HoracleH roductH/6+)+6Hdb_/
%NB!UND_ !NNE &_&%ME!U&_L%S&ENER K 6
L%S&ENER K DES R%F&%!N_L%S& K DES R%F&%!N K ADDRESS K FR!&! !L K & F G!S& K vmlinu3/+idevelo ment+in8o F!R& K /0)/
ADDRESS K FR!&! !L K %F E# K E?&FR! 6
Standby Host
S%D_L%S&_L%S&ENER K S%D_L%S& K S%D_DES K S%D_NAME K FLSE3tFroc !RA LE_G!ME K Hu6/Ha HoracleH roductH/6+)+6Hdb_/ FR!.RAM K e3t roc S%D_DES K .L!BAL_DBNAME K &URL! +%DE"EL!FMEN&+%N$! S%D_NAME K turlocJ !RA LE_G!ME K Hu6/Ha HoracleH roductH/6+)+6Hdb_/
%NB!UND_ !NNE &_&%ME!U&_L%S&ENER K 6
L%S&ENER K DES R%F&%!N_L%S& K DES R%F&%!N K ADDRESS K FR!&! !L K & F G!S& K vmlinu3)+idevelo ment+in8o F!R& K /0)/ ADDRESS K FR!&! !L K %F E# K E?&FR! 6
-
8/13/2019 Data Guard Configuration(2)
14/25
Restart Oracle #et -istener Ser)ice
%fter ma ing changes to the listener+ora , restart the 'racle *et listener ser ice on the primary and stand yhostB
9oracle:vmlinu3/ ;
-
8/13/2019 Data Guard Configuration(2)
15/25
M!DES&!+%DE"EL!FMEN&+%N$! K DES R%F&%!N K ADDRESS K FR!&! !L K & F G!S& K vmlinu3/+idevelo ment+in8o F!R& K /0)/ !NNE &_DA&A K SER"ER K DED% A&ED
SER"% E_NAME K modesto+idevelo ment+in8o
&URL! +%DE"EL!FMEN&+%N$! K DES R%F&%!N K ADDRESS K FR!&! !L K & F G!S& K vmlinu3)+idevelo ment+in8o F!R& K /0)/ !NNE &_DA&A K SER"ER K DED% A&ED SER"% E_NAME K turlocJ+idevelo ment+in8o
*ote that each of the 'racle *et alias entries a o e contain the domain %DE"EL!FMEN&+%N$! $ &n my 'raclenet or configuration, & defined the default domain in the s'lnet+ora file on e ery host hich pro idesname resolution for 'racle *et clients$
-
8/13/2019 Data Guard Configuration(2)
16/25
>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) ;
-
8/13/2019 Data Guard Configuration(2)
17/25
%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) ;
-
8/13/2019 Data Guard Configuration(2)
18/25
9oracle:vmlinu3) ; duplicate target database !or standb#;
Starting Du licate Db at 62@DE @)6/6 ))P)*P0)using target database control 8ile instead o8 recover- catalogallocated channelP !RA_AU?_D%S _/channel !RA_AU?_D%S _/P sidK/07 devt- eKD%S
contents o8 Memor- Scri tP
restore clone standb- control8ile s'l clone alter database mount standb- databaseT
e3ecuting Memor- Scri t
Starting restore at 62@DE @)6/6 ))P)*P0(using channel !RA_AU?_D%S _/
channel !RA_AU?_D%S _/P starting data8ile bacJu set restorechannel !RA_AU?_D%S _/P restoring control 8ilechannel !RA_AU?_D%S _/P reading 8rom bacJu ieceHu6*HoracleHdg_stagingH68lv)ss*_/_/channel !RA_AU?_D%S _/P restored bacJu iece /
iece handleKHu6*HoracleHdg_stagingH68lv)ss*_/_/ tagK&A.)6/6/)62&))66(7channel !RA_AU?_D%S _/P restore com lete ela sed timeP 66P66P6/out ut 8ilenameKHu6)HoradataH&URL! Hcontrol8ileHo/_m8_7I6m60vI_+ctlout ut 8ilenameKHu6(H8lash_recover-_areaH&URL! Hcontrol8ileHo/_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
set ne,name 8or tem 8ile / to Hu6)HoradataH&URL! Hdata8ileHo/_m8_tem _7hc7v(Id_+tm s,itch clone tem 8ile all set ne,name 8or data8ile / to Hu6)HoradataH&URL! Hdata8ileHo/_m8_s-stem_7hc7t7l6_+db8 set ne,name 8or data8ile ) to Hu6)HoradataH&URL! Hdata8ileHo/_m8_undotbs/_7hc7trl6_+db8
set ne,name 8or data8ile ( to Hu6)HoradataH&URL! Hdata8ileHo/_m8_s-sau3_7hc7t-vd_+db8 set ne,name 8or data8ile * to Hu6)HoradataH&URL! Hdata8ileHo/_m8_e3am le_7hc7v851_+db8 set ne,name 8or data8ile 0 to Hu6)HoradataH&URL! Hdata8ileHo/_m8_users_7hc7vl86_+db8 restore checJ readonl- clone database Te3ecuting Memor- Scri t
e3ecuting commandP SE& NE NAME
-
8/13/2019 Data Guard Configuration(2)
19/25
he +4%* duplicate process a o e ill read the ac upset that as transferred to the stagingdirectory, clone the stand y controlfile, mount the data ase on the ne stand y controlfile, and restorethe physical data ase files$
$ 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 managedreco ery mode$ his instructs the stand y data ase to egin applying changes from archi ed redo logstransferred from the primary data aseB
SQL> alter database recover managed standb# database disconnect;
Database altered+
o 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!iledisconnect;
Database altered+
Start Remote (rc,i)in" alter s#stem set log_archive_dest_state_8"enable scope"both;
S-stem altered+
alter s#stem archive log current;
S-stem altered+
http://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Configure%20the%20Primary%20Database%20Initialization%20Parametershttp://www.idevelopment.info/data/Oracle/DBA_tips/Data_Guard/DG_40.shtml#Configure%20the%20Primary%20Database%20Initialization%20Parameters -
8/13/2019 Data Guard Configuration(2)
20/25
%t this point, the stand y data ase ill continue to apply changes from archi e redo logs eing transferredfrom the primary$
4eri!yin" t,e P,ysical Standby Database 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 anyreason 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
o 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 chec the stand y data ase again$ his 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) ;
-
8/13/2019 Data Guard Configuration(2)
21/25
SQL> select se
-
8/13/2019 Data Guard Configuration(2)
22/25
/rom the stand y data ase, perform a tail @8 against the alert+log hile issuing the M alter s-stemarchive log current M statement from the primaryB
9oracle:vmlinu3) ;
-
8/13/2019 Data Guard Configuration(2)
23/25
>se the AFFL%ED !N S&ANDB# clause so that archi ed redo log files that ha e een applied on all mandatorystand y destinations ill e deleted$ he actions ta en hen you specify this clause are descri ed in thefollo ing ta le$
%PP.&ED '* S %*D3I Clause
7,en t,e A%%L EB O >A B D clause iscon!i"ured on 555
T,en8 t,ese !iles are eli"ible !or deletion 555
he primary data ase %rchi ed redo log files in the flash reco ery area that ereapplied on all mandatory stand y data ases$
% stand y data ase that has one or moremandatory cascading stand y data ases$
%rchi ed redo log files in the flash reco ery area that ereapplied on all mandatory cascading stand y data ases$
% stand y data ase that has no cascadingstand y data ases$
%rchi ed redo log files in the flash reco ery area that ereapplied 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$%.UREAR G%"EL!. DELE&%!N F!L% # command$ he 'racle data ase ill resume the default deletion policy
eha ior, hich is to delete archi ed redo log files that are ac ed up or o solete to ma e space if dis spacein 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 ac ed up or o solete as per the+4%* retention policy are eligi le for deletion$ his is the default configuration$ %rchi ed redo log files thatare ac ed up or o solete are deleted to ma e space if the dis 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 andstand 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%* ac ups for the purpose of reco ery$ /or example$
-
8/13/2019 Data Guard Configuration(2)
24/25
!N$%.URE AR G%"EL!. DELE&%!N F!L% # &! AFFL%ED !N S&ANDB#
7$ &ssue the follo ing command on the stand y data aseB
!N$%.URE AR G%"EL!. DELE&%!N F!L% # &! N!NE
Post+Creation Steps%t this point, the physical stand y data ase is running and can pro ide the maximum performance le el ofdata protection (the default!$ he follo ing list descri es additional preparations you can ta e on the physicalstand y data aseB
'p"rade t,e data protection mode
he Data Guard configuration is initially set up in the maximum performance mode (the default!$ SeeMSetting the Data Protection 4ode of a Data Guard Configuration M for information a out the data
protection modes and ho to upgrade or do ngrade the current protection mode$
Enable *las,bac3 Database
/lash ac Data ase remo es the need to re-create the primary data ase after a failo er$ /lash acData ase ena les you to return a data ase to its state at a time in the recent past much faster thantraditional point-in-time reco ery, ecause it does not re8uire restoring datafiles from ac up nor theextensi e application of redo data$ Iou can ena le /lash ac Data ase on the primary data ase, thestand y data ase, or oth$ See M >sing /lash ac Data ase %fter a /ailo er M and M>sing /lash acData ase %fter &ssuing an 'pen +esetlogs Statement M for scenarios sho ing ho to use /lash acData ase in a Data Guard en ironment$ %lso, see 'racle Data ase 3ac up and +eco ery %d anced
>ser:s Guide for more information a out /lash ac Data ase$
(cti)atin" a P,ysical Standby Database $RoleTransition&
% data ase can operate in one of t o mutually exclusi e modes in an 'racle Data Guard configurationB primary or standby $
-
8/13/2019 Data Guard Configuration(2)
25/25
(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 or s as a Senior Data ase %dministrator for he D3% Oone, &nc$ located inPitts urgh, Pennsyl ania$ #is or 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 asedesign in a >*& , .inux, and