Data Guard Basics Julian Dyke Independent Consultant Web
Data Guard Basics Julian Dyke Independent Consultant Web Version - February 2008 © 2008 Julian Dyke juliandyke. com
Agenda u 2 © 2008 Julian Dyke Data Guard u Theory u The Reality juliandyke. com
Data Guard Theory 3 © 2008 Julian Dyke juliandyke. com
Data Guard Reasons for Deployment u 4 Site Failures u Power failure u Air conditioning failure u Flooding u Fire u Storm damage u Hurricane u Earthquake u Terrorism u Sabotage u Plane crash u Planned Maintenance u HUMAN ERROR © 2008 Julian Dyke juliandyke. com
Data Guard Standby Database Primary Database Standby Database Primary Standby Instance Database Site 1 5 © 2008 Julian Dyke Redo Instance Database Site 2 juliandyke. com
Data Guard Physical Standby u u u 6 Physical Standby u Technology introduced in Oracle 7. 2 u Marketed as Data Guard in Oracle 8. 1. 7 and above Standby is identical copy of primary database Redo changes u transported from primary to standby u applied on standby (Redo Apply) Can switch operations to standby u Planned (switchover / switchback) u Unplanned (failover) Failover time dependent on various factors u Rate of redo generation / size of redo logs u Redo transport / apply configuration © 2008 Julian Dyke juliandyke. com
Data Guard Logical Standby u u u u 7 Introduced in Oracle 9. 2 Subset of database objects Redo copied from primary to standby Changes converted into logical change records (LCR) Logical change records applied on standby (SQL Apply) Standby database can be opened for updates u Can modify propagated objects u Can create new indexes for propagated objects May need larger system for logical standby u LCR apply can be less efficient than redo apply u Array updates on primary become single row updates on standby © 2008 Julian Dyke juliandyke. com
Data Guard Protection Modes u 8 Three protection modes: u Maximum protection - zero data loss u Redo synchronously transported to standby database u Redo must be applied to at least one standby before transactions on primary can be committed u Processing on primary is suspended if no standby is available u Maximum availability - minimal data loss u Similar to maximum protection mode u If no standby database is available processing continues on primary u Maximum performance (default) u Redo asynchronously shipped to standby database u If no standby database is available processing continues on primary © 2008 Julian Dyke juliandyke. com
Data Guard Redo Log Shipping u u 9 ARCH background process u Copies completed redo log files to standby LGWR background process - modes are: u ASYNC - asynchronous u Oracle 10. 1 and below u redo written by LGWR to dedicated area in SGA u read from SGA by LNSn background process u Oracle 10. 2 and above u redo written by LGWR to local disk u read from disk by LNSn background process u SYNC - synchronous u Redo written to standby by LGWR - modes are: u AFFIRM - wait for confirmation redo written to disk u NOAFFIRM - do not wait © 2008 Julian Dyke juliandyke. com
Data Guard ARCH Redo Transmission Primary Database RFS 2 LGWR MRP LSP Standby Database HIV E_ DE S T_ Primary Database Standby Database ARC 0 LO G_ AR C Online Redo Log ARC 1 Standby Redo Log ARCn LOG_ARCHIVE_DEST_1 Archived Redo Logs 10 © 2008 Julian Dyke Archived Redo Logs juliandyke. com
Data Guard LGWR (ASYNC) Redo Transmission Primary Database LGWR Online Redo Log Standby Database RFS LNSn ARCn MRP LSP Standby Database Standby Redo Log ARCn LOG_ARCHIVE_DEST_1 Archived Redo Logs 11 © 2008 Julian Dyke Archived Redo Logs juliandyke. com
Data Guard LGWR (SYNC) Redo Transmission Primary Database LGWR LNSn Standby Database RFS Online Redo Log Standby Redo Log ARCn MRP LSP Standby Database LOG_ARCHIVE_DEST_1 Archived Redo Logs 12 © 2008 Julian Dyke Archived Redo Logs juliandyke. com
Data Guard Role Transitions u 13 There are two types of role transition u Switchover u Planned failover to standby database u Original primary becomes new standby u Original standby becomes new primary u No data loss u Can switchback at any time u Failover u Unplanned failover to standby database u Original standby becomes new primary u Original primary may need to be rebuilt u Possible data loss © 2008 Julian Dyke juliandyke. com
Data Guard Switchover Before Switchover Site 1 Site 2 Primary Physical Standby Primary Instance 14 After Switchover Redo Instance Database Primary Database Standby Database Primary Database © 2008 Julian Dyke juliandyke. com
Data Guard Failover Before Failover Site 1 Site 2 Primary Physical Standby Primary Physical Primary Standby Instance 15 After Failover Redo Instance Database Primary Database Standby Database Unavailable Standby Primary Database © 2008 Julian Dyke juliandyke. com
Data Guard Read-Only Mode u 16 Physical standby database can be opened in read-only mode u (Managed) Recovery must be suspended u Reports can use temporary tablespaces u Sorts u Temporary tables u Reports cannot modify permanent objects u Failover times may be affected u Suspended redo must be applied © 2008 Julian Dyke juliandyke. com
Data Guard Delayed Redo Application 17 u Delay in redo application can be configured u Redo is transported immediately u Provides protection against site failure u Redo is not applied immediately u Provides protection against human error u Increases potential failover times u In Oracle 10. 1 and above flashback database can be used as an alternative to delayed redo application © 2008 Julian Dyke juliandyke. com
Data Guard Broker u u u 18 Introduced in Oracle 9. 2 Stable in Oracle 10. 2 and above Managed using DGMGRL utility Contains Data Guard configuration u Additional layer of complexity Used by Enterprise Manager to manage standby Mandatory for some new functionality e. g. u Fast Start Failover © 2008 Julian Dyke juliandyke. com
Data Guard Fast Start Failover Primary Observer Node 1 Standby Node 2 Site 3 19 Database Site 1 Site 2 © 2008 Julian Dyke juliandyke. com
Data Guard Fast Start Failover u u u 20 Detects failure of primary database u Automatically fails over to nominated standby database Requirements include u Flashback logging must be configured u DGMGRL must be used u Observer process running in third independent site u Highly available in Oracle 11. 1 and above u MAXIMUM AVAILABILITY protection mode u Standby database archive log destination must be configured as LGWR SYNC u MAXIMUM PERFORMANCE protection mode u Oracle 11. 1 and above Primary database can potentially be reinstated automatically u Using flashback logs © 2008 Julian Dyke juliandyke. com
Data Guard Fast Start Failover 21 u Advantages u No interconnect network required between sites u No storage network required between sites u RAC licences not required if each site is a single-instance u Disadvantages u Active / Passive u Requires Enterprise Edition licence u Remaining infrastructure must also failover u Network u Application tier u Clients © 2008 Julian Dyke juliandyke. com
Data Guard Oracle 11 g New Features 22 u Snapshot Standby u Standby can be converted to snapshot standby u Can be opened in read-write mode (for testing) u Redo transport continues u Redo apply delayed u Standby can subsequently be converted back to physical standby u Active Data Guard u Separately licensed option u Updates applied to primary u Changes can be read immediately on standby databases u Standby database can be opened in read-only mode u Redo can continue to be applied © 2008 Julian Dyke juliandyke. com
Data Guard Licensing 23 u Standby database nodes must by fully licensed u Same metric as primary (named user, CPU etc) u Standard Edition u Cannot use Data Guard u Use user-defined scripts to transport redo u Use Automatic Recovery to apply redo u Manually resolve archive log gaps u Enterprise Edition u Use Managed Recovery to apply redo u Use Fetch Archive Logging to resolve archive log gaps u Additional licenses required for Active Data Guard © 2008 Julian Dyke juliandyke. com
Data Guard Alternatives 24 u Standard Edition u Manual log shipping using scripts u SAN level Replication technologies u Netapp Snap. Mirror, Metro. Cluster u EMC SRDF, Mirrorview u HP Storage. Works u Redo log replication technologies u Quest Shareplex © 2008 Julian Dyke juliandyke. com
Data Guard The Reality 25 © 2008 Julian Dyke juliandyke. com
Data Guard The Reality 26 u Many sites run physical standbys u Well proven technology u Spare capacity on standby often used for development or testing during normal operations u Relatively few sites run a logical standby u Streams is much more popular u Many sites enable flashback logging u In both development and production environments u Very few using Automatic Failover u Very few sites working with Oracle 11 g yet u Consequently none using Active Data Guard © 2008 Julian Dyke juliandyke. com
Data Guard The Reality 27 u Failover times u Normally dependent on management decisions u Usually some investigation before failover u Time to failover database is minimal (5 -10 minutes) u Time to failover infrastructure can be hours u Network configuration u DNS u Application / web servers u Clients u Failover SLAs often up to 48 hours u Rebuild times u Can take minutes using flashback logging u Can take much longer depending on reason for failover © 2008 Julian Dyke juliandyke. com
Thank you for your interest 28 u References u http: //www. juliandyke. com/References. html u Questions u info@juliandyke. com © 2008 Julian Dyke juliandyke. com
- Slides: 28