Internals of Active DataGuard
Internals of Active DataGuard
Internals of Active DataGuard
Saibabu Devabhaktuni
Kyle Towle It cant 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.
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.
Agenda
Redo apply mechanism Read only queries State of the standby Testing applications for Active Dataguard (ADG)
Redo shipping
Redo shipping from primary is done in streaming mode for LGWR SYNC/ASYNC
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
10
11
12
13
Reads on ADG
50% of buffer cache reserved for reads in ADG (as defined by _recovery_percentage)
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
16
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
19
Standby state
By design, not all control file changes make it to the standby
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]
Dont rely on unrecoverable columns in v$datafile (as they are not updated by design)
Temp files can be different on standby
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
Query percentage of read only queries versus read write in ASH by XID column
Dba_hist_active_sess_history can also be queried
25
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 cleanouts 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