Internals of Active Dataguard. Saibabu Devabhaktuni

Similar documents
ORACLE 11gR2 DBA. by Mr. Akal Singh ( Oracle Certified Master ) COURSE CONTENT. INTRODUCTION to ORACLE

Oracle Database 11g: SQL Fundamentals I

How to Minimize Brownouts in Oracle RAC Reconfiguration Session ID# UGF9795. Amit K Das PayPal

Data Guard. Author & Presenter: Nassyam Basha Date: 27-FEB-2015

Copyright 2012, Oracle and/or its affiliates. All rights reserved.

Oracle Database 12c: OCM Exam Preparation Workshop Ed 1

Data Guard Deep Dive

Oracle Architectural Components

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including:

Oracle Database 11g Data Guard

Data Guard: Setup and Administration. By Ashok Kapur Hawkeye Technology, Inc.

1Z Upgrade Oracle9i/10g to Oracle Database 11g OCP Exam Summary Syllabus Questions

Projects. Corporate Trainer s Profile. CMM (Capability Maturity Model) level Project Standard:- TECHNOLOGIES

Oracle DBA Course Content

Physical Standby Design concepts and practices. Dresdner-Cetelem Kreditbank, 1. Februar 2010, Seite 1

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into

Exam 1Z0-061 Oracle Database 12c: SQL Fundamentals

Steps Create Physical Standby Database Oracle 9i

ORACLE DATA GUARD REAL WORLD EXAMPLES AND TROUBLESHOOTING

Oracle. 1z Oracle Database 11g- New Features for Administrators.

Oracle - Oracle Database 12c: OCM Exam Preparation Workshop Ed 1

Oracle Database 11g for Experienced 9i Database Administrators

<Insert Picture Here> DBA Best Practices: A Primer on Managing Oracle Databases

Eternal Story on Temporary Objects

Oracle Database 10g: New Features for Administrators Release 2

ORANET- Course Contents

Oracle 1Z0-053 Exam Questions and Answers (PDF) Oracle 1Z0-053 Exam Questions 1Z0-053 BrainDumps

Oracle. Exam Questions 1Z Oracle Database 11g: Administration I. Version:Demo

Scale out Read Only Workload by sharing data files of InnoDB. Zhai weixiang Alibaba Cloud

Question No : 1 Which three statements are true regarding persistent lightweight jobs? (Choose three.)

LOGGING OR NOLOGGING THAT IS THE QUESTION. By: Francisco Munoz Alvarez

Exadata Implementation Strategy

Explore the Oracle 10g database architecture. Install software with the Oracle Universal Installer (OUI)

Oracle 1Z Oracle 9i: New Features for Administrators. Download Full Version :

Tips and Tricks on Successful Upgrade to 11gR2

Oracle Database 12C: Advanced Administration - 1Z0-063

Oracle Tuning. Ashok Kapur Hawkeye Technology, Inc.

Oracle 12c Features You Should Know. Arup Nanda Longtime Oracle DBA

Oracle Database 12c R2: New Features for 12c R1 Administrators Ed 1

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Oracle DBA workshop I

Copyright 2018, Oracle and/or its affiliates. All rights reserved.

<Insert Picture Here> Controlling resources in an Exadata environment

Oracle Database 12c: RAC Administration Ed 1

COURSE CONTENT. ORACLE 10g/11g DBA. web: call: (+91) / 400,

Oracle Database 12c: New Features for Administrators Duration: 5 Days

Incrementally Updating Backups Tips and Tricks

Oracle Database 11g: Administration I

1-2 Copyright Ó Oracle Corporation, All rights reserved.

IT100: Oracle Administration

Oracle Database 12c: New Features for Administrators NEW

Oracle 1Z0-053 Exam Questions & Answers

Oracle Database 18c and Autonomous Database

1Z Upgrade to Oracle Database 12cm Exam Summary Syllabus Questions

ORACLE DBA TRAINING IN BANGALORE

SQL (Structured Query Language)

1z z0-060 Upgrade to Oracle Database 12c

<Insert Picture Here> Looking at Performance - What s new in MySQL Workbench 6.2

Oracle Database 12c: New Features for Administrators Ed 2 NEW

Oracle 1Z Oracle Database 10g: Administration II. Download Full Version :

Oracle Database 12c R1: New Features for Administrators Ed 2

Oracle Active Data Guard - Overview

Oracle Database 12c R2: New Features for Administrators Part 2 Ed 1

InnoDB: What s new in 8.0

Oracle Database Performance Tuning, Benchmarks & Replication

Eliminating Downtime When Migrating or Upgrading to Oracle 10g

Moving Databases to Oracle Cloud: Performance Best Practices

The Oracle DBMS Architecture: A Technical Introduction

Oracle Database 12c R2: New Features for Administrators Part 2 Ed 1 -

DumpsKing. Latest exam dumps & reliable dumps VCE & valid certification king

InnoDB: Status, Architecture, and Latest Enhancements

Oracle 12C Administration Course Content:

Oracle Database 12c: RAC Administration Ed 1 LVC

Oracle Database 11g: New Features for Oracle 9i DBAs

Oracle Database 12c: Backup and Recovery Workshop Ed 2 NEW

Expert Oracle GoldenGate

1z0-043 Oracle Database 10g: Administration II

Oracle Database 10g : Administration Workshop II (Release 2) Course 36 Contact Hours

Re-platforming the E-Business Suite Database

PolarDB. Cloud Native Alibaba. Lixun Peng Inaam Rana Alibaba Cloud Team

Oracle Database 12c: Dataguard Administration

Automating Information Lifecycle Management with

ORACLE 12C NEW FEATURE. A Resource Guide NOV 1, 2016 TECHGOEASY.COM

Oracle Database 11g: Administration Workshop II

<Insert Picture Here> New MySQL Enterprise Backup 4.1: Better Very Large Database Backup & Recovery and More!

Course Contents of ORACLE 9i

<Insert Picture Here> Exadata MAA Best Practices Series Session 1: E-Business Suite on Exadata

You'll even like your Data Guard more with Flashback

Real Value of Oracle Database Health Checks. J a n

Oracle Database 12c Release 2

Oracle Multitenant What s new in Oracle Database 12c Release ?

DOC ORACLE STANDBY USER MANUAL ARCHIVE

Oracle 1Z0-497 Exam Questions and Answers (PDF) Oracle 1Z0-497 Exam Questions 1Z0-497 BrainDumps

Essential (free) Tools for DBA!

Oracle Database 11g: Self-Managing Database - The Next Generation

Course Outline: Oracle Database 11g: Administration II. Learning Method: Instructor-led Classroom Learning. Duration: 5.

Oracle Exadata Implementation Strategy HHow to Implement Exadata In-house

Exadata Implementation Strategy

<Insert Picture Here> Oracle MAA und RAC Best Practices und Engineered Systems

Converting to Transparent Data Encryption with Oracle Data Guard using Fast Offline Conversion Oracle Database 12.1 and Oracle Database 11.

Transcription:

Internals of Active Dataguard Saibabu Devabhaktuni

PayPal DB Engineering team Sehmuz Bayhan Our visionary director Saibabu Devabhaktuni Sr manager of DB engineering team http://sai-oracle.blogspot.com (blog) Kyle Towle It can t get any better, expert at DB and Systems architecture, scalability, and availability. Amit Das One of the very few RAC/Exadata experts in the world Dong Wang Worlds best Goldengate expert John Kanagaraj Coauthored "Oracle Database 10g : Insider Solutions and Oracle ACE. Sarah Brydon One of the very few Oracle Certified Masters. 2

Scope This presentation is applicable for Oracle 11.2.0.2 Some of the observations made here may be incorrect, please verify it in your environment prior to using any recommendations. 3

Agenda Redo apply mechanism Read only queries State of the standby Testing applications for Active Dataguard (ADG) 4

Redo apply on primary Read data block buffers in current mode Generate redo for intended change in PGA Redo generated for undo and data blocks Copy redo from PGA to redo buffer Check block for SCN and seq prior to redo apply Apply redo to undo and data blocks Redo record contains change vectors for undo and data blocks 5

Redo apply on standby MRP process read redo typically in chunks of 1MB MRP process sort the redo in SCN order Assign redo to be applied to recovery slaves (probably by hash of data blocks) Recovery slave use asynch I/O calls up to 32 blocks in a batch Total outstanding asynch I/O calls per recovery slave can be up to 1024 in 11g (used to be 4K in 10g) Keep applying redo to the blocks available in SGA Rely on 2 nd pass redo apply for blocks not in SGA 6

Redo shipping Redo shipping from primary is done in streaming mode for LGWR SYNC/ASYNC Check Redo KB read* values in v$sysstat Redo to be shipped can be compressed Query v$standby_log for status of real time redo shipping Make sure to create standby logfiles on primary Watch out for case sensitive password in orapwd file across the primary and standby 7

Redo apply metrics Query v$managed_standby for MRP progress Current_scn, standby_max_data_delay and v$recovery_progress rely on same underlying memory structure Check for recovery read and checkpoint complete wait events in ash and v$event_histogram Check for apply time and checkpoint time per log in v$recovery_progress Query current_scn in v$database or v$dataguard_stats for standby lag [1] 8

Checkpoint on standby Mandatory checkpoint at every log boundary Recovery slaves wait on log boundary checkpoint No redo apply during log boundary checkpoint Incremental recovery checkpoints keep log boundary checkpoint duration smaller Checkpoint performed prior to stopping MRP Parameters _defer_log_boundary_ckpt and _defer_log_count define the behavior (not fully implemented in 11g) Recovery until consistent required after crash of ADG 9

Redo apply on RAC MRP process read redo in chunks from all threads MRP process merge all the redo and sort it Only one instance apply the redo at a time MRP may wait if we redo is not arrived for any thread MRP process reading redo can t be parallelized Log boundary checkpoint performed for each thread 10

Redo apply contd. New datafile creation on standby is done by single recovery slave while rest of the slaves wait for it Redo apply stop if new datafile creation fails Failed datafile creation can be recreated manually while ADG is still open and MRP stopped MRP acquires MR type lock on all online datafiles Offline or online of a datafile require MRP to stop Partial standby is supported but not integrated with MRP 11

More on redo apply No redo on primary for commit time block cleanouts unless _log_committime_block_cleanout is set Nologging on primary causes effected blocks to be corrupted on standby Corrupted datafiles on standby can be detected by running dbv or rman Flashback on standby works just like on primary Apply patch 10094823 on 11.2.0.2 and below prior to using block change tracking on the standby 12

Optimizing redo apply Use parallel redo apply (default in 11g and beyond) Set parallel_execution_message_size to 65536 Use fewer DB writer processes and parallel recovery processes if I/O latency is a true bottleneck Match SGA size to primary if possible Keep redo log file size as big as possible but make sure to meet recovery point objectives on primary Use same redo log file size across all RAC nodes Use real time apply (be aware of bug 5956646, RTA can leave standby in unrecoverable state) [1] 13

Reads on ADG 50% of buffer cache reserved for reads in ADG (as defined by _recovery_percentage ) Row cache structures built on standby like primary DDL invalidations to happen like on primary Current_scn in v$database used for query SCN Buffers in recovery state (5) can be used for reads Buffer clones happen like on primary (state 3 or state 2, shared current, in RAC used for consistent reads) 14

Role of Undo Undo is used for consistent reads like on primary Redo for data and corresponding undo applied separately Undo block not in SGA could delay redo apply Query reading data block buffer wait for corresponding undo block to be current with the SCN No select for update operations permitted as it requires changes to transaction table and data blocks 15

Commit time block cleanout Query process perform block cleanout for each execution New buffer clone for each execution No block cleanout in current or recovery state buffers Blocks cleaned out on standby never written to disk Ora_rowscn will be different for each execution Demo 16

Read only tables Cleanouts happen just like for read write tables Since table is already made read only on primary, cleanouts on standby continue to happen for each query execution forever Same thing can happen for objects under read only tablespaces Parallel queries also incur same overhead and they typically perform block cleanouts in PGA Work around is to perform full cleanout on primary prior to making table or tablespace read only 17

More on reads DDL invalidation issue for synonyms on standby (demo) Set _log_committime_block_cleanout to TRUE on primary if possible, redo overhead is less than 5%. Any queries requiring recompilation of objects like views, procedures will fail. Any user login which require update to user$ will fail (i.e. password expiry time, etc) 18

Read performance metrics V$ views populated like on primary Setup standby statspack to persist data from v$sql, ASH, and other views Oracle can t persist query column predicate information to col_usage$ and it may effect query plans based on how stats are gathered Not possible to set system statistics like CPU or I/O speed on ADG Some of the enhancements to sql plan related features which require data to be persisted will not work on ADG 19

Standby state By design, not all control file changes make it to the standby Supplemental logging can be different on standby Supplemental log level can be different on standby Goldengate and logical standby may not work properly post switchover DG switchover doesn t report these control file changes Make it part of pre switchover checklist 20

Standby state Force logging can be different on standby Batch jobs may perform nologging activity and hence it can invalidate former primary post DG switchover Flashback state can be different on standby Flashback state can be different at tablespace level Flashback files should not be copied over, they are valid for a given database only Fix is to run same alter database commands on the standby or refresh standby control file from primary 21

Standby state Control file contents can be significantly different on standby, especially if RMAN is used [1] Don t rely on unrecoverable columns in v$datafile (as they are not updated by design) Temp files can be different on standby More temp files can be created on standby GG extract will not work on ADG with ASM Redo apply instance crash triggers other RAC nodes to shutdown 22

Lost writes Lost writes can happen on primary and standby Recommended to set DB_LOST_WRITE_PROTECT Not all lost writes can be detected by above parameter DB_LOST_WRITE_PROTECT relies on the assumption effected blocks will be eventually read Most of the lost writes happen outside of Oracle code No easy way to check for lost writes 23

Manual checks for lost writes Blocks across primary and standby can t be binary compared even if they are at same SCN Data can be compared at same SCN Use sum of ora_hash on all records at block or segment level Ora_rowscn can t be used for comparison Indexes can be checked by computing hash of all key columns using index fast full scan and repeat it with full table scan at same SCN Run rman backup validate check logical for non lost write corruption 24

Testing application for ADG Test application for benefits of ADG prior to purchasing ADG license option Query percentage of read only queries versus read write in ASH by XID column Dba_hist_active_sess_history can also be queried Select for update queries need to be flagged Check MOS note 1206774.1 for event 3177 Event 3177 only log violations in trace file spare statistic 1 in v$sysstat also report violations 25

QA testing without ADG QA testing for ADG doesn t have to use ADG in QA Create separate user (if possible) for read only flow Create a dual like dummy table with primary key Insert one row in dummy table and make it read only Create view joining dummy table with live table Create synonym for view if necessary All DML s will fail as required for ADG test Demo 26

Enhancing ADG ER, 13719619, for ability to test read only apps ER, 12781212, for parallelizing datafile creation Parameter _log_committime_block_cleanout set to TRUE by default to reduce number of cleanouts No mandatory log boundary checkpoint Integrate MRP for partial standbys (needed on RAC) ER, 12802025, for RMAN to check datafiles across primary and standby (for lost write detection) 27

Summary ADG is one of the best Oracle products Redo apply keeps getting better Better read traffic option than Goldengate More block cleanout s on ADG, but impact is low Lost write detection needs to be supplemented Key database properties (i.e. nologging, supplemental logging, etc) can be different on ADG Partial standby possible for consolidated primary databases 28