04_dataguard_v6

Upload: mohammed-shoukat-ali

Post on 01-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 04_Dataguard_v6

    1/15

    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...............................................................................................6STEP 2: CONFIGURE THE PHYSICAL STANDBY DATABASE INITIALISATION PARAMETER ...............6

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

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

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

    STEP 1: CHECK  THE PRIMARY DATABASE READINESS FOR  SITCHOVER .....................................!

    STEP 2: SITCHING THE PRIMARY TO STANDBY..........................................................................!

    STEP 3: SITCH FROM STANDBY TO PRIMARY............................................................................."

    STEP 4: START AUTOMATIC STANDBY DATABASE R ECOVERY....................................................1#

    APPEN#I) A* 'OMMAN#S....................................................................................................++APPEN#I) "* PROTE'TION MO#ES..................................................................................+2

    APPEN#I) '* #ATA ,-AR# -SE- 'OMMAN#S........................................................+!

    SITCHOVER  DATABASE R OLE..................................................................................................14

    R EAD O NLY DATABASE R OLE....................................................................................................14

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

    START STANDBY R ECOVERY......................................................................................................15

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

    D)-/%*0 N+/%: 26#21"72!.)-

  • 8/9/2019 04_Dataguard_v6

    2/15

    Physical standby database Implementation

    Overview

    These Note Describe a physical standby database configuration for a Real Application Clusters(RAC) primary environment.

     A physical standby database is physically identical to the primary database, ith on!dis"database structures that are identical to the primary database on a bloc"!for!bloc" basis. Thephysical standby database is updated by performing recovery. #t can either be recovering dataor open for read!only reporting.

    The environment that e have is as shon in the diagram belo,

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

    D)-/%*0 N+/%: 26#21"72!.)-

    $AN$AN

    IBM P595  A#% &.' '*+*.-/0'12 RA

    IBM P670  A#% &.' '*+*&33 /0*+2 RA

    IBM P595  A#% &.' '*+*.-/0'12 RA

    PrivateNetwork  

    SANSwitches

    SANSwitches

    45R Datacenter 6rimary 7ite 8A9A Datacenter 

    DR 7ite

    DS4800 Storage1:'+2 Dis"s

    DS4800 Storage1:'+2 Dis"s

  • 8/9/2019 04_Dataguard_v6

    3/15

    Physical standby database Implementation

    Preparation Steps

    Done

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

    D)-/%*0 N+/%: 26#21"72!.)-

  • 8/9/2019 04_Dataguard_v6

    4/15

    Physical standby database Implementation

    Implementation Steps

     Assumption;*. $e have

  • 8/9/2019 04_Dataguard_v6

    5/15

    Physical standby database Implementation

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

    Done

    Step 4 )o*&ig!re $ata%ase i*itia'isatio* para"eter &i'e

    Done

    Note 7pecial Consideration if 6rimary Database is in RAC nvironment

      Done

    F

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

    D)-/%*0 N+/%: 26#21"72!.)-

  • 8/9/2019 04_Dataguard_v6

    6/15

    Physical standby database Implementation

    Steps To Be Done On The Standby Server 

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

    Done

    Step , )o*&ig!re the ph#sica' sta*$%# $ata%ase i*itia'isatio* para"eter 

    Use initialization parameter of the primary site as a base for the standby databaseinit.ora after performing the below changes on it.

    Done

    The LOG_ARCI!"_D"ST # LOG_ARCI!"_D$PL"%_D"ST parameters sho&ld beremoved 'rom the init 'ile(

    )ote *+ when &sin, a RAC based init(ora then remove all -l&ster related entries. e(,(-l&ster_database. remote_listener. instan-e_n&mber. thread/

    )ote 0+ ma1e s&re to -reate all d&mp dire-tories. e(,( ad&mp. &d&mp. -d&mp. bd&mp

    Step , -estore $ata%ase .i'es &ro" the Back!p /ocatio*

    B. 7tartup Database after creating a passord file using the same sys passord used in

    production site (the format of file name is orap7#D for uni platform, hile it is6$D7#D.ora for NT)

    set 8RAC7#Detra$e$r 

    orapw$ &i'eoraho"eorac'epro$!ct102,20$%$%sorapwetra$e$r passwor$3passwor$ e*tries5 

    7EF C8NNCT sys= passwor$ as sysdba

    7EF 7TARTG6 N88GNT 65# pro$i*it2ora

    :. ount the standby database

    7EF ATR DATA2A7 8GNT 7TAND29 DATA2A7H

    -. Restore Database 5iles

    set 8RAC7#Detradedr 

    Rman target =

    RANF C8N5#GR DI#C T96 D#74 6ARA#7 @ 2AC4G6 T96 T8C86R77D 2AC4G67TH

    RANFRestore DatabaseH

    *3. Add a ne standby redo log file group to a standby database using the folloing formula(in our case the it ill be +)

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

    D)-/%*0 N+/%: 26#21"72!.)-

  • 8/9/2019 04_Dataguard_v6

    7/15

    Physical standby database Implementation

    (number of log files per thread J *) K number of threads

    7EF ATR DATA2A7 ADD 7TAND29 85# T/RAD *

    R8G6 & (

  • 8/9/2019 04_Dataguard_v6

    8/15

  • 8/9/2019 04_Dataguard_v6

    9/15

    Physical standby database Implementation

    '. 7itch the primary database to standby role

    7EF shutdon immediateH7EF 7tartup nomount7EF alter database mount standby databaseH

    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,

    7EF 7CT 7$#TC/8IR7TATG7 5R8 IODATA2A7H

    SWITCHOVER_STATUS------------------SESSIONS ACTIVE

    Terminate all other sessions until result is;

    SWITCHOVER_STATUS------------------ TO PRIMARY

    1. #ssue the folloing command on the standby database,

    7EF ATR DATA2A7 C8#T T8 7$#TC/8IR T8 6R#AR9H

    This command guarantees the last log file has been received and applied through theend!of!redo mar"er, closes the database if it has been opened for read!only transactionsand converts the standby control file to the current control file.

    '. 7itch the standby database to primary role

     Add the folloing parameters to the standby database init file,

    logarchivedest1

  • 8/9/2019 04_Dataguard_v6

    10/15

    Physical standby database Implementation

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

    *1. 7tart standby database recovery,

    7EF ATR DATA2A7 RC8IR ANAD 7TAND29 DATA2A7D#7C8NNCT 5R8 777#8NH

    )ote+ The standby database must have been in managed recovery mode prior to starting thesitchover operation, so that the primary database sitchover operation re?uest can becoordinated. #f managed recovery as not active, or the primary database sitchover notification as unable to be processed, the sitchover operation ill not be alloed toproceed.

    Remar1s A failover should not be performed ecept in case of emergencies. After failover the standbybecomes primary and loses standby functionality. A ne standby databse has to be setup.

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

    D)-/%*0 N+/%: 26#21"72!.)-

  • 8/9/2019 04_Dataguard_v6

    11/15

    Physical standby database Implementation

    APP")DI% A+ Commands

    Command Des-ription

    RC8IR ANAD 7TAND29 DATA2A7 CANCH To stop the Automatic Recovery

     ATR DATA2A7 86N RAD 8N9H To open the database in RAD 8N9mode

    7TARTG6 N88GNT

     ATR DATA2A7 8GNT 7TAND29 DATA2A7H

     ATR DATA2A7 RC8IR ANAD 7TAND29DATA2A7 D#7C8NNCT 5R8 777#8NH

    AL$ER DA$A-ASE RECO)ER !A"A(ED S$A"D-* DA$A-ASE%SI"( C%RRE"$ LO('ILE DISCO""EC$ 'RO! SESSIO".

    7tartup the standby database and startautomatic recovery

    7CT K 5R8 IO7TAND298H Euery vOmanagedstandby to see thestatus of processes involved in theconfiguration.

     $o determ9ne 97 real:t9me appl6 9s enabled; 8 It >9ll conta9n te val3e !A"A(ED REAL $I!EA&&L* >en real:t9me appl6 9s enabled; as so>n 9n te 7ollo>9ng example?S5L SELEC$ RECO)ER*_!ODE 'RO! )ARC/I)E_DES$_S$A$%S @/ERE DES$_ID= .RECO)ER*_!ODE

    :::::::::::::::::::::::!A"A(ED REAL $I!E A&&L*

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

    D)-/%*0 N+/%: 26#21"72!.)-

  • 8/9/2019 04_Dataguard_v6

    12/15

    Physical standby database Implementation

    APP")DI% B+ Prote-tion 5odes

    5a6im&m Prote-tion 5ode

    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 re?uires that at least one standby instance has astandby redo log and the $R, 79NC, and A55#R attributes be used on the8ARC/#ID7Tn parameter for this destination.

    5a6im&m Availability 5ode

    This protection mode provides the highest level of data protection that is possible ithoutcompromising the availability of the primary database. i"e maimum protection mode, atransaction ill not commit until the redo needed to recover that transaction is ritten to thelocal online redo log and to at least one remote standby redo log. Gnli"e maimum protectionmode, the primary database does not shut don if a fault prevents it from riting its redo streamto a remote standby redo log. #nstead, the primary database operates in maimum performance

    mode until the fault is corrected and all gaps in redo log files are resolved. $hen all gaps areresolved, the primary database automatically resumes operating in maimum availability mode.This mode ensures that no data loss ill occur if the primary database fails, but only if a secondfault does not prevent a complete set of redo data from being sent from the primary database toat least one standby database.

    i"e maimum protection mode, the maimum availability mode re?uires that you; Configure standby redo log files on at least one standby database.

    7et the 79NC, $R, and A55#R attributes of the 8ARC/#ID7Tn

    parameter for at least * standby database.

    5a6im&m Per'orman-e 5ode

    This protection mode (the default) provides the highest level of data protection that is possibleithout affecting the performance of the primary database. This is accomplished by alloing atransaction to commit as soon as the redo data needed to recover that transaction is ritten tothe local online redo log. The primary databasePs redo data stream is also ritten to at least onestandby database, but that redo stream is ritten asynchronously ith respect to thecommitment of the transactions that create the redo data.

    $hen netor" lin"s ith sufficient bandidth are used, this mode provides a level of dataprotection that approaches that of maimum availability mode ith minimal impact on primarydatabase performance.

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

    D)-/%*0 N+/%: 26#21"72!.)-

  • 8/9/2019 04_Dataguard_v6

    13/15

    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 8ARC/#ID7Tn parameter for the standby databasedestination. #f the primary database fails, you can reduce the amount of data that is not receivedon the standby destination by setting the $R and A79NC attributes.

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

    D)-/%*0 N+/%: 26#21"72!.)-

  • 8/9/2019 04_Dataguard_v6

    14/15

    Physical standby database Implementation

    APP")DI% C+ Data G&ard $se'&l Commands

    Switchover Data%ase -o'e

    1 +N P-IMA- 

    a. 7elect sitchoverstatus from vOdatabaseHSWITCHOVER_STATUS------------------ TO STANDBY

    b. ATR DATA2A7 C8#T T8 7$#TC/8IR T8 7TAND29 $#T/ 777#8N 7/GTD8$NH

    c. shutdon immediateHd. 7tartup nomount

    e. alter database mount standby databaseH

    f. ATR DATA2A7 RC8IR ANAD 7TAND29 DATA2A7 D#7C8NNCT 5R8777#8NH

    , +N SANDB 

    a. 7CT 7$#TC/8IR7TATG7 5R8 IODATA2A7HSWITCHOVER_STATUS------------------

     TO PRIMARYb. ATR DATA2A7 C8#T T8 7$#TC/8IR T8 6R#AR9H ! Add to init file

    c. ATR 797T 7T logarchivedest1

  • 8/9/2019 04_Dataguard_v6

    15/15

    Physical standby database Implementation

    .ai'over Data%ase -o'e I* case o& tota' $isaster a. ATR DATA2A7 RC8IR ANAD 7TAND29 DATA2A7 CancelH

    b. ATR DATA2A7 C8#T T8 7$#TC/8IR T8 6R#AR9H

    c. 7/GTD8$N #D#ATH

    d. 7TARTG6 8GNT

    e. ATR DATA2A7 7T 7TAND29 DATA2A7 T8 A%##L 6R58RANCH

    f. ATR DATA2A7 86NH

    Start Sta*$%# -ecover# 

    a. startup nomount

    b. ATR DATA2A7 8GNT 7TAND29 DATA2A7H

    c. ATR DATA2A7 RC8IR ANAD 7TAND29 DATA2A7 D#7C8NNCT 5R8777#8NH

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

    D)-/%*0 N+/%: 26#21"72!.)-