CERN IT Department CH-1211 Genève 23 Switzerland www.cern.ch/it 1 Active Data Guard Svetozár Kapusta Distributed Database Operations Workshop November.

Slides:



Advertisements
Similar presentations
ORACLE DATABASE HIGH AVAILABILITY & ORACLE 11GR2 DATA GUARD 1 Güneş EROL.
Advertisements

ITEC474 INTRODUCTION.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Oracle High Availability Solutions RAC and Standby Database Copyright System Managers LLC 2008.
High Availability Group 08: Võ Đức Vĩnh Nguyễn Quang Vũ
AUSOUG National Conference Series g Active Data Guard More than just DR…. Gavin Soorma Senior Oracle DBA, Bankwest.
Oracle Data Guard Ensuring Disaster Recovery for Enterprise Data
© 2015 Dbvisit Software Limited | dbvisit.com An Introduction to Dbvisit Standby.
Data Guard SQL Apply Back to the Future! Larry M. Carpenter Senior Principal Consultant Server Technologies Oracle Corporation Session id:
Keith Burns Microsoft UK Mission Critical Database.
EIM April 19, Robin Weaver 13 Years with IBM Prior to Assignment at UNC Charlotte Range of Database Development/Data Management Projects and Products.
Oracle Data Guard 11g Release 2 with Oracle Enterprise Manager 10g Grid Control
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
Backup and Recovery Part 1.
Chapter 5 Configuring the RMAN Environment. Objectives Show command to see existing settings Configure command to change settings Backing up the controlfile.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
CERN IT Department CH-1211 Genève 23 Switzerland t Recovery Exercise Wrap-up Jacek Wojcieszuk, CERN IT-DM Distributed Database Operations.
Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.
National Manager Database Services
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
Backup & Recovery Concepts for Oracle Database
CERN IT Department CH-1211 Genève 23 Switzerland t Data Protection with Oracle Data Guard Jacek Wojcieszuk, CERN/IT-DM Distributed Database.
ORACLE DATABASE HIGH AVAILABILITY 1. OUTLINE I. Overview Of High Availability II. Oracle Database High Availability Architecture III. Determining Your.
1 Data Guard Basics Julian Dyke Independent Consultant Web Version - February 2008 juliandyke.com © 2008 Julian Dyke.
Administration etc.. What is this ? This section is devoted to those bits that I could not find another home for… Again these may be useless, but humour.
Building Highly Available Systems with SQL Server™ 2005 Vineet Gupta Evangelist – Data and Integration Microsoft Corp.
Oracle Recovery Manager (RMAN) 10g : Reloaded
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
7 Copyright © 2006, Oracle. All rights reserved. Dealing with Database Corruption.
ORACLE 10g DATA GUARD BROKER Ritesh Chhajer Sr. Oracle DBA.
5 Copyright © 2004, Oracle. All rights reserved. Using Recovery Manager.
5 Copyright © 2008, Oracle. All rights reserved. Using RMAN to Create Backups.
Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.
ORACLE 10g DATAGUARD Ritesh Chhajer Sr. Oracle DBA.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
11g(R1/R2) Data guard Enhancements Suresh Gandhi
DB-2: OpenEdge® Replication: How to get Home in Time … Brian Bowman Sr. Solutions Engineer Sandy Caiado Sr. Solutions Engineer.
1 Moshe Shadmon ScaleDB Scaling MySQL in the Cloud.
Daniela Anzellotti Alessandro De Salvo Barbara Martelli Lorenzo Rinaldi.
1 Data Guard. 2 Data Guard Reasons for Deployment  Site Failures  Power failure  Air conditioning failure  Flooding  Fire  Storm damage  Hurricane.
CERN - IT Department CH-1211 Genève 23 Switzerland t Oracle Real Application Clusters (RAC) Techniques for implementing & running robust.
Marcin Blaszczyk, Zbigniew Baranowski – CERN Outline Overview & Architecture Use Cases for Our experience with ADG and lessons learned Conclusions.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.
11g The Perfection of a Masterpiece A presentation about new features of 11g you may not have noticed Christo Kutrovsky The Pythian Group 2007 October.
CERN - IT Department CH-1211 Genève 23 Switzerland t High Availability Databases based on Oracle 10g RAC on Linux WLCG Tier2 Tutorials, CERN,
CERN IT Department CH-1211 Genève 23 Switzerland t Using Data Guard for hardware migration.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
Emil Pilecki Credit: Luca Canali, Marcin Blaszczyk, Steffen Pade.
2 Copyright © 2007, Oracle. All rights reserved. Configuring for Recoverability.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
Virtual Machine Movement and Hyper-V Replica
Agenda Data Guard Architecture & Features
13 Copyright © 2007, Oracle. All rights reserved. Using the Data Recovery Advisor.
© Puget Sound Oracle Users Group Education Is Our Passion PSOUG Education Education Is Our Passion Hands-on Workshop Series Oracle DataGuard 10gR2.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
CERN IT Department CH-1211 Genève 23 Switzerland t Using Data Guard for hardware migration UKOUG RAC & HA SIG, Feb 2008 Miguel Anjo, CERN.
1 Implementing Oracle Data Guard for the RLS database Kasia Pokorska CERN, IT-DB 30 th March 2004.
Oracle 12c Data Guard – Far Sync and what’s new
Agenda Data Guard Architecture & Features
Oracle 11g -Snapshot Standby and Active Data Guard
Maximum Availability Architecture Enterprise Technology Centre.
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
SQL Server High Availability Amit Vaid.
Introduction.
Oracle Data Guard Broker Session-3
Oracle Data Guard Session-4
Presentation transcript:

CERN IT Department CH-1211 Genève 23 Switzerland 1 Active Data Guard Svetozár Kapusta Distributed Database Operations Workshop November 27 th, 2009

CERN IT Department CH-1211 Genève 23 Switzerland 2 Outline Introduction Data Guard Concepts Active Data Guard Real Time Query Performance 11G2 ADG Features Conclusions

CERN IT Department CH-1211 Genève 23 Switzerland 3 Introduction Data Guard plays a key role in the MAA best practices Data Guard automatically maintains standby DB(s) as transactionally consistent copy(ies) of the primary DB by transmitting primary DB redo data to the standby DB(s) applying the redo data to the standby DB(s) If the primary fails, the standby DB can be quickly activated Minimizes downtime for both planned and unplanned outages Primary and standby communicate over Oracle Net Services

CERN IT Department CH-1211 Genève 23 Switzerland 4 Introduction Data Guard Concepts Active Data Guard Real Time Query Performance 11G2 ADG Features Conclusions

CERN IT Department CH-1211 Genève 23 Switzerland 5 Data Guard Concepts 2 types of standby databases: –Physical standby uses Redo Apply to maintain a block for block, exact replica of the primary database. –Logical standby uses SQL Apply and contains the same logical information as the primary database, although the physical organization and structure of the data can be different. Source: Oracle.com

CERN IT Department CH-1211 Genève 23 Switzerland 6 Data Guard Concepts Physical standby DB –Can be used to offload the primary DB of the overhead of performing backups, since it is an exact replica Logical standby database –additional flexibility of being open read-write –additional local tables can be added to the DB –local index structures can be created to optimize reporting or to utilize the standby DB as a data warehouse Source: Oracle.com

CERN IT Department CH-1211 Genève 23 Switzerland 7 Data Guard Transport Services Synchronous redo transport (SYNC) –Primary DB waits for confirmation from the standby that redo has been written to disk before it acknowledges commit success to the application –Provides zero data loss protection –Primary DB performance affected by time required for the standby redo log file I/O to complete and network round-trip time Asynchronous redo transport (ASYNC) –Primary DB acknowledges commit success to the application without waiting for acknowledgment that redo has been received by the standby DB –Almost no performance impact on primary DB –Potential for a small amount of data loss

CERN IT Department CH-1211 Genève 23 Switzerland 8 Data Guard Protection Modes Maximum Protection (SYNC) –Zero data loss, Double failure protection –Stall primary DB until acknowledgement is received from the standby DB Maximum Availability (SYNC) –Zero data loss, Single failure protection –Stall primary DB until acknowledgement is received or NET_TIMEOUT threshold period expires – then resume processing Maximum Performance (ASYNC) –Potential for minimal data loss –Primary DB never waits for standby acknowledgment

CERN IT Department CH-1211 Genève 23 Switzerland 9 Switchover Switchover is a planned, zero data loss operation Guarantees standby data can not be modified independent of primary transactions –No split brain –No data corruptions Redo Apply –Primary drains redo pipe –Standby applies all redo –Flips a bit in the control file –Changes role to primary –Opens standby as primary No bounce required –Done SQL Apply –Primary drains redo pipe –Standby applies all redo –Flips a bit in the control file Turns off the Guard Changes role to Primary –Done

CERN IT Department CH-1211 Genève 23 Switzerland 10 Introduction Data Guard Concepts Active Data Guard Real Time Query Performance 11G2 ADG Features Conclusions

CERN IT Department CH-1211 Genève 23 Switzerland 11 The Active Data Guard option Physical standby DB can be opened read-only while simultaneously receiving updates from the primary Source: Oracle.com

CERN IT Department CH-1211 Genève 23 Switzerland 12 Enabling Active Data Guard Easy to enable: SQL> alter database recover managed standby database cancel; SQL> alter database open read only; SQL> alter database recover managed standby database using current logfile disconnect; Write access possible via network links: SQL> create database link write_testADG connect to sveto identified by test using ‘test11g2'; SQL> insert into values(1,12); 1 row created. SQL> commit; Commit complete.

CERN IT Department CH-1211 Genève 23 Switzerland 13 Data Guard Broker Manage primary and standby(s) from the same interface Simplifies failover and switchover operations In 11G2 – SQL> alter database open read only; –Broker will jump in and automatically stop Redo Apply and the restart it after the open has completed –At switchover, if Active Data Guard in use at the target standby the original primary will be opened when it becomes a standby after the switchover

CERN IT Department CH-1211 Genève 23 Switzerland 14 Checking the Query Lag 11G1 –SCN or V$DATAGUARD_STATS to calculate lag – SQL> SELECT name, value, datum_time, time_computed FROM V$DATAGUARD_STATS WHERE name like 'apply lag'; NAME VALUE DATUM_TIME TIME_COMPUTED apply lag :00:00 10/25/ :14:11 10/25/ :14:11 11R2 view V$STANDBY_EVENT_HISTOGRAM – SQL> SELECT * FROM V$STANDBY_EVENT_HISTOGRAM WHERE NAME = 'apply lag' AND COUNT > 0; NAME TIME UNIT COUNT LAST_TIME_UPDATED apply lag 0 seconds /25/ :20:02 apply lag 1 seconds /25/ :15:09 apply lag 2 seconds 16 10/25/ :20:58 apply lag 3 seconds 4 10/25/ :15:56

CERN IT Department CH-1211 Genève 23 Switzerland 15 Introduction Data Guard Concepts Active Data Guard Real Time Query Performance 11G2 ADG Features Conclusions

CERN IT Department CH-1211 Genève 23 Switzerland 16 Active Data Guard Tests HW: –Primary: 2 RAC nodes, 2 disk arrays –Standby: 2 RAC nodes, 2 disk arrays SW: RHEL 4, Oracle 11G1 and 11G2 beta 2 Installed via RMAN’s “duplicate target database for standby from active database” rman target auxiliary RUN { allocate channel prmy1 type disk; allocate channel prmy2 type disk; allocate auxiliary channel stby type disk; duplicate target database for standby from active database NOFILENAMECHECK spfile set control_files='/tmp/control_stdby.ctl' set db_unique_name='{DB_NAME}_stdby'; } RMAN 11G2 will try to continue where it left off

CERN IT Department CH-1211 Genève 23 Switzerland 17 Measuring algorithm: Loop X times over: Insert N data rows into the primary DB Measure the time it takes that any row appears in the standby DB Repeat the above for: –Varying the number of inserted rows in one transaction from 10 to 10e+7 –1 and 2 nodes of physical standby RAC active –Synchronous and asynchronous REDO transport Repeat all the above after a switchover Active DG Standby Performance

CERN IT Department CH-1211 Genève 23 Switzerland 18 Active DG Standby Performance

CERN IT Department CH-1211 Genève 23 Switzerland 19 Active DG Standby Performance

CERN IT Department CH-1211 Genève 23 Switzerland 20 Active Data Guard Test Results 1 node standby RAC is slightly more performing then a 2 node one Synchronous REDO transport of course outperforms the asynchronous one in these tests Truncate table with a subsequent query on the table on standby gives ORA (normal behavior) Confirmed that the standby DB could be used for read-only at all times Verified the long term stability Performed a quick and smooth switchover

CERN IT Department CH-1211 Genève 23 Switzerland 21 REDO Compression Test Results

CERN IT Department CH-1211 Genève 23 Switzerland 22 Introduction Data Guard Concepts Active Data Guard Real Time Query Performance 11G2 ADG Features Conclusions

CERN IT Department CH-1211 Genève 23 Switzerland G2 DG Features RMAN’s fast incremental backups (11G1) –block change tracking enabled on physical standby Redo Transport –Support for up to 30 standby databases for a single primary database (was 9) Protection –un-sent redo in asynchronous configurations may be flushed to a standby before failover –zero data loss (if failed primary can be brought to mount state) Role Transitions –Redo Apply switchovers no longer require any standby instances to be shut down

CERN IT Department CH-1211 Genève 23 Switzerland 24 Snapshot Standby (11G1) Physical standby DB to be open read-write for testing or any activity that requires a read-write replica of production data. –continues to receive updates generated by the primary, but doesn’t apply them –applied to the standby DB automatically when the Snapshot Standby is converted back to a physical standby DB –Standby must have flashback feature enabled – SQL> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY; –To roll back just restart in mount mode and: SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

CERN IT Department CH-1211 Genève 23 Switzerland 25 Data Guard Rolling Upgrades Standby DBs can be used to perform planned maintenance in a rolling fashion –Objective: upgrade primary and standby to new Oracle version, patchset, bit, Windows Linux, single node -> RAC, migrating to ASM –Using SQL Apply any upgrade from onward –Using Redo Apply –Transient Logical Standby any upgrade from onward –Maintenance first performed on a standby DB –Production switched over to the standby DB when the maintenance tasks are completed –Only downtime is the time needed to effect a switchover operation

CERN IT Department CH-1211 Genève 23 Switzerland 26 ADG service level agreements New session setting STANDBY_MAX_DATA_DELAY NONE (Default) - queries will be executed regardless of the apply lag on that database Non-zero - queries will be executed only if the apply lag is less than or equal to STANDBY_MAX_DATA_DELAY If delay setting exceeded an error is returned – ORA-03172: STANDBY_MAX_DATA_DELAY of 10 seconds exceeded –Application then decides what to do Zero - queries guaranteed to return the exact same result as if the query were issued on the primary database otherwise the ORA is returned –Requires Maximum Availability and Real-Time Apply

CERN IT Department CH-1211 Genève 23 Switzerland 27 Automatic repair of corrupt blocks When Oracle discovers a corruption it marks the block as media corrupt, writes it to disk, and returns an error to the application: – ORA-01578: ORACLE data block corrupted (file # 5, block # 140) With ADG 11R2 the corrupted block on the Active Data Guard primary will be repaired from the standby (and vice versa) Alertlog: – Requesting Auto BMR for (file# 5, block# 140) – Waiting Auto BMR response for (file# 5, block# 140) – Auto BMR successful

CERN IT Department CH-1211 Genève 23 Switzerland 28 Conclusions Active Data Guard is a very promising technology –High Availability –Disaster Recovery –Data Protection –High Performance Finally the standby can be used more than just waiting for the disaster –Open read only –Snapshot standby –Automatic repair of corrupt blocks –Block change tracing (RMAN fast incremental backup) DG easier to set up –RMAN’s duplicate for standby from active We are looking forward to deploy it

CERN IT Department CH-1211 Genève 23 Switzerland 29 Q&A Thank you for your attention