11g(R1/R2) Data guard Enhancements Suresh Gandhi

  • View
    216

  • Download
    1

Embed Size (px)

Text of 11g(R1/R2) Data guard Enhancements Suresh Gandhi

  • 11g(R1/R2) Data guard EnhancementsSuresh Gandhi

    Internal

    }

    Agenda

    What is DATA GUARD ?Types of Data Guard Databases11g Release 1 Enhancements11g Release 2 EnhancementsActive Data guardSnapshot Standby DatabaseMore FeaturesRolling Upgrade and Physical StandbyQ&A

    Internal

    }

    Data Guard Overview

    Data Guard

    Standby Plus more

    High Availability & Disaster Recovery Solution

    Internal

    }

    Provides .

    Internal

    }

    Data guard Databases

    Internal

    }

    11G R1 EnhancementsRelease 1 NewFeatures

    Internal

    }

    R2 - EnhancementsRelease 2 NewFeatures

    Internal

    }

    R2- New FeaturesRelease 2 NewFeatures

    Internal

    }

    Active and Snapshot StandbyTraditional Functionality until 10g11g Active DataGuard11g Snapshot Standby

    Internal

    }

    Active Data Guard Benefits

    Internal

    }

    Turn on Physical Standby to Active StandbyStop redo applyDatabase in standby mount modeOpen readonlyOpen mode changed to read onlyStart the redo apply again using log file (SRLs)Status changed to read only apply

    Internal

    }

    Turn on Physical Standby to Snapshot StandbyOnce sync check, convert standby to snapshotOpen databaseRead write mode Need to close databaseSwitched back to physical standby

    Internal

    }

    Additional Info Active / Snapshot

    WHAT OPERATION ALLOWED IN ACTIVE DATA GUARD ? SELECT statements Complex queries Calling of stored procedures Use of database links to redirect DML to Primary Use of stored procedures to call remote stored procedures via database links Use of SET ROLE Use of ALTER SESSION and ALTER SYSTEM No Datatypes restrictions like Logical Standby Additional TEMPFILES can be created for Sorts Flashback Query : SELECT AS OF Additional LicenseSOME IMPORTANT POINTS FOR SNAPSHOT STANDBY DATABASEPHYSICAL STANDBY DATABASE SHOULD BE IN FLASHBACK MODE NO REAL TIME QUERY OR DATA NO FAST START FAILOVER IN THIS MODE NO SWITCHOVER/FAILOVER UNTIL CONVERTED TO PHYSICAL STANDBY Free of LicencePOINTS Configure the Flash Recovery Area Set the Retention Target Enable Flashback Database

    Internal

    }

    10g Equivalent Snapshot commandsPrepare the physical standby database to be activatedSQL> 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;

    Internal

    }

    DATGUARD Still More Features

    Internal

    }

    More Features RMAN Active database DuplicationRMAN> 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 database spfileparameter_value_convert 'emrep','repstby'set db_unique_name='repstby'set db_file_name_convert='C:\','F:\'set log_file_name_convert='C:\','F:\';}

    StepsCreate a pfile with only db_name=stbyCreate directory structure for datafile locationsCreate directory structure for dump locationsCreate a password file (must match with target)Listener & Tnsnames entries for new standby databaseStartup nomount with pfileRun the rman command in other box

    Log File

    Internal

    }

    More Features Redo Compression

    Requires Advanced Compression featuresCompress redo as it is transmitted dataAutomatically compress the data as it only resolves gapsHelpful and useful in bandwidth constrained locationsSyntax:-LOG_ARCHIVE_DEST_2=Service=stby Async compression=ENABLE

    Internal

    }

    More Features Heterogenous database supportOracle 10g Dataguard support mixed environments 32bit and 64 bit configuration

    Oracle 11G Dataguard supports mixed Windows/Linux in same configurationOnly Physical StandbySame Endianess required on all platforms

    Metalink : 413484.1

    Internal

    }

    More Features: Lost Write DetectionDue to hardware or storage issues lost writes can happen while transmission and blocks may be stale.

    Very hard to diagnose in such of case of corruption

    Feature:-Compares version of BlocksBetween Standby blocks and redo streamVersion discrepancy can be either standby or primaryIf Primary Database block corruption is detected ResolvedUsing standby failover andRestore dataconsistency

    New Initialization parameterALTER System set db_lost_write_protect = NONE/TYPICAL/FULL5% impact but increase protection

    Internal

    }

    More Features: Automatic Block recovery11g R2 automatically recovers corrupted blocks from standby copies of blocks

    Automatic Block Media Recovery also automatically repair corrupted blocks discovered 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 and its check for all suitable or consistent blocks across several copies of backups or Clause can be added RECOVER BLOCK EXCLUDE STANDBY then wont check in standby

    Automatic block recovery is applicable only in physical corruptions likeWhen checksum is invalidBlock contains all zerosBlock header is fractured

    Internal

    }

    More Features: Redo FlushYes, 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

    Internal

    }

    More Features: Sync with PrimaryNew command ALTER SESSION SYNC WITH PRIMARYWAIT FOR STANDBY TO BE SYNCHRONIZED WITH PRIMARYFAILS IF REDO APPLY OR REDO TRANSPORT IS OFF REPORT TRANSPORT AND APPLY LAGS

    Internal

    }

    More Features: STANDBY_MAX_DATA_DELAY

    Internal

    }

    More Features: ROLE Based servicesServices can be created and start based on the database ROLE, viz a new addition 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 roleExample Trigger

    Internal

    }

    Rolling Upgrade : Transient Logical Standby Physical standby must be converted to Logical Standby and uses Flashback as fall out planDowntime for upgrade is only the SWITCHOVER TIME

    Internal

    }

    Finally, Monitoring ViewsGAP_STATUS , additional column in v$archive_dest GAP or NO GAP

    V$dataguard_stats for transport/apply lag

    V$REDO_DEST_RESP_HISTOGRAMUseful when need to analyse network latencies by checking transport lag

    V$STANDBY_EVENT_HISTOGRAM

    Internal

  • Thank you!

    Q & A

    Internal

    The FAILGROUP_TYPE column in both the V$ASM_DISK and V$ASM_DISK_STAT views specifies failure group type. The value for this column is REGULAR for regular failure groups and QUORUM for quorum failure groups.