Oracle Cache Fusion - in Operation
Oracle Cache Fusion - in Operation
Oracle Cache Fusion - in Operation
Agenda
Cache Fusion
What is it?
Cache Coherency Vs. Cache Fusion
Key Components and terminology
Cache Fusion in operation
Lock Mastering & Resource Affinity
Type of Contentions
Cache Fusion I
Cache Fusion II
Examples
Instance Crash Recovery in RAC
Key Components in a Instance crash
I Pass recovery
II Pass recovery
What is it?
Cache Coherency
According to Manual
The synchronization of data in multiple caches so that reading a memory
location through any cache will return the most recent data written to that
location through any other cache. Sometimes called cache consistency.
Can We say its something to maintain the resource (block) status, If so, the
following two together provides the same for us.
GCS (Global Cache Services)
GES (Global Enqueue Services)
In the name of
Global Resource Directory
Feature
Description
Prior to 8.1.5
OPS
8.1.5
9i
10g R1
10g R2
- Block Mastering
In Oracle 9.2
documentation describes dynamic remastering
not implemented in code
In Oracle 10.1
In Oracle 10.2
works at object level
thresholds are relatively low.
Object re mastering is recorded in V$GCSPFMASTER_INFO
(before 8.1.5)
Local
Global
Null: N
NL
NG
Shared: S
SL
SG
Exclusive: X
XL
XG
SL When an instance has a resource in SL form, it can serve a copy of the block to other instances and it can read
the block from disk. Since the block is not modified, there is no need to write to disk.
XL When an instance has a resource in XL form, it has sole ownership and interest in that resource. It also has the
exclusive right to modify the block. All changes to the blocks are in its local buffer cache, and it can write the block to
disk. If another instance wants the block, it will contact the instance via GCS.
NL A NL form is used to protect consistent read blocks. If a block is held in SL mode and another instance wants it in
X mode, the current instance will send the block to the requesting instance and downgrade its role to NL.
SG In SG form, a block is present in one or more instances. An instance can read the block from disk and serve it to
other instances.
XG In XG form, a block can have one or more Pls, indicating multiple copies of the block in several instances buffer
caches. The instance with the XG role has the latest copy of the block and is the most likely candidate to write the
block to disk. GCS can ask the instance with the XG role to write the block to disk or to serve it to another instance.
NG After discarding Pls when instructed by GCS, the block is kept in the buffer cache with NG role. This serves only
as the CR copy of the block.
Example 5: Commit the Previously Modified Block and Select the Data
List of nodes:
012
Global Resource Directory frozen
* dead instance detected - domain 0 invalid = TRUE
Communication channels reestablished
* domain 0 valid = 0 according to instance 0
Wed Jun 21 23:22:22 2006
Master broadcasted resource hash value bitmaps
Non-local Process blocks cleaned out
Wed Jun 21 23:22:22 2006
LMS 0: 0 GCS shadows cancelled, 0 closed
Wed Jun 21 23:22:22 2006
LMS 2: 0 GCS shadows cancelled, 0 closed
Wed Jun 21 23:22:22 2006
LMS 3: 0 GCS shadows cancelled, 0 closed
Wed Jun 21 23:22:22 2006
LMS 1: 0 GCS shadows cancelled, 0 closed
Set master node info
Submitted all remote-enqueue requests
Dwn-cvts replayed, VALBLKs dubious
All grantable enqueues granted
Wed Jun 21 23:22:22 2006
LMS 0: 2189 GCS shadows traversed, 332 replayed
Wed Jun 21 23:22:22 2006
LMS 2: 2027 GCS shadows traversed, 364 replayed
Wed Jun 21 23:22:22 2006
LMS 3: 2098 GCS shadows traversed, 364 replayed
Wed Jun 21 23:22:22 2006
LMS 1: 2189 GCS shadows traversed, 343 replayed
Wed Jun 21 23:22:22 2006
Submitted all GCS remote-cache requests
Fix write in gcs resources
Reconfiguration complete
Instance 2
Session 15
LMS0
SELECT runs,wickets
FROM score
WHERE team = 'ENG';
Build read
consistent version
of block 42
Session 27
UPDATE score
SET runs = runs + 6
4
2
WHERE team = 'ENG';
ITL1
ITL1
ITL1
xid: 0005.018.4E7
xid: 0005.018.4E7
xid: 0005.018.4E7
xid: 0005.018.4E7
uba:
uba: -800777.530.12
800777.530.13
800777.530.12
800777.530.13
800777.530.14
uba:
uba: -800777.530.12
800777.530.13
800777.530.12
800777.530.13
800777.530.14
uba: 800777.530.14
800777.530.12
800777.530.13
slot 0
slot 0
slot 0
col1: ENG
col1: ENG
col1: ENG
col2: 340
350
344
352
col2: 340
350
344
352
340
col2: 352
344
350
col3: 1
col3: 1
col3: 1
12 uba: 5.1
slot 1
slot 1
col1: AUS
col1: AUS
col1: AUS
col2: 99
col2: 99
col2: 99
col3: 10
col3: 10
col3: 10
DataData
Block
Block
42 (copy)
42
DataData
Block
Block
42 (copy)
42
Data Block 42
col3: 340
13 uba 800777.530.12
5.1
slot 1
block 42 slot 0
block 42 slot 0
col3: 344
14 uba 800777.530.13
5.1
block 42 slot 0
col3: 350
Session1
5
LMS0
Session2
7
22:9
22:10
ENG 199
ENG 205
ENG 205
199
200
204
ENG 200
AUS 99
AUS 99
ENG 204
Block 42
Undo
Block
SELECT runs
FROM score
WHERE team = 'ENG';
199
ENG 205
AUS 99
Instance 1
Instance 2
UPDATE score
SET runs = 200
WHERE team = 'ENG';
UPDATE score
SET runs = 204
WHERE team = 'ENG';
UPDATE score
SET runs = 205
WHERE team = 'ENG';
COMMIT;
Session1
5
LMS0
Session2
7
22:9
22:10
ENG 199
ENG 205
ENG 205
200
204
199
ENG 200
AUS 99
AUS 99
ENG 204
Block 42
Undo
Block
SELECT runs
FROM score
WHERE team = 'ENG';
ENG 199
AUS 99
Instance 1
STOP
Instance 2
UPDATE score
SET runs = 200
WHERE team = 'ENG';
UPDATE score
SET runs = 204
WHERE team = 'ENG';
UPDATE score
SET runs = 205
WHERE team = 'ENG';
COMMIT;
Session1
5
LMS0
Session2
7
22:10
ENG 199
ENG 199
ENG 199
205
204
200
ENG 205
199
200
204
ENG 200
AUS 99
AUS 99
AUS 99
ENG 204
Block 42
Copy
Block 42
Undo
Block
SELECT runs
FROM score
WHERE team = 'ENG';
ENG 199
AUS 99
Instance 1
Instance 2
UPDATE score
SET runs = 200
WHERE team = 'ENG';
UPDATE score
SET runs = 204
WHERE team = 'ENG';
UPDATE score
SET runs = 205
WHERE team = 'ENG';
Session1
5
LMS0
Session2
7
ENG 199
22:10
ENG 199
ENG 205
200
204
199
ENG 200
ENG 205
199
200
204
ENG 200
AUS 99
ENG 204
AUS 99
ENG 204
Block 42
Undo
Block
SELECT runs
FROM score
WHERE team = 'ENG';
UPDATE score
SET runs = 200
WHERE team = 'ENG';
UPDATE score
SET runs = 204
WHERE team = 'ENG';
UPDATE score
SET runs = 205
WHERE team = 'ENG';
ENG 205
199
200
204
AUS 99
Instance 1
Instance 2
Q&A