dataguardphysicalstandbystep (1).pdf

Upload: radhashyam-naak

Post on 28-Feb-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    1/27

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    2/27

    Creating a Data Guard Physical Standby environment, General Review.

    Manually setting up a Physical standby database is a simple task when all prerequisites and setup steps are carefully met and executed.In this example I did use 2 hosts, that host a RAC database. All RAC preinstall requisites are then in place and no additional configuration wasnecessary to implement Data Guard Physical Standby manually. Note that using Enterprise Manager Grid Control Data Guard Physical Standbycan be implemented from the Grid Control Console easily. Still, this exercise provide a degree of familiarity with Data Guard.

    The Enviroment

    2 Linux servers, Oracle Distribution 2.6.9-55 EL i686 i386 GNU/LinuxOracle Database 10g Enterprise Edition Release 10.2.0.1.0ssh is configured for user oracle on both nodes

    Oracle Home is on identical path on both nodes

    Implementation notes:

    Once you have your primary database up and running these are the steps to follow:

    1.

    Enable Forced Logging2. Create a Password File3.

    Configure a Standby Redo Log4. Enable Archiving5.

    Set Primary Database Initialization Parameters

    Having followed these steps to implement the Physical Standby you need to follow these steps:

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    3/27

    1.

    Create a Control File for the Standby Database2. Backup the Primary Database and transfer a copy to the Standby node.3.

    Prepare an Initialization Parameter File for the Standby Database4. Configure the listener and tnsnames to support the database on both nodes5. Set Up the Environment to Support the Standby Database on the standby node.6.

    Start the Physical Standby Database7. Verify the Physical Standby Database Is Performing Properly

    Step by Step Implementation of a Physical Standby Environment

    Primary Database Steps

    Primary Database General View

    SQL> select name from v$database;

    NAME---------WHITEOWL

    SQL> select file_name from dba_data_files;

    FILE_NAME--------------------------------------------------------------------------------

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    4/27

    /vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_users_310mzml9_.dbf/vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_sysaux_310mzm34_.dbf/vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_undotbs1_310mzmk2_.dbf/vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_system_310mzm27_.dbf/vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_test2_3117h15v_.dbf/vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_test3_3117h8nv_.dbf/vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_test4_3117hk7d_.dbf

    7 rows selected.

    SQL> select name from v$database;

    NAME---------WHITEOWL

    SQL> show parameters unique

    NAME TYPE VALUE------------------------------------ ----------- ------------------------------db_unique_name string whiteowl

    Enable Forced Logging

    In order to implement Standby Database we enable 'Forced Logging'.

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    5/27

    This option ensures that even in the event that a 'nologging' operation is done, force logging takes precedence and all operations are loggedinto the redo logs.

    SQL> ALTER DATABASE FORCE LOGGING;

    Database altered.

    Create a Password File

    A password file must be created on the Primary and copied over to the Standby site. The sys password must be identical on both sites. This isa key pre requisite in order to be able to ship and apply archived logs from Primary to Standby.

    cd $ORACLE_HOME/dbs[vmractest1] > orapwd file=orapwwhiteowl password=oracle force=y

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    6/27

    Configure a Standby Redo Log

    A Standby Redo log is added to enable Data Guard Maximum Availability and Maximum Protection modes. It is important to configure theStandby Redo Logs (SRL) with the same size as the online redo logs.In this example I'm using Oracle Managed Files, that's why I don't need to provide the SRL path and file name. If you are not using OMF'syou then must pass the full qualified name.

    SQL> sel ect * f r om v$l ogf i l e;

    GROUP# STATUS TYPE MEMBER I S_- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    3 ONLI NE / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _3_310n22j j _. l og NO2 ONLI NE / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _2_310n21sx_. l og NO1 ONLI NE / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _1_310n215q_. l og NO

    SQL> sel ect bytes f r om v$l og;

    BYTES- - - - - - - - - -

    524288005242880052428800

    SQL> ALTER DATABASE ADD STANDBY LOGFI LE GROUP 4 SI ZE 50M;

    Dat abase al t er ed.

    SQL> ALTER DATABASE ADD STANDBY LOGFI LE GROUP 5 SI ZE 50M;Dat abase al t er ed.

    SQL> ALTER DATABASE ADD STANDBY LOGFI LE GROUP 6 SI ZE 50M;Dat abase al t er ed.

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    7/27

    SQL> sel ect * f r om v$l ogf i l e

    2 /

    GROUP# STATUS TYPE MEMBER I S_- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    3 ONLI NE / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _3_310n22j j _. l og NO2 ONLI NE / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _2_310n21sx_. l og NO1 ONLI NE / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _1_310n215q_. l og NO4 STANDBY / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _4_3gznj c9v_. l og NO

    5 STANDBY / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _5_3gznnr h0_. l og NO6 STANDBY / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _6_3gznr wd7_. l og NO

    6 r ows sel ect ed.

    Enable Archiving

    On 10g you can enable archive log mode by mounting the database and executing the archivelog command:

    SQL> st ar t up mount ;ORACLE i nst ance st art ed.

    Tot al Syst em Gl obal Ar ea 285212672 byt esFi xed Si ze 1218992 byt es

    Var i abl e Si ze 75499088 byt esDat abase Buf f er s 205520896 bytesRedo Buf f er s 2973696 bytesDat abase mount ed.SQL> al t er database archi vel og;

    Dat abase al t er ed.

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    8/27

    SQL> al t er dat abase open;

    Dat abase al t er ed.

    SQL> ar chi ve l og l i stDat abase l og mode Ar chi ve ModeAut omat i c archi val Enabl edAr chi ve dest i nat i on / vmasmt est / whi t eowl / ar chdest / ar ch

    Ol dest onl i ne l og sequence 92Next l og sequence t o archi ve 94Curr ent l og sequence 94

    Set Primary Database Initialization Parameters

    Data Guard must use spfile, in order to configure it we create and configure the standby parameters on a regular pfile, and once it is ready we

    convert it to an spfile.Several init.ora parameters control the behavior of a Data Guard environment. In this example the Primary database init.ora is configured sothat it can hold both roles, as Primary or Standby.

    SQL> create pfile='/oradisk/app01/oracle/product/10gDB/dbs/pfilewhiteowl.ora' from spfile;

    File created.

    Edit the pfile to add the standby parameters, here shown highlighted:

    db_name=' whi t eowl 'db_uni que_name=' whi t eowl 'LOG_ARCHI VE_CONFI G=' DG_CONFI G=( whi t eowl , bl ackowl ) 'cont r ol _f i l es=' / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ cont r ol f i l e/ o1_mf _310n1xf 0_. ct l '

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    9/27

    LOG_ARCHI VE_DEST_1=

    ' LOCATI ON=/ vmasmt est / whi t eowl / archdest /VALI D_FOR=( ALL_LOGFI LES, ALL_ROLES)DB_UNI QUE_NAME=whi t eowl '

    LOG_ARCHI VE_DEST_2=' SERVI CE=bl ackowl LGWR ASYNCVALI D_FOR=( ONLI NE_LOGFI LES, PRI MARY_ROLE)DB_UNI QUE_NAME=bl ackowl '

    LOG_ARCHI VE_DEST_STATE_1=ENABLE

    LOG_ARCHI VE_DEST_STATE_2=ENABLEREMOTE_LOGI N_PASSWORDFI LE=EXCLUSI VELOG_ARCHI VE_FORMAT=%t _%s_%r . ar cLOG_ARCHI VE_MAX_PROCESSES=30# St andby r ol e par amet er s - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*. f al _ser ver =bl ackowl*. f al _cl i ent =whi t eowl*. st andby_f i l e_management =aut o*. db_f i l e_name_conver t =' BLACKOWL/ BLACKOWL' , ' WHI TEOWL/ WHI TEOWL'*. l og_f i l e_name_conver t =' / vmasmt est / od01/ BLACKOWL/ BLACKOWL/ ' , ' / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ '# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -audi t _f i l e_dest =' / or adi sk/ app01/ or acl e/ admi n/ whi t eowl / adump'backgr ound_dump_dest =' / oradi sk/ app01/ oracl e/ admi n/ whi t eowl / bdump'core_dump_dest =' / oradi sk/ app01/ oracl e/ admi n/ whi t eowl / cdump'user_dump_dest =' / oradi sk/ app01/ oracl e/ admi n/ whi t eowl / udump'compat i bl e=' 10. 2. 0. 1. 0'db_bl ock_s i ze=8192

    db_cr eat e_f i l e_dest =' / vmasmt est / od01/ WHI TEOWL'db_domai n=' 'db_f i l e_mul t i bl ock_r ead_count =16

    j ob_queue_processes=10open_cur sor s=300pga_aggregat e_t ar get =94371840processes=150

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    10/27

    r emote_l ogi n_passwordf i l e=' EXCLUSI VE'

    sga_t ar get=283115520undo_management =' AUTO'undo_t abl espace=' UNDOTBS1'

    Once the new parameter file is ready we create from it the spfile:

    SQL> shutdown i mmedi at e;Database cl osed.

    Dat abase di smounted.ORACLE i nst ance shut down.SQL> st ar t up nomount pf i l e=' / or adi sk/ app01/ or acl e/ pr oduct / 10gDB/ dbs/ pf i l ewhi t eowl . or a' ;ORACLE i nst ance st art ed.

    Tot al Syst em Gl obal Ar ea 285212672 byt esFi xed Si ze 1218992 byt esVar i abl e Si ze 92276304 byt esDat abase Buf f er s 188743680 bytesRedo Buf f er s 2973696 bytesSQL> creat e spf i l e f r om pf i l e=' / or adi sk/ app01/ or acl e/ pr oduct / 10gDB/ dbs/ pf i l ewhi t eowl . or a' ;

    Fi l e creat ed.

    SQL> shutdown i mmedi at e;ORA- 01507: database not mount ed

    ORACLE i nst ance shut down.SQL> st ar t up;ORACLE i nst ance st art ed.

    Tot al Syst em Gl obal Ar ea 285212672 byt esFi xed Si ze 1218992 byt es

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    11/27

    Var i abl e Si ze 92276304 byt es

    Dat abase Buf f er s 188743680 bytesRedo Buf f er s 2973696 bytesDat abase mount ed.Dat abase opened.

    Standby Database Steps

    Create a Control File for the Standby Database

    The standby database will use a control file that is generated on the primary database

    SQL> st ar t up mount ;ORACLE i nst ance st ar t ed.

    Tot al Syst em Gl obal Ar ea 285212672 byt esFi xed Si ze 1218992 byt esVar i abl e Si ze 92276304 byt esDat abase Buf f er s 188743680 byt esRedo Buf f er s 2973696 byt esDat abase mount ed.SQL> ALTER DATABASE CREATE STANDBY CONTROLFI LE AS' / or adi sk/ app01/ or acl e/ pr oduct / 10gDB/ dbs/ bl ackowl . ct l ' ;

    Dat abase al t er ed.

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    12/27

    SQL> ALTER DATABASE OPEN;

    Dat abase al t er ed.

    Backup the Primary Database and transfer a copy to the Standby node.

    Generate a script to copy datafiles

    SQL> set pages 50000 l i nes 120 head of f ver i of f f l ush of f t i of fSQL> spool cpf i l esSQL> sel ect ' scp - p ' | | f i l e_name| | ' $v_dest ' f r om dba_dat a_f i l es;

    scp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ dat af i l e/ o1_mf _users_310mzml 9_. dbf $v_destscp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ dat af i l e/ o1_mf _sysaux_310mzm34_. dbf $v_dest

    scp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ dat af i l e/ o1_mf _undot bs1_310mzmk2_. dbf $v_destscp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ dat af i l e/ o1_mf _syst em_310mzm27_. dbf $v_destscp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ dat af i l e/ o1_mf _t est 2_3117h15v_. dbf $v_destscp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ dat af i l e/ o1_mf _t est 3_3117h8nv_. dbf $v_destscp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ dat af i l e/ o1_mf _t est 4_3117hk7d_. dbf $v_dest

    7 r ows sel ect ed.

    SQL> sel ect ' scp - p ' | | f i l e_name| | ' $v_dest ' f r om dba_t emp_f i l es;

    scp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ dat af i l e/ o1_mf _t emp_310n2bnj _. t mp $v_dest

    SQL> sel ect ' scp - p ' | | member | | ' $v_dest ' f r om v$l ogf i l e;

    scp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _3_310n22j j _. l og $v_destscp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _2_310n21sx_. l og $v_dest

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    13/27

    scp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _1_310n215q_. l og $v_dest

    scp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _4_3gznj c9v_. l og $v_destscp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _5_3gznnr h0_. l og $v_destscp - p / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _6_3gznr wd7_. l og $v_dest

    6 r ows sel ect ed.

    SQL> spool of f

    Shutdown the database, edit the script to add the v_dest location, and execute it.

    [vmractest1] > mv cpfiles.lst cpfiles

    #!/bin/kshv_dest=vmractest2:/oradisk/od01/BLACKOWL/datafile/scp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_users_310mzml9_.dbf $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_sysaux_310mzm34_.dbf $v_dest

    scp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_undotbs1_310mzmk2_.dbf $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_system_310mzm27_.dbf $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_test2_3117h15v_.dbf $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_test3_3117h8nv_.dbf $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_test4_3117hk7d_.dbf $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/o1_mf_temp_310n2bnj_.tmp $v_destv_dest= vmractest2:/oradisk/od01/BLACKOWL/onlinelog/

    scp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/onlinelog/o1_mf_3_310n22jj_.log $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/onlinelog/o1_mf_2_310n21sx_.log $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/onlinelog/o1_mf_1_310n215q_.log $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/onlinelog/o1_mf_4_3gznjc9v_.log $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/onlinelog/o1_mf_5_3gznnrh0_.log $v_destscp -p /vmasmtest/od01/WHITEOWL/WHITEOWL/onlinelog/o1_mf_6_3gznrwd7_.log $v_dest

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    14/27

    On the standby node create the required directories to get the datafiles

    [root@vmractest2 root]# mkdir -p /oradisk/od01/BLACKOWL/datafile/[root@vmractest2 root]# mkdir -p /oradisk/od01/BLACKOWL/onlinelog/[root@vmractest2 root]# chown -R oracle:dba /oradisk/od01

    On the primary node execute the script to copy the database while the main database is down (or in backup mode)

    [ vmr act est 1] > chmod 700 cpf i l es[ vmr act est 1] > . / cpf i l eso1_mf _user s_310mzml 9_. dbf 100% 2801MB 7. 0MB/ s 06: 37o1_mf _sysaux_310mzm34_. dbf 100% 340MB 7. 4MB/ s 00: 45o1_mf _undotbs1_310mzmk2_. dbf 100% 100MB 8. 0MB/ s 00: 12o1_mf _syst em_310mzm27_. dbf 100% 490MB 7. 0MB/ s 01: 09o1_mf _t est 2_3117h15v_. dbf 100% 100MB 6. 5MB/ s 00: 15o1_mf _t est 3_3117h8nv_. dbf 100% 100MB 6. 0MB/ s 00: 16

    o1_mf _t est 4_3117hk7d_. dbf 100% 100MB 6. 4MB/ s 00: 15o1_mf _t emp_310n2bnj _. t mp 100% 433MB 5. 8MB/ s 01: 14o1_mf _3_310n22j j _. l og 100% 50MB 7. 5MB/ s 00: 06o1_mf _2_310n21sx_. l og 100% 50MB 8. 4MB/ s 00: 05o1_mf _1_310n215q_. l og 100% 50MB 8. 8MB/ s 00: 05o1_mf _4_3gznj c9v_. l og 100% 50MB 7. 7MB/ s 00: 06o1_mf _5_3gznnr h0_. l og 100% 50MB 8. 2MB/ s 00: 06o1_mf _6_3gznrwd7_. l og 100% 50MB 4. 9MB/ s 00: 10

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    15/27

    Prepare an Init ialization Parameter File for the Standby Database

    Copy and edit the primary init.ora to set it up for the standby role

    *.db_name='whiteowl'*.db_unique_name='blackowl'

    *.audit_file_dest='/oradisk/app01/oracle/admin/blackowl/adump'*.background_dump_dest='/oradisk/app01/oracle/admin/blackowl/bdump'*.core_dump_dest='/oradisk/app01/oracle/admin/blackowl/cdump'*.user_dump_dest='/oradisk/app01/oracle/admin/blackowl/udump'*.compatible='10.2.0.1.0'*.control_files='/oradisk/od01/BLACKOWL/controlfile/blackowl_01.ctl','/oradisk/od01/BLACKOWL/controlfile/blackowl_02.ctl'*.db_block_size=8192*.db_create_file_dest='/oradisk/od01/BLACKOWL'

    *.db_domain=''*.db_file_multiblock_read_count=16*.db_file_name_convert='/oradisk/od01/BLACKOWL/datafile/','/vmasmtest/od01/WHITEOWL/WHITEOWL/datafile/'*.log_file_name_convert='/oradisk/od01/BLACKOWL/onlinelog/','/vmasmtest/od01/WHITEOWL/WHITEOWL/onlinelog/'*.fal_server='whiteowl'*.fal_client='blackowl'*.job_queue_processes=10

    *.LOG_ARCHIVE_CONFIG='DG_CONFIG=(whiteowl,blackowl)'*.LOG_ARCHIVE_DEST_1='LOCATION=/oradisk/od01/BLACKOWL/archives/VALID_FOR=(ALL_LOGFILES,ALL_ROLES)DB_UNIQUE_NAME=blackowl'

    *.LOG_ARCHIVE_DEST_2='SERVICE=whiteowl LGWR ASYNCVALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    16/27

    DB_UNIQUE_NAME=whiteowl'

    *.LOG_ARCHIVE_DEST_STATE_1='ENABLE'*.LOG_ARCHIVE_DEST_STATE_2='ENABLE'*.LOG_ARCHIVE_FORMAT='%t_%s_%r.arc'*.LOG_ARCHIVE_MAX_PROCESSES=30*.open_cursors=300*.pga_aggregate_target=94371840*.processes=150

    *.remote_login_passwordfile='EXCLUSIVE'*.sga_target=283115520*.standby_file_management='auto'*.undo_management='AUTO'*.undo_tablespace='UNDOTBS1'

    Create all required directories for dump directories and archived log destination

    [vmractest2] > mkdir -p /oradisk/app01/oracle/admin/blackowl/adump{oracle} /oradisk/app01/oracle/product/10gDB/dbs [vmractest2] > mkdir -p /oradisk/app01/oracle/admin/blackowl/bdump{oracle} /oradisk/app01/oracle/product/10gDB/dbs [vmractest2] > mkdir -p /oradisk/app01/oracle/admin/blackowl/cdump{oracle} /oradisk/app01/oracle/product/10gDB/dbs [vmractest2] > mkdir -p /oradisk/app01/oracle/admin/blackowl/udump{oracle} /oradisk/app01/oracle/product/10gDB/dbs [vmractest2] > mkdir -p /oradisk/od01/BLACKOWL/archives/

    Copy from the primary the standby controlfile to its destination

    [vmractest1] > scp -p blackowl.ctl vmractest2:/oradisk/od01/BLACKOWL/controlfile/blackowl_02.ctlblackowl.ctl 100% 6992KB 7.2MB/s 00:00[vmractest1] > scp -p blackowl.ctl vmractest2:/oradisk/od01/BLACKOWL/controlfile/blackowl_01.ctl

    blackowl.ctl 100% 6992KB 6.9MB/s 00:00

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    17/27

    Configure the listener and tnsnames to support the database on both nodes

    Configure listener.ora on both servers to hold entries for both databases

    # ON VMRACTEST1

    LI STENER_VMRACTEST =( DESCRI PTI ON_LI ST =

    ( DESCRI PTI ON =( ADDRESS = ( PROTOCOL = TCP) ( HOST = vmr act est 1) ( PORT = 1522) ( I P = FI RST) ))

    )

    SI D_LI ST_LI STENER_VMRACTEST =( SI D_LI ST =

    ( SI D_DESC =( GLOBAL_DBNAME = whi t eowl )

    ( ORACLE_HOME = / oradi sk/ app01/ oracl e/ product / 10gDB )( SI D_NAME = whi t eowl )

    ))

    # ON VMRACTEST2

    LI STENER_VMRACTEST =

    ( DESCRI PTI ON_LI ST =( DESCRI PTI ON =( ADDRESS = ( PROTOCOL = TCP) ( HOST = vmr act est 2) ( PORT = 1522) ( I P = FI RST) )

    ))

    SI D_LI ST_LI STENER_VMRACTEST =

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    18/27

    ( SI D_LI ST =

    ( SI D_DESC =( GLOBAL_DBNAME = bl ackowl )( ORACLE_HOME = / oradi sk/ app01/ oracl e/ product / 10gDB )( SI D_NAME = bl ackowl )

    ))

    Configure tnsnames.ora on both servers to hold entries for both databases

    # ON VMRACTEST1

    LI STENER_VMRACTEST =( DESCRI PTI ON_LI ST =

    ( DESCRI PTI ON =( ADDRESS = ( PROTOCOL = TCP) ( HOST = vmr act est 1) ( PORT = 1522) ( I P = FI RST) )

    ))

    WHI THEOWL =( DESCRI PTI ON =

    ( ADDRESS = ( PROTOCOL = TCP) ( HOST = vmr act est 1) ( PORT = 1522) )( CONNECT_DATA =

    ( SERVER = DEDI CATED)( SERVI CE_NAME = whi t eowl )

    ))

    BLACKOWL =( DESCRI PTI ON =

    ( ADDRESS = ( PROTOCOL = TCP) ( HOST = vmr act est 2) ( PORT = 1522) )( CONNECT_DATA =

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    19/27

    ( SERVER = DEDI CATED)

    ( SERVI CE_NAME = bl ackowl ))

    )

    # ON VMRACTEST2

    LI STENER_VMRACTEST =( DESCRI PTI ON_LI ST =

    ( DESCRI PTI ON =( ADDRESS = ( PROTOCOL = TCP) ( HOST = vmr act est 2) ( PORT = 1522) ( I P = FI RST) )

    ))

    BLACKOWL =( DESCRI PTI ON =

    ( ADDRESS = ( PROTOCOL = TCP) ( HOST = vmr act est 2) ( PORT = 1522) )

    ( CONNECT_DATA =( SERVER = DEDI CATED)( SERVI CE_NAME = bl ackowl )

    ))

    WHI THEOWL =( DESCRI PTI ON =

    ( ADDRESS = ( PROTOCOL = TCP) ( HOST = vmr act est 1) ( PORT = 1522) )( CONNECT_DATA =

    ( SERVER = DEDI CATED)( SERVI CE_NAME = whi t eowl )

    ))

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    20/27

    Start the listener and check tnsping on both nodes to both services

    [ vmr act est 1. par t ner gsm. co. i l ] > t nspi ng whi t eowlTNS Pi ng Ut i l i t y f or Li nux: Ver si on 10. 2. 0. 1. 0 - Pr oduct i on on 19- SEP- 2007 15: 10: 00

    Copyr i ght ( c) 1997, 2005, Or acl e. Al l r i ght s r eser ved.

    Used par amet er f i l es:/ or adi sk/ app01/ or acl e/ pr oduct / 10gDB/ net wor k/ admi n/ sql net . or a

    Used TNSNAMES adapt er t o r esol ve t he al i asAt t empt i ng t o cont act ( DESCRI PTI ON = ( ADDRESS = ( PROTOCOL = TCP) ( HOST =vmr act est 1) ( PORT = 1522) ) ( CONNECT_DATA = ( SERVER = DEDI CATED) ( SERVI CE_NAME =whi t eowl ) ) )OK ( 10 msec)

    {or acl e} / or adi sk/ app01/ or acl e/ pr oduct / 10gDB/ net wor k/ admi n[ vmr act est 1. par t ner gsm. co. i l ] > t nspi ng bl ackowlTNS Pi ng Ut i l i t y f or Li nux: Ver si on 10. 2. 0. 1. 0 - Pr oduct i on on 19- SEP- 2007 15: 10: 09

    Copyr i ght ( c) 1997, 2005, Or acl e. Al l r i ght s r eser ved.

    Used par amet er f i l es:/ or adi sk/ app01/ or acl e/ pr oduct / 10gDB/ net wor k/ admi n/ sql net . or a

    Used TNSNAMES adapt er t o r esol ve t he al i asAt t empt i ng t o cont act ( DESCRI PTI ON = ( ADDRESS = ( PROTOCOL = TCP) ( HOST =vmr act est 2) ( PORT = 1522) ) ( CONNECT_DATA = ( SERVER = DEDI CATED) ( SERVI CE_NAME =bl ackowl ) ) )OK ( 10 msec)

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    21/27

    Set Up the Environment to Support the Standby Database on the standby node.

    Copy the password file from Primary to Standby, sys password must be identical

    [ vmr act est 1]> scp orapwwhi t eowlvmr act est 2: / or adi sk/ app01/ or acl e/ pr oduct / 10gDB/ dbs/ or apwbl ackowlor apwwhi t eowl 100% 1536 4. 0MB/ s 00: 00

    Setup the environment variables to point to the Satndby database

    ORACLE_HOME=/oradisk/app01/oracle/product/10gDBORACLE_SID=blackowl

    Startup nomount the Standby database and generate an spfile

    {oracle} /oradisk/app01/oracle/product/10gDB/dbs [vmractest2] > sqlplus / as sysdba

    SQL*Plus: Release 10.2.0.1.0 - Production on Wed Sep 19 16:17:18 2007

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    Connected to an idle instance.

    SQL> startup nomount pfile='/oradisk/app01/oracle/product/10gDB/dbs/initblackowl.ora'ORACLE instance started.

    Total System Global Area 285212672 bytesFixed Size 1218992 bytesVariable Size 92276304 bytesDatabase Buffers 188743680 bytes

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    22/27

    Redo Buffers 2973696 bytes

    SQL> create spfile from pfile='/oradisk/app01/oracle/product/10gDB/dbs/initblackowl.ora';

    File created.

    SQL> shutdown immediate;ORA-01507: database not mounted

    ORACLE instance shut down.

    Startup mount the Standby database and perform recovery

    SQL> st ar t up mountORACLE i nst ance st art ed.

    Tot al Syst em Gl obal Ar ea 285212672 byt esFi xed Si ze 1218992 byt esVar i abl e Si ze 92276304 byt esDat abase Buf f er s 188743680 bytesRedo Buf f er s 2973696 bytesDat abase mount ed.SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DI SCONNECT FROM SESSI ON;

    Dat abase al t er ed.

    The alert log of the standby will show the operations taking place

    ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DI SCONNECT FROM SESSI ON

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    23/27

    Wed Sep 19 16: 46: 26 2007

    At t empt t o st ar t background Managed Standby Recovery pr ocess ( bl ackowl )MRP0 st ar t ed wi t h pi d=47, OS i d=12498Wed Sep 19 16: 46: 26 2007MRP0: Backgr ound Managed Standby Recovery process st ar t ed ( bl ackowl )Managed St andby Recover y not usi ng Real Ti me Appl yCl ear i ng onl i ne r edo l ogf i l e 1 / or adi sk/ od01/ BLACKOWL/ onl i nel og/ o1_mf _1_310n215q_. l ogCl ear i ng onl i ne l og 1 of t hr ead 1 sequence number 95Del eted Or acl e managed f i l e / oradi sk/ od01/ BLACKOWL/ onl i nel og/ o1_mf _1_310n215q_. l ogWed Sep 19 16: 46: 32 2007Compl et ed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DI SCONNECT FROM SESSI ONWed Sep 19 16: 46: 33 2007Cl ear i ng onl i ne r edo l ogf i l e 1 compl et eCl ear i ng onl i ne redo l ogf i l e 2 / or adi sk/ od01/ BLACKOWL/ onl i nel og/ o1_mf _2_310n21sx_. l ogCl ear i ng onl i ne l og 2 of t hr ead 1 sequence number 96Del eted Or acl e managed f i l e / oradi sk/ od01/ BLACKOWL/ onl i nel og/ o1_mf _2_310n21sx_. l ogCl ear i ng onl i ne r edo l ogf i l e 2 compl et eCl ear i ng onl i ne r edo l ogf i l e 3 / or adi sk/ od01/ BLACKOWL/ onl i nel og/ o1_mf _3_310n22j j _. l og

    Cl ear i ng onl i ne l og 3 of t hr ead 1 sequence number 94Del et ed Or acl e managed f i l e / oradi sk/ od01/ BLACKOWL/ onl i nel og/ o1_mf _3_310n22j j _. l ogCl ear i ng onl i ne r edo l ogf i l e 3 compl et eMedi a Recovery Wai t i ng f or t hread 1 sequence 96

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    24/27

    Start the Primary Database

    The alert log of the primary will show how it recognize the standby and start shipping archived logs

    ******************************************************************LGWR: Set t i ng ' act i ve' archi val f or dest i nat i on LOG_ARCHI VE_DEST_2******************************************************************Wed Sep 19 16: 01: 07 2007

    LNS: St andby redo l ogf i l e sel ect ed f or t hr ead 1 sequence 100 f or dest i nat i onLOG_ARCHI VE_DEST_2Wed Sep 19 16: 01: 07 2007Successf ul l y onl i ned Undo Tabl espace 1.Wed Sep 19 16: 01: 07 2007SMON: enabl i ng t x recoveryWed Sep 19 16: 01: 09 2007Dat abase Char act erset i s AL32UTF8

    r epl i cat i on_dependency_t r acki ng t ur ned of f ( no async mul t i mast er r epl i cat i on f ound)Star t i ng backgr ound process QMNCQMNC st ar t ed wi t h pi d=21, OS i d=13864Wed Sep 19 16: 01: 12 2007Compl et ed: ALTER DATABASE OPENWed Sep 19 16: 01: 13 2007ARCq: St andby redo l ogf i l e sel ect ed f or t hr ead 1 sequence 99 f or dest i nat i onLOG_ARCHI VE_DEST_2Wed Sep 19 16: 05: 05 2007

    Thread 1 advanced t o l og sequence 101Cur r ent l og# 1 seq# 101 mem# 0:

    / vmasmt est / od01/ WHI TEOWL/ WHI TEOWL/ onl i nel og/ o1_mf _1_310n215q_. l ogWed Sep 19 16: 05: 06 2007LNS: St andby redo l ogf i l e sel ect ed f or t hr ead 1 sequence 101 f or dest i nat i onLOG_ARCHI VE_DEST_2

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    25/27

    Verify the Physical Standby Database Is Performing Properly

    Check archived redo log on Standby

    SQL> show par amet er s db_uni que_name;

    NAME TYPE VALUE- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -db_uni que_name st r i ng bl ackowl

    SQL> l1* SELECT NAME FROM V$DATABASE

    SQL> SELECT SEQUENCE#, FI RST_TI ME, NEXT_TI ME FROM V$ARCHI VED_LOG ORDER BY SEQUENCE#;

    SEQUENCE# FI RST_TI M NEXT_TI ME- - - - - - - - - - - - - - - - - - - - - - - - - - - -

    96 19- SEP- 07 19- SEP- 0797 19- SEP- 07 19- SEP- 07

    98 19- SEP- 07 19- SEP- 0799 19- SEP- 07 19- SEP- 07

    100 19- SEP- 07 19- SEP- 07

    Switch logfiles on Primary

    SQL> al t er system swi t ch l ogf i l e;

    Syst em al t er ed.

    SQL> ar chi ve l og l i stDat abase l og mode Ar chi ve ModeAut omat i c archi val Enabl edAr chi ve dest i nat i on / vmasmt est / whi t eowl / ar chdest /Ol dest onl i ne l og sequence 100

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    26/27

    Next l og sequence t o archi ve 102

    Curr ent l og sequence 102

    SQL> al t er system swi t ch l ogf i l e;

    Syst em al t er ed.

    SQL> ar chi ve l og l i stDat abase l og mode Ar chi ve ModeAut omat i c archi val Enabl edAr chi ve dest i nat i on / vmasmt est / whi t eowl / ar chdest /Ol dest onl i ne l og sequence 101Next l og sequence t o archi ve 103Curr ent l og sequence 103

    Check archived redo log on Standby

    SQL> SELECT SEQUENCE#, FI RST_TI ME, NEXT_TI ME FROM V$ARCHI VED_LOG ORDER BY SEQUENCE#;

    SEQUENCE# FI RST_TI ME NEXT_TI ME- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    96 19/ 09/ 07 09: 35 19/ 09/ 07 09: 4597 19/ 09/ 07 09: 45 19/ 09/ 07 15: 2098 19/ 09/ 07 15: 20 19/ 09/ 07 15: 4899 19/ 09/ 07 15: 48 19/ 09/ 07 16: 00

    100 19/ 09/ 07 16: 00 19/ 09/ 07 16: 05

    101 19/ 09/ 07 16: 05 19/ 09/ 07 16: 08102 19/ 09/ 07 16: 08 19/ 09/ 07 16: 08

    7 r ows sel ect ed.

  • 7/25/2019 dataguardphysicalstandbystep (1).pdf

    27/27

    Reference:

    Oracle Data Guard Concepts and Administration10g Release 2 (10.2)Part Number B14239-04http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ps.htm#SBYDB00210