11g Dataguard Enhancements

download 11g Dataguard Enhancements

of 27

Transcript of 11g Dataguard Enhancements

  • 8/11/2019 11g Dataguard Enhancements

    1/27

  • 8/11/2019 11g Dataguard Enhancements

    2/27

    2

    Agenda

    } What is DATA GUARD ?} Types of Data Guard Databases

    } 11g Release 1 Enhancements

    } 11g Release 2 Enhancements

    }Active Data guard} Snapshot Standby Database

    } More Features

    } Rolling Upgrade and Physical Standby

    } Q&A

  • 8/11/2019 11g Dataguard Enhancements

    3/27

    3

    Data Guard Overview

    Data Guard

    Standby Plus more

    High Availability & DisasterRecovery Solution

  • 8/11/2019 11g Dataguard Enhancements

    4/27

  • 8/11/2019 11g Dataguard Enhancements

    5/27

    5

    Data guard Databases

  • 8/11/2019 11g Dataguard Enhancements

    6/27

    6

    11G R1 Enhancements

    Release 1

    New

    Features

  • 8/11/2019 11g Dataguard Enhancements

    7/27

    7

    R2 - Enhancements

    Release 2

    New

    Features

  • 8/11/2019 11g Dataguard Enhancements

    8/27

    8

    R2- New Features

    Release 2New

    Features

  • 8/11/2019 11g Dataguard Enhancements

    9/27

    9

    Active and Snapshot Standby

    Traditional Functionality until 10g11g Active DataGuard11g Snapshot Standby

  • 8/11/2019 11g Dataguard Enhancements

    10/27

    10

    Active Data Guard Benefits

  • 8/11/2019 11g Dataguard Enhancements

    11/27

    11

    Turn on Physical Standby to Active StandbyStop redo apply

    Database instandby mount

    mode

    Open readonly

    Open modechanged to read

    only

    Start the redoapply again using

    log file (SRLs)

    Status changed toread only apply

  • 8/11/2019 11g Dataguard Enhancements

    12/27

    12

    Turn on Physical Standby to Snapshot StandbyOnce sync check,

    convert standby tosnapshot

    Open database

    Read writemode

    Need to closedatabase

    Switched back tophysical standby

  • 8/11/2019 11g Dataguard Enhancements

    13/27

    13

    Additional InfoActive / Snapshot

    WHAT OPERATION ALLOWED IN ACTIVE

    DATA GUARD ?SELECT statementsComplex queriesCalling of stored proceduresUse of database links to redirect DML to

    PrimaryUse of stored procedures to call remotestored procedures via database linksUse of SET ROLEUse of ALTER SESSION and ALTERSYSTEMNo Datatypes restrictions like LogicalStandby

    Additional TEMPFILES can be created forSortsFlashback Query : SELECT AS OFAdditional License

    SOME IMPORTANT POINTS FOR SNAPSHOTSTANDBY DATABASE

    PHYSICAL STANDBY DATABASE SHOULD BE INFLASHBACK MODE

    NO REAL TIME QUERY OR DATA NO FAST START FAILOVER IN THIS MODE

    NO SWITCHOVER/FAILOVER UNTILCONVERTED TO PHYSICAL STANDBY

    Free of Licence POINTS

    1. Configure the Flash Recovery Area2. Set the Retention Target

    3. Enable Flashback Database

  • 8/11/2019 11g Dataguard Enhancements

    14/27

    14

    10g Equivalent Snapshot commandsPrepare the physical standby database to be activated

    SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=20G;SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='/arch/oradata'

    Prepare the primary database to have the physical standby be diverged.

    Archive the current log file.

    SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

    Cancel Redo Apply and create a guaranteed restore point.SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;SQL> CREATE RESTORE POINT restore_pt GUARANTEE FLASHBACK DATABASE;

    Activate the physical standby database.

    SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;SQL> STARTUP MOUNT FORCE;SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;

    SQL> ALTER DATABASE OPEN

    Revert the ac4vated database back to a physical standby database.

    SQL> STARTUP MOUNT FORCE;SQL> FLASHBACK DATABASE TO RESTORE POINT restore_pt;SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;SQL> STARTUP MOUNT FORCE;

  • 8/11/2019 11g Dataguard Enhancements

    15/27

    15

    DATGUARDStill More Features

  • 8/11/2019 11g Dataguard Enhancements

    16/27

    16

    More FeaturesRMAN Active database Duplication

    RMAN> run {

    allocate channel prmy1 type disk;

    allocate channel prmy2 type disk;

    allocate channel prmy3 type disk;

    allocate channel prmy4 type disk;

    allocate auxiliary channel repstby type

    disk;

    duplicate target database for standby from

    active databasespfile

    parameter_value_convert 'emrep','repstby'

    set db_unique_name='repstby'

    set db_file_name_convert='C:\','F:\'

    set log_file_name_convert='C:\','F:\'

    ;

    }

    }Steps

    Create a pfile with only db_name=stby

    Create directory structure for datafile locations

    Create directory structure for dump locations

    Create a password file (must match with target)

    Listener & Tnsnames entries for new standby

    database

    Startup nomount with pfile

    Run the rman command in other box

    Log File

  • 8/11/2019 11g Dataguard Enhancements

    17/27

    17

    More FeaturesRedo Compression

    } Requires Advanced Compression features

    } Compress redo as it is transmitted data

    }Automatically compress the data as it only resolves gaps

    } Helpful and useful in bandwidth constrained locations

    } Syntax:-} LOG_ARCHIVE_DEST_2=Service=stby Async compression=ENABLE

  • 8/11/2019 11g Dataguard Enhancements

    18/27

    18

    More FeaturesHeterogenous database support

    } Oracle 10g Dataguard support mixed environments 32bit and 64 bitconfiguration

    } Oracle 11G Dataguard supports mixed Windows/Linux in sameconfiguration

    } Only Physical Standby} Same Endianess required on all platforms

    } Metalink : 413484.1

  • 8/11/2019 11g Dataguard Enhancements

    19/27

    19

    More Features: Lost Write Detection

    }Due to hardware or storage issues lost writes can happen while transmissionand blocks may be stale.

    } Very hard to diagnose in such of case of corruption

    } Feature:-

    Compares version of Blocks} Between Standby blocks and redo stream

    } Version discrepancy can be either standby or primary

    If Primary Database block corruption is detected Resolved} Using standby failover and

    } Restore data consistency

    } New Initialization parameter ALTER System set db_lost_write_protect = NONE/TYPICAL/FULL

    5% impact but increase protection

  • 8/11/2019 11g Dataguard Enhancements

    20/27

    20

    More Features: Automatic Block recovery

    } 11g R2 automatically recovers corrupted blocks from standby copies ofblocks

    } Automatic Block Media Recovery also automatically repair corrupted blocksdiscovered in the physical standby databases

    } Reduce recovery time in block corruption cases instead of restoring from

    tape or disks

    } RMAN command RECOVER BLOCK can be used for manual recovery andits check for all suitable or consistent blocks across several copies ofbackups or Clause can be added RECOVER BLOCK EXCLUDE STANDBY then wont

    check in standby

    } Automatic block recovery is applicable only in physical corruptions like} When checksum is invalid} Block contains all zeros} Block header is fractured

  • 8/11/2019 11g Dataguard Enhancements

    21/27

    21

    More Features: Redo Flush

    } Yes, Redo can be flushed

    } Can be done when the primary is in mount mode

    } To avoid minimal loss of data and allowed failover to be performed

    without data loss

    } Syntax:-

    ALTER System FLUSH Redo to

  • 8/11/2019 11g Dataguard Enhancements

    22/27

    22

    More Features: Sync with Primary

    } New command ALTER SESSION SYNC WITH PRIMARY

    WAIT FOR STANDBY TO BE SYNCHRONIZED WITH PRIMARY

    FAILS IF REDO APPLY OR REDO TRANSPORT IS OFFREPORT TRANSPORT AND APPLY LAGS

  • 8/11/2019 11g Dataguard Enhancements

    23/27

    23

    More Features: STANDBY_MAX_DATA_DELAY

  • 8/11/2019 11g Dataguard Enhancements

    24/27

    24

    More Features: ROLE Based services

    }

    Services can be created and start based on the database ROLE, viz a newaddition sys_context (Database ROLE)

    } In R2 services can be attached via srvctl

    } Service can failover when using Cluster or Oracle restart

    } 11gR1 to use triggers based on Database role Example Trigger

  • 8/11/2019 11g Dataguard Enhancements

    25/27

    25

    Rolling Upgrade : Transient Logical StandbyPhysical standby must be converted to Logical Standby and uses Flashback

    as fall out planDowntime for upgrade is only the SWITCHOVER TIME

  • 8/11/2019 11g Dataguard Enhancements

    26/27

    26

    Finally, Monitoring Views

    } GAP_STATUS , additional column in v$archive_destGAP or NOGAP

    } V$dataguard_stats for transport/apply lag

    } V$REDO_DEST_RESP_HISTOGRAM Useful when need to analyse network latencies by checking transport lag

    } V$STANDBY_EVENT_HISTOGRAM

  • 8/11/2019 11g Dataguard Enhancements

    27/27

    Internal 27

    Thank you!

    Q & A