ORACLE 10g DATAGUARD Ritesh Chhajer Sr. Oracle DBA.

Slides:



Advertisements
Similar presentations
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Advertisements

INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Oracle High Availability Solutions RAC and Standby Database Copyright System Managers LLC 2008.
Oracle Architecture. Instances and Databases (1/2)
ITEC474 Control File Maintenance
High Availability Group 08: Võ Đức Vĩnh Nguyễn Quang Vũ
Oracle9i Data Guard Darl Kuhn Sun Microsystems
Backup and recovery Basics of Backup and restoration Types of recovery Defining strategy Starting up and shutting down 80/20 rule SLA’s.
Oracle Data Guard Ensuring Disaster Recovery for Enterprise Data
© 2015 Dbvisit Software Limited | dbvisit.com An Introduction to Dbvisit Standby.
Introduction to Data Guard NY SIG Meeting October 7th, 2003.
1 - Oracle Server Architecture Overview
Backup and Recovery Part 1.
ITEC474 Redo Log Files.
Oracle9i Database Administrator: Implementation and Administration
Redo Waits Kyle Hailey #.2 Copyright 2006 Kyle Hailey Redo REDO Lib Cache Buffer Cache Locks Network I/O.
1 © 2006 Julian Dyke Logical Standby Julian Dyke Independent Consultant juliandyke.com Web Version.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Oracle backup and recovery strategy
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
1 Data Guard Basics Julian Dyke Independent Consultant Web Version - February 2008 juliandyke.com © 2008 Julian Dyke.
Building Highly Available Systems with SQL Server™ 2005 Vineet Gupta Evangelist – Data and Integration Microsoft Corp.
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
Presentation #32050 Presentation #32050 Implementing Oracle9i Data Guard For Higher Availability By Daniel T. Liu First American Real Estate Solutions.
ORACLE 10g DATA GUARD BROKER Ritesh Chhajer Sr. Oracle DBA.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
4 Copyright © 2006, Oracle. All rights reserved. Recovering from Noncritical Losses.
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.
7202ICT – Database Administration
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.
Week 3 Lecture 1 The Redo Log Files and Diagnostic Files.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
8 Copyright © Oracle Corporation, All rights reserved. Configuring the Database Archiving Mode.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
Configuring the Database Archiving Mode
CERN IT Department CH-1211 Genève 23 Switzerland t Using Data Guard for hardware migration.
Implementing Oracle9i Data Guard Michael New Senior Technical Consultant ThinkSpark Session id:
Backup and Recovery Part 2. Online backup Online backup requirements: Backup all data files (file system copy) Backup all redo information produced during.
Overview of Oracle Backup and Recovery Darl Kuhn, Regis University.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
CERN IT Department CH-1211 Genève 23 Switzerland 1 Active Data Guard Svetozár Kapusta Distributed Database Operations Workshop November.
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.
Agenda Data Guard Architecture & Features
SETA Central 2006 Crashes Happen - Downtime Won't with Data Guard Stephen Rea Tuesday, October 10, :30 AM.
© 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.
Copyright  Oracle Corporation, All rights reserved. 3 Oracle Backup and Recovery Configuration.
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.
Oracle Standby Implementation Tantra Invedy. Standby Database Introduction Fail over Solution Disaster Recovery Solution if remote Ease of implementation.
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
Configuring the Database Archiving Mode
Oracle 11g -Snapshot Standby and Active Data Guard
Maintaining Online Redo Log Files
Maximum Availability Architecture Enterprise Technology Centre.
Oracle9i Database Administrator: Implementation and Administration
Understanding the Oracle Data Guard Architecture
Performing Database Recovery
Chapter 5 The Redo Log Files.
Introduction.
Arkansas Banner Users Group (ABUG) 2006
Oracle Data Guard Broker Session-3
Oracle Data Guard Session-4
Presentation transcript:

ORACLE 10g DATAGUARD Ritesh Chhajer Sr. Oracle DBA

 Physical vs. Logical Standby  Standby Protection Modes  Log Transport Attributes  Standby Redo Logs  Setup Physical Standby step-by-step  Managing and Monitoring standby  Role Transition: Switchover/Failover Agenda

Purpose To provide an efficient disaster recovery solution by maintaining transactionally consistent copies of the production database at a remote site. Physical Standby  Kept in sync with the primary by using media recovery to apply redo generated on primary  Used for BCP  Can be opened in read-only mode but redo won’t be applied for that time Logical Standby  Kept in sync with the primary by transforming redo data received from primary into logical SQL statements and then executing those SQLs against the standby database.  Used to offload reporting from the primary database  Can be opened in read-only mode while the changes are being applied. Overview

Decide on Standby Protection Mode before setting it up: 1.MAXIMUM PROTECTION Pre-requisites  Using LGWR SYNC AFFIRM, transport of redo logs to be done in a synchronous fashion.  Standby redo logs (SRLs) need to be created on standby site.  At least one standby must be available for the primary database to function.  Need high speed network. Pros  Zero data loss Cons  Primary shuts down if in case of network issues unable to commit on standby at the same time. Protection Modes

2. MAXIMUM AVAILABILITY Pre-requisites  Using LGWR SYNC AFFIRM, transport of redo logs to be done in a synchronous fashion.  Standby redo logs (SRLs) need to be created on standby site. Features  If network issues, switches to maximum performance and when the fault corrects switches back to maximum availability.  Data loss only if primary loses it’s redo logs. SQL> alter database set standby to maximize availability; 3. MAXIMUM PERFORMANCE  Asynchronous redo shipping using ARC or LGWR ASYNC.  No impact on primary’s performance even if network issues.  No need to create SRLs unless real-time apply is needed on the standby site. Protection Modes

Log Transport Service Attributes are defined on primary in log_archive_dest_2 ARC(default)  ARC will first archive the online redo log to local destination on primary. Then second ARC process spawns and writes the archive to remote standby.  By default, log_archive_local_first=true in init.ora on primary. DO NOT CHANGE IT. LGWR  In contrast to ARC, which transmits redo to standby only at log switch time, LGWR attribute instructs LGWR process to transmit redo to standby at the same time while the redo is writing to the online redo logs.  Transmission of redo can be done synchronously (SYNC) or asynchronously (ASYNC) AFFIRM All Disk I/O at standby to be performed synchronously Log Transport Services

SYNC  By default, LGWR archives synchronously. Once I/O is initiated, archiving must wait for I/O to complete. This means transaction is not committed on primary database until redo data necessary to recover that transaction is received by the destination. ASYNC  LGWR does not wait for the I/O to complete. LGWR network server process(LNS) performs actual network I/O.  User-configurable buffer used to accept outbound redo data from LGWR. ASYNC=20480 indicates a 10MB buffer. Maximum can be upto 50MB. MAX_FAILURE  Defines number of times to retry a destination that has been closed due to a failure NET_TIMEOUT  Used with LGWR ASYNC.  Defines how many seconds to wait before giving up on a network connection. REOPEN  Determines how long the primary waits before retrying a connection Log Transport Services

Creating a physical standby Both primary and standby systems must be identical in configuration with regards to operating system, platform architecture and database version. H/W config may differ. 1. Enable archiving on primary log_archive_dest_1=‘LOCATION= ’ log_archive_format=%t_%s_%r.dbf log_archive_start=true( As of 10g release, its deprecated ) SQL> shutdown immediate; SQL> startup mount; SQL> alter database archivelog; SQL> alter database open; Setup

2. Enable force logging on primary SQL> alter database force logging; This is required as any nologging operations would not be logged within redo stream. In this mode, nologging operations are permitted to run, but changes are placed into redo. 3. Creating password file on primary and standby Create a password file( if not created yet ) orapwd file=orapw password= remote_login_passwordfile=exclusive SYS password must be identical on both primary and standby for log transport services to function. 4. Creating standby controlfile on primary SQL> alter database create standby controlfile as ‘ ’; 5. Take hotbackup of primary and copy datafiles,archivelogs and standby controlfile to standby 6. Create tnsnames.ora aliases for primary and standby on both primary and standby NOTE: DO NOT COPY REDO LOGS SINCE STANDYB WILL CREATE IT’S OWN Setup contd.

7. Prepare init.ora on primary db_name=‘TEST’ db_unique_name=‘PRI’ service_names=‘PRI_SERVICE’ log_archive_config=‘DG_CONFIG=(PRI,STDBY )’ log_archive_dest_1=‘LOCATION= ’ log_archive_dest_state_1=enable log_archive_dest_2=‘SERVICE= ARCH ASYNC reopen=300 max_failure=0 net_timeout=60 VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=STDBY’ log_archive_dest_state_2=enable log_archive_min_succeed_dest=1 log_archive_max_processes=2 standby_file_management=auto fal_server= fal_client= Setup contd.

8. Prepare init.ora on standby db_name=‘TEST’ db_unique_name=‘STDBY’ service_names=‘STDBY_SERVICE’ log_archive_config=‘DG_CONFIG=(PRI,STDBY )’ log_archive_dest_1=‘LOCATION= ’ log_archive_dest_state_1=enable log_archive_dest_2=‘SERVICE= ARCH ASYNC reopen=300 max_failure=0 net_timeout=60 VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=PRI’ log_archive_dest_state_2=enable log_archive_min_succeed_dest=1 log_archive_max_processes=2 standby_file_management=auto fal_server= fal_client= Setup contd.

9. Mount the standby and start applying the changes SQL> startup mount; SQL> alter database recover managed standby database disconnect; To put standby in read-write mode SQL> alter database activate standby database; To stop the apply: SQL> alter database recover managed standby database cancel immediate; To start real time apply: SQL> alter database recover managed standby database using current logfile disconnect; This needs creation on SRLs (standby redo logs) To put standby in read-only mode SQL> alter database recover managed standby database using current logfile disconnect; SQL> alter database open read only; Note: Once the standby is made primary (read-write), verify redo logs and tempfiles. Setup contd.

 On primary check if archive logs are getting copied to standby: SQL> select status from v$archive_dest where dest_id=2;  On Standby monitor MRP process: SQL> select status from v$managed_standby where process like ‘%MRP%’; Status must be “APPLYING_LOG” or “WAIT_FOR_LOG” ps –ef|grep mrp  On standby detect archive gap SQL> select * from v$archive_gap; This will return records if MRP status is “WAIT_FOR_GAP”  With 10gR2, v$dataguard_stats is introduced to monitor redo transport/apply progress; SQL> select value from v$dataguard_stats where name=‘apply lag’; SQL> select value from v$dataguard_stats where name=‘transport lag’;  Note: In case Dataguard is RAC, MRP process would be applying on one of the node. If this node crashes, MRP must be started on that surviving node to which VIP of the crashed node has failed over. Monitoring

Guidelines when creating standby redo logs:  Number of standby redo logs should be the same number as online redo logs plus one.  Standby redo logs should be exactly the same size as the online redo logs.  SRLs should be created on both primary and standby to facilitate seamless role changes.  In a RAC environment, all SRLs should be on a shared disk and may be thread specific.  Used with maximum protection modes and when real-time apply is used. How SRLs work? 1.LGWR process on primary initiates a connection with standby. 2.Standby listener responds by spawning a process called RFS(remote file server) 3.RFS process creates n/w conn with processes on primary and waits for data to arrive. 4.Once data comes, RFS places it into standby redo logs. 5.When log switch occurs on primary, standby redo logs are switched and RFS will go to next available standby redo log. Standby Redo Logs

 Switchover allows a primary and standby to reverse roles without any data loss.  No need to re-create the old primary. Performed for planned maintenance. Steps: 1. Verify if primary can be switched over to standby SQL> select switchover_status from v$database; If value returns “TO_STANDBY”, its alright to switch the primary to standby role. 2. Convert primary to standby SQL> alter database commit to switchover to physical standby; If value is “SESSIONS ACTIVE” from step 1, then SQL> alter database commit to switchover to physical standby with session shutdown; 3. Shutdown the restart the old primary as standby SQL> shutdown immediate; SQL> startup mount; At this point, we now have both databases as standby. 4. On target standby database, verify switchover status. If value is “TO_PRIMARY” then SQL> alter database commit to switchover to primary; If value is “SESSIONS ACTIVE”, then append “WITH SESSION SHUTDOWN” to above command. 5. Shutdown and restart the new primary database SQL> shutdown immediate;startup; SWITCHOVER

 Failover implies data loss and can result in the need to re-create old primary. Steps: 1. Identify and resolve any gaps that may exist on standby. SQL> select * from v$archive_gap; Copy missing archives from primary to standby and register them to standby controlfile. SQL> alter database register physical logfile ‘ ’; 2. If standby redo logs are configured and active, SQL> alter database recover managed standby database finish; If NO SRLs or they are not active, SQL> alter database recover managed standby database skip standby logfile; 3. Convert standby to primary; SQL> alter database commit to switchover to primary; 4. Restart new primary SQL> shutdown immediate;startup; Note: Once the standby is made primary (read-write), verify redo logs and tempfiles. FAILOVER

THANK YOU Get in Touch