Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Computer viruses
Software corruption Natural disasters
7%
4% 3%
Data Guard
Guaranteed Zero Data Loss
Unplanned Downtime
Flashback
Guaranteed Zero Data Loss
Storage/Net Failures
System Maintenance Planned Downtime Database Maintenance
ASM Mirroring
Storage Failure Protection
Dynamic Reconfiguration
Capacity on Demand without Interruption
Online Redefinition
Adapt to Change Online
Requirements
Data Guard 11g has several options for deploying different CPU architectures, O.S. binaries and Oracle database binaries, on primary and standby systems. For example, the primary database may be on Windows, and the standby database may be on Linux. See MetaLink Note 413484.1 for latest capabilities and restrictions
Bandwidth Requirements
Physical Standby
Protection Modes Physical Standby Architecture Standby Redo Logs Real Time Apply Automatic Resynchronization
Failure Protection
Protects Against Primary Failure
Redo Shipping
LGWR using SYNC
Zero Data Loss as long as the network stays up! Enforces protection of every transaction Configuration: LGWR SYNC If last standby is unavailable, processing continues at primary When the standby becomes available again, synchronization with the primary is automatic
Architecture
Primary database transactions LGWR MRP or LSP (MRP only)
RFS
Standby database
Oracle net
Backup Reports
FAL
ARC0 Archived redo logs
RFS
MRP/LSP
ARC0
Standby database
For Redo Apply: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE When real time apply is enabled, RECOVERY_MODE column in
V$ARCHIVE_DEST_STATUS displays MANAGED REAL TIME APPLY
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=tmstby 2> OPTIONAL LGWR SYNC AFFIRM 3> VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) 4> DB_UNIQUE_NAME=tmstby';
SQL> ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(tmtst,tmstby)' SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY; SQL> SELECT PROTECTION_MODE, PROTECTION_LEVEL FROM V$DATABASE; PROTECTION_MODE PROTECTION_LEVEL ----------------------------------------MAXIMUM AVAILABILITY MAXIMUM AVAILABILITY
Net
LGWR
RFS
ARCH
Standby databases now more closely synchronized with the primary More up-to-date, real-time reporting Faster switchover and failover times Reduces planned and unplanned downtime Better Recovery Time Objective (RTO) for DR
Monitor via
Data Dictionary, OEM, Standby Statspack in 11G
Data Dictionary
V$DATABASE
DATABASE_ROLE: LOGICAL STANDBY, PHYSICAL STANDBY or PRIMARY PROTECTION_LEVEL: current protection mode setting.
V$DATAGUARD_STATS V$DATAGUARD_STATUS
select scn_to_timestamp( (select current_scn from v$database) )-scn_to_timestamp( (select current_scn from v$database@dg) ) from dual;
If you do not wish to connect to the Primary -determine the value for APPLY LAG for a best estimate
Use Enterprise Manager monitoring
Automatic Resynchronization Network connectivity problems may occur Data Guard automatically resynchronizes standbys after network connectivity restored Implicit ARCH process idling away on the primary pings all standbys on a regular basis to see if they are missing any redo data If so it sends them the missing redo data Explicit Gap discovered during apply process in physical standby Based on FAL_SERVER and FAL_CLIENT settings, primary notified, and it sends missing redo data
Failover
Unplanned role reversal Use in emergency Zero or minimal data loss depending on choice of data protection mode
Different steps for Physical and Logical Standby Switchover using Enterprise Manager is literally two mouse clicks Well do a Physical Standby Failover via the command line using the Broker
Fast-Start failover
Makes Data Guard more than a Standby Database. Enables automatic failover with no data loss.
Fast-Start Failover
1. Data Guard in steady state transmitting redo 2. Observer monitoring state of the configuration
Fast-Start Failover
Fast-Start Failover
4. Observer times out 5. Observer validates connection with target standby 6. Observer begins Fast-Start Failover
Fast-Start Failover
Fast-Start Failover
8. After old primary is repaired, Observer re-establishes connection 9. Observer automatically reinstates old primary to be a new standby 10. Redo transmission starts from new primary to new standby
Database conditions:
Server crash or shutdown (without db shutdown) Database instance failure (or last instance failure in a RAC configuration) Shutdown abort (or shutdown abort of the last instance in a RAC configuration) Datafiles taken offline due to I/O errors
Network conditions:
When both the Observer and the standby database lose their network connection to the primary database, and when the standby database
confirms that it is in a synchronized state.
Reliable
Eliminates human error Zero data loss failover
Simple
Automatically determines if failover criteria is met Original primary database is automatically reinstated as a new standby database following failover
Fast-Start failover
Requirements Fast-Start Failover is a feature of Oracle Data Guard, and can't run without a Data Guard Broker configuration! Observer machine and configuration Special entry in Data Guard Broker configuration
Demo: Switchover
1. Configure Broker and Fast_Start Failover 2. Configure Observer 3. Shutdown abort on the primary database TMTST 4. Wait until Fast_Start occurs on TMSTBY 5. Restart the old primary TMTST 6. Verify that observer reinstates database TMTST
Broker Parameters: SQL> ALTER SYSTEM SET DG_BROKER_CONFIG_FILE1 ='+TVBSDG1/dr1tmstby.dat; SQL> ALTER SYSTEM SET DG_BROKER_CONFIG_FILE2 ='+TVBSDG1/dr2tmstby.dat; SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE;
Demo: Switchover
DGMGRL> SWITCHOVER TO tmstby; ------ duration 90 seconds! Performing switchover NOW, please wait... Operation requires shutdown of instance "tmtst" on database "tmtst" Shutting down instance "tmtst"... ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires shutdown of instance "tmstby" on database "tmstby" Shutting down instance "tmstby"... ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires startup of instance "tmtst" on database "tmtst" Starting instance "tmtst"... ORACLE instance started. Database mounted. Operation requires startup of instance "tmstby" on database "tmstby" Starting instance "tmstby"... ORACLE instance started. Database mounted. Switchover succeeded, new primary is "tmstby"
Verify on both
SELECT DATABASE_ROLE,STATUS,DB_UNIQUE_NAME, PROTECTION_MODE, PROTECTION_LEVEL, SWITCHOVER_STATUS, checkpoint_change#, current_scn ,STANDBY_BECAME_PRIMARY_SCN, FS_FAILOVER_STATUS, FS_FAILOVER_CURRENT_TARGET,
FS_FAILOVER_THRESHOLD, FS_FAILOVER_OBSERVER_PRESENT,
FS_FAILOVER_OBSERVER_HOST FROM V$DATABASE
THANK YOU
Thinus.Meyer@vodacom.co.za http://martinmeyer.blogspot.com