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

Similar documents
Active Data Guard Hands On Lab. Larry M. Carpenter Distinguished Product Manager

Data Guard: Additional Benefits apart from DR

Internals of Active Dataguard. Saibabu Devabhaktuni

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

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

ORACLE DATA GUARD REAL WORLD EXAMPLES AND TROUBLESHOOTING

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

Oracle Database 11g: SQL Fundamentals I

1Z Oracle Database 12c - Data Guard Administration Exam Summary Syllabus Questions

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

ORACLE DBA TRAINING IN BANGALORE

Oracle Active Data Guard - Overview

Oracle Database 11g for Experienced 9i Database Administrators

Oracle Database 12c: Dataguard Administration

Oracle Database 12c: OCM Exam Preparation Workshop Ed 1

Question No: 1 Which two statements are true for Data Guard environments with multi-tenant databases?

Oracle Database 12c: Data Guard Administration

Oracle 12c Dataguard Administration (32 Hours)

Oracle Database 11g Data Guard

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

Steps Create Physical Standby Database Oracle 9i

ASM BASED TABLESPACES BACKUP WITH RMAN FOR LONG TERM OFFLINE STORING

Data Guard Deep Dive

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

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

Oracle Performance Tuning. Overview of performance tuning strategies

DataGuard in Practice

Tablespace Usage By Schema In Oracle 11g Query To Check Temp

Tips and Tricks on Successful Upgrade to 11gR2

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

Oracle Database 12c: Data Guard Administration LVC

Tablespace Usage By Schema In Oracle 11g Rac

Oracle Database 12c: New Features for Administrators NEW

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

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

Oracle Database 11g: Data Guard Administration

LOSS OF FULL DATABASE AND DATABASE RECOVERY ORACLE 11g

Oracle 1Z Oracle Database 12c: Data Guard Administration. Download Full version :

FLASHBACK RAC DATABASE TO RESTORE POINT Y. MORAN

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

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

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

Oracle 1Z Oracle Database 11g- Administrator I. Download Full Version :

Oracle 1Z0-053 Exam Questions & Answers

Author A.Kishore

Enterprise Manager: Scalable Oracle Management

Using Oracle STATSPACK to assist with Application Performance Tuning

Oracle Database Vault

You'll even like your Data Guard more with Flashback

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

Oracle12c Release 1 New Features for Administrators (5 Days)

Oracle Data Guard in Oracle Database 10g Release 2 Business Continuity for the Enterprise. An Oracle White Paper November 2006

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

Oracle RMAN for Absolute Beginners

Oracle Database 12c: Administration Workshop Duration: 5 Days Method: Instructor-Led

High Availability Options for Oracle Database

Disaster Recovery: Restore Database from One Server to another Server when Different Location

CO Oracle Database 11g: Data Guard Administration

Mike Hughes Allstate Oracle Tech Lead, Oracle Performance DBA

What s New with Oracle Data Pump in Oracle Database 12c. Dean Gagne Consulting Member of Technical Staff

ORANET- Course Contents

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

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

How To Reduce Temp Tablespace Size In Oracle 11g

An Oracle White Paper April Deploying Oracle Data Guard with Oracle Database Appliance

Software Development & Education Center

PASS4TEST 専門 IT 認証試験問題集提供者

Eternal Story on Temporary Objects

Oracle 11g Data Guard Manual Failover Steps

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

Moving Databases to Oracle Cloud: Performance Best Practices

Oracle 1Z Oracle Database 11g: Administration I. Download Full Version :

enterprise professional expertise distilled Implementer's guide Oracle GoldenGate 11g

[Contents. Sharing. sqlplus. Storage 6. System Support Processes 15 Operating System Files 16. Synonyms. SQL*Developer

How To Apply Archive Logs Manually In Standby Database Using Rman

Oracle Database 10g: New Features for Administrators Release 2

Oracle Database 12c: Administration Workshop Ed 2 NEW

TestsDumps. Latest Test Dumps for IT Exam Certification

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

What is wrong with PostgreSQL? OR What does Oracle have that PostgreSQL should? Richard Stephan

Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12

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

Oracle Real Application Clusters Handbook

Partial Backup Interview Questions And Answers In Oracle 11g

Oracle Database 10g: New Features for Release 2 Overview Seminar

Oracle10g Data Guard: Back to the Future

1z z0-060 Upgrade to Oracle Database 12c

"Charting the Course... Oracle 12c New Features for Administrators. Course Summary

Oracle Data Guard Concepts and Administration. 12c Release 2 (12.2)

MySQL for Database Administrators Ed 4

Oracle Database 12c: Administration Workshop Ed 2

Oracle Database 12c: Administration Workshop Ed 2

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

supporting Oracle products. An OCA credential is available for several of today s most in -demand technology job roles. OCA & OCP Requirement

Oracle Data Guard. Concepts and Administration 11g Release 1 (11.1) B

SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability

Oracle DBA workshop I

Actual4Test. Actual4test - actual test exam dumps-pass for IT exams

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

Maximum Availability Architecture. Oracle Best Practices for High Availability. Reducing Siebel Downtime with a Local Standby Database

Transcription:

Under The Hood of Active Data Guard Author & Presenter: Nassyam Basha Date: 27-FEB-2015

Nassyam Bashaa Post Graduation in computers from University of Madras Oracle Database Consultant @ Pythian Frequent OTN contributor (CKPT) /MOSC certified GURU Co-Author of Oracle 11gR2 Data Guard administration beginners Guide Blogger Author of OTN Articles 11g Oracle Certified Master Co-Founder of @nassyambasha /nassyambasha 2 2014 Pythian

Under The Hood of Active Data Guard Data Guard vs. Active Dataa Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby Applications & ADG 3 2014 Pythian

Data Guard vs. Active Dataa Guard Data Guard Resources are locked Stale results by opening standby in read-only after MRP termination. Active Data Guard Additional License for the usage of Activ ve Data Guard from 11g Improves performance of Primary by offloading queries, reporting with real-time data Complex queries, Sorting, Web-based access while redo apply Read-Only applications Best suits for Enquiries, Tracking statuss (No DML/DDL) Unlocks the resources (System, Storage.) 4 2014 Pythian

Active Data Guard Oracle Net PRIMARY DATABASE LGWR NSS/ NSA RFS STANDBY DATABASE ORL s SRL s ARC H ARC H 5

Data Guard Real Time apply is applicable No Real-Time Queries, Database will be in Mount Status 6 2014 Pythian

Under The Hood of Active Data Guard Data Guard vs. Active Data Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby & Applications Applications & ADG 7 2014 Pythian

Set up of ADG Compatible=11.0.0 Ensure Real-Time apply is On. Uncomplicated procedure Broker manages everything to bounce MRP Standby can be RAC or non-rac and Broker is supported. 8

Under The Hood of Active Data Guard Data Guard vs. Active Data Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby & Applications Applications & ADG 9 2014 Pythian

Real Time Query Here you go 10

Real-Time Query Validation Monitoring data apply on standby database to track real-time apply 11

Real-Time Query Test No scope for the stale data 12

Guarantee Data Currency SESSION_MAX_DATA_DELAY parameter applicable only for non-administrator users Session specific apply lag tolerance If session_max_data_delay set to None, query results regardless of the apply lag with primary database. Standby SQL> connect c##nassyam/oracle@india; Connected. SQL> alter session set standby_max_data_delay= =30; Session altered. DGMGRL> edit database india set state='apply-o OFF'; Succeeded. DGMGRL> Primary SQL> set time on 07:59:01 SQL> insert into adg_table values (150, 'PUNE'); 1 row created. 07:59:14 SQL> commit; Commit complete. 13

Guarantee Data Currency Standby SQL> select count(*) from adg_table; select count(*) from adg_table * ERROR at line 1: ORA-00604: error occurred at recursive SQL level 2 ORA-03172: STANDBY_MAX_DATA_DELAY of 30 seconds exceeded 14

Guarantee Data Currency SQL> select name,value from v$dataguard_stats; NAME VALUE -------------------------------- ------------------------------ transport lag +00 00:00:00 apply lag +00 00:14:55 apply finish time estimated startup time 13 To avoid stale data for any specific triggers with parameter standby_max_delay works. CREATE OR REPLACE TRIGGER max_data_delay AFTER LOGON ON database BEGIN IF (SYS_CONTEXT( USERENV, DATABASE_ROLE ) in ( PHYSICAL STANDBY ) and SYS_CONTEXT( USERENV, SESSION_USER )= C## #NASSYAM ) THEN execute immediate ALTER SESSION SET STANDBY_MAX_DATA_DELAY=5; END IF; END; / 15

Under The Hood of Active Data Guard Data Guard vs. Active Data Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby & Applications Applications & ADG 16 2014 Pythian

Gap Detection and Resolution Missing redo stream with full log file or into parts Network Outage Deletion or Missing of log files before they applied on standby Bad configuration Can be FRA, Corruption, Data files issue Consider reviewing the alert log and views v$archived_log, v$archive_gap, v$archive_dest, v$database, v$dataguard_status, v$managed_standby, v$log_history Resolution: Resolution not required for Good configuration, Oracle take cares in resolving GAP by RFS FAL parameter 17

Under The Hood of Active Data Guard Data Guard vs. Active Data Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby & Applications Applications & ADG 18 2014 Pythian

Block Change Tracking BCT can quickly identifies the blocks changes since last backup. BCT on Standby supported from 11.2 Many bugs with 11.2 < 11gR2 CTWR cannot write in BCT when recovery in progress. 19

Block Change Tracking BCT works only on Incremental backups 20

Under The Hood of Active Data Guard Data Guard vs. Active Data Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby & Applications Applications & ADG 21 2014 Pythian

Automatic Block Repair Automatic Block repair feature of ADG from 11g Media recovery works in 2-way Real-Time query should be working. Automatically repairs physical corruption. Increases availability and maintaining data protection all time. PRIMARY DATABASE STANDBY DATABASE 22

Automatic Block Repair Without ADG SQL> select count(*) from c##nassyam.adg_table; select count(*) from c##nassyam.adg_table * ERROR at line 1: ORA-01578: ORACLE data block corrupted (file # 6, block # 354) ORA-01110: data file 6: '/u02/app/oracle/oradata/mcdb/users01.dbf' With the power of ADG SQL> select count(*) from C##NASSYAM.ADG_TABLE; COUNT(*) ---------- 3 Reading datafile '/u02/app/oracle/oradata/mcdb/users01.dbf' for corruption at rdba: 0x01800164 (file 6, block 356) Reread (file 6, block 356) found same corrupt data (no o logical check) Automatic block media recovery requested for (file# 6,, block# 356) Sat Feb 21 22:24:07 2015 Automatic block media recovery successful for (file# 6, block# 356) Sat Feb 21 22:24:07 2015 Automatic block media recovery successful for (file# 6, block# 355) Sat Feb 21 22:24:07 2015 Automatic block media recovery successful for (file# 6, block# 355) Automatic block media recovery successful for (file# 6, block# 356) 23

Under The Hood of Active Data Guard Data Guard vs. Active Data Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby & Applications Applications & ADG 24 2014 Pythian

Tuning Reports: Statspack With ADG we can measure performance by interpreting Tuning tools Statspack on standby is available from 11gR1 Before using Statspack, must have schema and Statspack related objects, If not available they can created using spcreate.sql Statspack Installation SQL> alter session set "_oracle_script"= =true; SQL> @?/rdbms/admin/spcreate Standby Statspack Installation, creates STDBYPERF user for Standby. SQL> @?/rdbms/admin/sbcreate.sql Add additional Standby from STDBYPERF user SQL> @?/rdbms/admin/sbaddins Creating Snapshot Manually (exec statspack_<db_unique_name>_<instance_name>.snap) SQL> exec statspack_india_drmcdb.snap Generate Statspack report(test case) from STDBYPERF user SQL> exec statspack_india_drmcdb.snap SQL> @?/rdbms/admin/sbreport 25

Tuning Reports: Sample Statspack Report ADG allows more scope to review performance of standby database also. D:\All Oracle\ unity & User Group 26

Tuning Reports: ASH Report ASH report is very useful to track active sessions and also Historical. Ability to generate reports same as Primary with HTML and Text based. SQL> select db_unique_name,database_role from v$database; DB_UNIQUE_NAME DATABASE_ROLE -------------------- ---------------- india PHYSICAL STANDBY SQL> @?/rdbms/admin/ashrpt.sql Current Instance ~~~~~~~~~~~~~~~~ DB Id DB Name Inst Num Instance ----------- ------------ -------- ------------- 3793852408 MCDB 1 drmcdb... You are running ASH report on a Standby database. To generate the report over data sampled on the Primary database, enter 'P'. Defaults to 'S' - data sampled in the Standby database. Enter value for stdbyflag: S Using Primary (P) or Standby (S): S 27

Tuning Reports: ASH Report ASH report is very useful to track active sessions and also Historical. 28

Under The Hood of Active Data Guard Data Guard vs. Active Data Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby & Applications Applications & ADG 29 2014 Pythian

Exporting Data from Standby Creates only master table at Primary database Disk reads, Memory consumption of processes from standby database. SQL>!mkdir -p /home/oracle/working/nassyam/ SQL> create or replace directory exp_adg as '/home/oracle/working/nassyam'; Directory created. SQL> grant read,write,execute on directory exp_adg to public; Grant succeeded. SQL> create public database link exp_adg connect to system identified by oracle using 'india'; Database link created. SQL> 30

Exporting Data from Standby -bash-3.2$ expdp system/oracle directory=exp_adg dumpfile=exp_full.dmp logfile=exp_full.log schemas= c##nassyam network_link=exp_adg Export: Release 12.1.0.1.0 - Production on Fri Feb 20 18:03:59 2015 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0-64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options WARNING: Oracle Data Pump operations are not typically needed when connected to the root or seed of a container database. Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/*** ****** directory=exp_adg dumpfile=exp_full.dmp logfile=exp_full.log schemas= network_link=exp_adg Estimate in progress using BLOCKS method... Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATAA Total estimation using BLOCKS method: 247.0 MB Processing object type SCHEMA_EXPORT/USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS Processing object type SCHEMA_EXPORT/STATISTICS/MARKER.. exported "C##NASSYAM"."TEST_UPDATE" 208.7 MB 4000000 rows.. exported "C##NASSYAM"."ADG_TABLE" 6.179 KB 3 rows Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is: /home/oracle/working/nassyam/exp_full.dmp Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully co ompleted at Fri Feb 20 18:05:59 2015 elapsed 0 00:01:57 31

Under The Hood of Active Data Guard Data Guard vs. Active Data Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby Applications & ADG 32 2014 Pythian

DML s on Standby & Applications Active Data Guard feature from 12.1.0.1 Key Parameter: TEMP_UNDO_ENABLED(Dynamic) Compatible parameter should be 12.0.0 DDL s should be issued from Primary Transactions splits, Temporary objects will be used temporary undo and normal objects in Permanent undo. SQL> create global temporary table ADG_GTT on commit preserve rows as select * from testobj; Table created. DDL only on Primary SQL> SQL> conn c##nassyam/oracle Connected. SQL> select count(*) from adg_gtt; COUNT(*) ---------- 0 SQL> insert into ADG_GTT select * from testobj; DML on Standby 91431 rows created. SQL> select count(*) from adg_gtt; New rows on Standby COUNT(*) ---------- 91431 33

DML s on Standby & Applications 12 New feature SQL> set autotrace traceonly statistics; SQL> insert into ADG_GTT select * from testobj; 91431 rows created. Statistics ---------------------------------------------------------- 312 recursive calls 8499 db block gets 3542 consistent gets 1534 physical reads 0 redo size 854 bytes sent via SQL*Net to client 841 bytes received via SQL*Net from client 3 SQL*Net roundtrips to/from client 35 sorts (memory) 0 sorts (disk) 91431 rows processed SQL> select count(*) from adg_gtt; COUNT(*) ---------- 182862 34

Under The Hood of Active Data Guard Data Guard vs. Active Data Guard Setup of ADG Real-Time Query Gap Detection and Resolution BCT & Fast Incremental Backups Automatic Block Repair Statspack & ASH Exporting Data from ADG DML s on Standby Applications & ADG 35 2014 Pythian

Applications & ADG Key role is compatibility of applications Peoplesoft EBS 8.5.1 Nvision reports are supported to use and run on ADG Nvisions are mostly select queries(ps_ledger, PS_LEDGER_BUDG) Reports can run from modules FIN, HR, or EPM(DWH). Database Links to access primary system for DML/DDL using triggers Top Links(FMW) Oracle BI(10.1.3.4) SAP does not work with ADG with ADG 36

Finally These all are with single License 37

Thank you and Q&A basha@pythian.com @nassyambasha www.oracle-ckpt.com 38