RAC 12c Optimization
RAC 12c Optimization
By
Riyaj Shamsudeen
Email:
rshamsud@orainternals.com
Blog :
orainternals.wordpress.com
Web: www.orainternals .com
©OraInternals Riyaj Shamsudeen 2
Process architecture
RAC message flow
BL resources
Block is not in any buffer cache. LMS grants a PR mode lock on the
resource and asks FG to read from the disk.
FG FG FG
1
LMD LMD LMD
2
LMS LMS LMS
FG – Foreground Process
PR mode lock LMD – Lock Manager Daemon
GRD – Global Resource Directory
Disk files
Demo: demo_01a.sql
©OraInternals Riyaj Shamsudeen 6
Trace lines
WAIT #18446741324875049632: nam='gc cr grant 2-way' ela= 499 p1=7 p2=6867 p3=1 obj#=76484
tim=4597940025
WAIT #18446741324875049632: nam='db file sequential read' ela= 758 file#=7 block#=6867 blocks=1
obj#=76484 tim=4597941129
PR mode
X$bh BH Buffer
X$le LE
Shadow Shadow
X$kjbl [0x1ac4][0x7],[BL] [0x1ac4][0x7],[BL]
X$kjbr Resource
[0x1ac4][0x7],[BL] A shadow structure setup in instance
1 to keep track of the resource.
Instance 2 (directory instance) Instance 1
FG FG FG
2
LMD LMD LMD
1
LMS LMS LMS
[0x1ad3][0x7],[BL]
[0x1ad3][0x7],[BL]
PR mode lock
PR mode lock
Disk files FG – Foreground Process
LMD – Lock Manager Daemon
GRD – Global Resource Directory
X$bh BH Buffer
X$le LE
Client
X$kjbl [0x1ac4][0x7],[BL]
X$kjbr Resource
[0x1ac4][0x7],[BL] A resource structure already exists still
that block is in the buffer cache.
Instance 2 (Directory instance)
X$le LE LE
FG LMS FG LMS
EX
PI EX
EX
Apply undo
CR CR
CR CR
EX mode lock
If LMS process can not get to a request in 1ms time, then the
response for the request will be marked with ‘congestion’ wait
event.
4. Review Send side metrics, and not just Receive side metrics.
In RAC, the root cause can be hidden in other node and might
not show up in the Top-5 wait events.
Example 1
Example 2
Example 3
Example 3 (continued)
FG2
gc current request charge time to actual
wait event.
Inst 1
FG1
Wire
Open request Block
File #5, blk #8 send
LMS
Inst 2
Flush request Post
LGWR
gc buffer busy release
FG3
All other processes wait for the BL lock to be available and charge
the time to gc buffer busy event.
@ash_gcwait_to_obj.sql
@ash_gcwait_to_block.sql
INST_ID EVENT CURRENT_FILE# CURRENT_BLOCK# CNT
---------- ------------------------------ ------------- -------------- ----------
2 gc buffer busy acquire 4 103582 4
2 gc buffer busy acquire 4 103607 3
2 gc buffer busy acquire 4 103603 3
1 gc buffer busy acquire 4 103582 2
2 gc buffer busy release 4 103615 2
1 gc buffer busy acquire 4 103583 1
2 gc buffer busy release 4 103586 1
2 gc buffer busy release 4 103613 1
Demo: ash_gcwait_to_block.sql
©OraInternals Riyaj Shamsudeen 29
Gc buffer busy – Identify block type
Dump the block to identify the type and contents of the block.
alter system dump datafile 4 block min 103582 block max 103582;
4. Review Send side metrics, and not just Receive side metrics.
Inst 1
FG1
Wire
Open request Block
File #5, blk #8 send
LMS
Inst 2
©OraInternals Riyaj Shamsudeen
Eliminate infra-structure as an issue
Wait events ‘gc cr block 2-way’ , ‘gc cr block 3-way’ , ‘gc current
block 2-way’, and ‘gc current block 3-way’, ‘gc cr grant 2-way’, ‘gc
cr grant 2-way’.
4. Review Send side metrics, and not just Receive side metrics.
4. Review Send side metrics, and not just Receive side metrics.
FG2
gc current request charge time to actual
wait event.
Inst 1
FG1
Wire
Open request Block
File #5, blk #8 send
LMS
Inst 2
Flush request Post
LGWR
gc buffer busy release
FG3
RESOURCE_NAME
------------------------------
[0x15f29][0x0],[TM][ext 0x3,0x0] <- hrdb1 PDB – GSTEST table –object_id=89897
[0x15f29][0x0],[TM][ext 0x4,0x0] <- hrdb2 PDB – GSTEST table –object_id=89897
Parameter: _high_priority_processes
Value : LMS*|VKTM|LM*|LCK0|GCR*|DIAG
…
kjfmPriCheck: 0 RTLMS taken, 1 RTLMS available
kjfmPriCheck: automatic priority changes enabled - multi-inst mode
kjfmPriCheck: # of real time LMS increasing from 0 to 1
…
Parameter: _lm_lms_priority_dynamic
Value : TRUE
Inst 1
FG1
Wire
Open request Read from
File #5, blk #8 the disk
LMS
Inst 2
©OraInternals Riyaj Shamsudeen
Why DRM?
charge time to
‘gc cr grant 2-way’
Inst 1
FG1
LMS
Inst 2
Read from
the disk
Excessive amount of GC activity for
One object!
Resources
Resources
PO Inst 2 FIN
PO
FIN
Inst 3
For PO service: Instance 1 & 2 are
Preferred
preferred instances, and instance PO
3 is an available instance. Available
FIN
©OraInternals Riyaj Shamsudeen 62
Or PDBs
PO Inst 2 FIN
PDB1
PDB2
Inst 3
Online
PDB1
PDB2 Failover
Email: rshamsud@orainternals.com
Blog : orainternals.wordpress.com
Web: www.orainternals.com