04_dataguard v5

Upload: mohammed-shoukat-ali

Post on 01-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 04_Dataguard v5

    1/17

    Physical standby database Implementation

    OVERVIEW...................................................................................................................................2

    PREPARATION STEPS...............................................................................................................3

    IMPEMENTATION STEPS......................................................................................................!

    STEPS TO "E #ONE ON T$E PRIMAR% SERVER..............................................................!

    STEP 1: BACKUP THE PRIMARY DATABASE DATAFILES.................................................................4

    STEP 3: CONFIGURE ORACLE NET...............................................................................................5

    STEP 4: CONFIGURE DATABASE INITIALISATION PARAMETER  FILE...............................................5

    STEPS TO "E #ONE ON T$E STAN#"% SERVER..............................................................&

    STEP 1: CONFIGURE ORACLE NET...............................................................................................7STEP 2: CONFIGURE THE PHYSICAL STANDBY DATABASE INITIALISATION PARAMETER ...............7

    STEP 2: R ESTORE DATABASE FILES FROM THE BACKUP LOCATION.............................................8

    STEP 3: START AUTOMATIC STANDBY DATABASE R ECOVERY......................................................

    SWIT'$OVER #ATA"ASE ROE.........................................................................................()

    STEP 1: CHECK  THE PRIMARY DATABASE READINESS FOR  S!ITCHOVER ...................................1"

    STEP 2: S!ITCHING THE PRIMARY TO STANDBY........................................................................1"

    STEP 3: S!ITCH FROM STANDBY TO PRIMARY...........................................................................11

    STEP 4: START AUTOMATIC STANDBY DATABASE R ECOVERY....................................................12

    APPEN#I* A+ 'OMMAN#S....................................................................................................(3APPEN#I* "+ PROTE'TION MO#ES..................................................................................(!

    APPEN#I* '+ #ATA ,-AR# -SE- 'OMMAN#S........................................................(/

    S!ITCHOVER  DATABASE R OLE..................................................................................................1#

    R EAD O NLY DATABASE R OLE....................................................................................................1#

    FAILOVER  DATABASE R OLE $ I N CASE OF TOTAL DISASTER ......................................................17

    START STANDBY R ECOVERY......................................................................................................17

      V%&'()* 5 P+,% 1

    D)-/%*0 N+/%: 2#"2157"".)-

  • 8/9/2019 04_Dataguard v5

    2/17

  • 8/9/2019 04_Dataguard v5

    3/17

    Physical standby database Implementation

    Preparation Steps

    2efore starting in the implementation steps ma"e sure that the folloing setup eists,

    6rimary database must be running in ARC/#;

    alter system set 8?ARC/#;

  • 8/9/2019 04_Dataguard v5

    4/17

    Physical standby database Implementation

    Implementation Steps

     AssumptionF*. $e have etrade database having to instances etrade* and etrade1 running on to

    different server on A#% &.' platform.1. The RAN directory for bac"up is GorahomeGbac"up ith enough space for the full

    database bac"up'. A7 database is created in the standby environment ith similar names li"e productions

    and the init.ora parameter HprocessesH eIual to *&3J. hosts file is update in the primary and standby machines correctly

    Steps To Be Done On the Primary Server 

    Step 1 Back!p the pri"ar# $ata%ase $ata&i'es

    *. 7hutdon the primary database RAC instances

    srvctl stop database –d etrade

    1. 7tart up one instance in mount state, e.g. etrade*

    # export ORACLE_SID=etrade1

    # rman target

    R!A" S$AR$%& !O%"$

    '. 2ac"up database using RAN

    R!A" CO"'I(%RE DE)ICE $*&E DIS+ &ARALLELIS! , -AC+%& $*&E $OCO!&RESSED -AC+%&SE$.

    R!A" CO"'I(%RE C/A""EL DE)ICE $*&E DIS+ 'OR!A$0oraomebac23pD'_4s_4p_4c0.

    R!A" -AC+%& DA$A-ASE.

    J. Reopen the 6rimary database.

    R!A" AL$ER DA$A-ASE O&E".

    &. Create the standby database control file by issuing the folloing command,

    S5L AL$ER DA$A-ASE CREA$E S$A"D-* CO"$ROL'ILE AS0oraomebac23petrade_stdb6c78ctl0.

    +. Transfer the datafiles and control files from GorahomeGbac"up directory to the physicalstandby machineGsite ith same directory path (so that the restore database step canfind it).

    V%&'()* 5 P+,% 4

    D)-/%*0 N+/%: 2#"2157"".)-

  • 8/9/2019 04_Dataguard v5

    5/17

    Physical standby database Implementation

    Step ( )o*&ig!re +rac'e Net 

    K. Add a service for the standby database in the tnsnames.ora in all instances and anotherone for the primary database (etra$e,pri" - etra$e,st*$%# )

    E$RADE1_&RI! =  9DESCRI&$IO" =  9ADDRESS = 9&RO$OCOL = $C&:9/OS$ = tcom1_v;p:9&OR$ = 1:  9I"S$A"CE_"A!E = etrade:  :  :

    E$RADEDR=  9DESCRI&$IO" =  9ADDRESS = 9&RO$OCOL = $C&:9/OS$ = Ola6a_$ad:9&OR$ = 1

  • 8/9/2019 04_Dataguard v5

    6/17

    Physical standby database Implementation

    M.8?ARC/#;

  • 8/9/2019 04_Dataguard v5

    7/17

    Physical standby database Implementation

    Steps To Be Done On The Standy Server 

    Step 1 )o*&ig!re +rac'e Net 

    -. Add a service for the standby database in the tnsnames.ora and another one for theprimary database (

  • 8/9/2019 04_Dataguard v5

    8/17

    Physical standby database Implementation

    8?ARC/#;

  • 8/9/2019 04_Dataguard v5

    9/17

    Physical standby database Implementation

    7E AT

  • 8/9/2019 04_Dataguard v5

    10/17

    Physical standby database Implementation

    Swit(hOver Dataase Role

    7itching database roles is alays initiated from the primary database and is alays completedon a standby database.

    Step 1 )heck the pri"ar# $ata%ase rea$i*ess &or Switchover 

    #n order to sitch the primary database to standby all sessions should be disconnected. $henissuing the statement belo the output should be T8 7TAND29S.

    7E 7

  • 8/9/2019 04_Dataguard v5

    11/17

    Physical standby database Implementation

    '. 7itch the primary database to standby role

    7E shutdon immediate>7E 7tartup nomount7E alter database mount standby database>

    Step ( Switch &ro" sta*$%# to pri"ar# 

    7tandby instance should be mounted, only one session is alloed and the primary must havesitched role to standby and the standby database must have applied the sitchover 

    notification from the primary database.

    *. Chec" that the standby database is ready to be sitched to primary role,

    7E 7

  • 8/9/2019 04_Dataguard v5

    12/17

    Physical standby database Implementation

    Step 4 Start A!to"atic Sta*$%# $ata%ase /ecover#

    *&. 7tart standby database recovery,

    7E AT

  • 8/9/2019 04_Dataguard v5

    13/17

  • 8/9/2019 04_Dataguard v5

    14/17

    Physical standby database Implementation

    APPEDI B Prote(tion 0odes

    0aimum Prote(tion 0ode

    This protection mode ensures that no data loss ill occur if the primary database fails. Toprovide this level of protection, the redo data needed to recover each transaction must beritten to both the local online redo log and to the standby redo log on at least one standbydatabase before the transaction commits. To ensure data loss cannot occur, the primarydatabase shuts don if a fault prevents it from riting its redo stream to at least one remotestandby redo log. 5or multiple!instance RAC databases, Data uard shuts don the primarydatabase if it is unable to rite the redo records to at least one properly configured database

    instance. The maimum protection mode reIuires that at least one standby instance has astandby redo log and the $R, 79NC, and A55#R attributes be used on the8?ARC/#;

  • 8/9/2019 04_Dataguard v5

    15/17

    Physical standby database Implementation

    The maimum performance mode enables you to either set the $R and A79NC attributes,or set the ARC/ attribute on the 8?ARC/#;

  • 8/9/2019 04_Dataguard v5

    16/17

    Physical standby database Implementation

    APPEDI C Data -uard

    d. AT

  • 8/9/2019 04_Dataguard v5

    17/17

    Physical standby database Implementation

    ai'over Data%ase /o'e : I* case o& tota' $isaster a. AT