Академический Документы
Профессиональный Документы
Культура Документы
In both cases the threads from failed instances need to be merged, in a instance recovery SMON will perform the recovery where
as in a crash recovery a foreground process performs the recovery.
The main features (advantages) of cache fusion recovery are
Recovery cost is proportional to the number of failures, not the total number of nodes
It eliminates disk reads of blocks that are present in a surviving instance's cache
The cluster is available after an initial log scan, even before recovery reads are complete
In cache fusion the starting point for recovery of a block is its most current PI version, this could be located on any of the surviving
instances and multiple PI blocks of a particular buffer can exist.
Remastering is the term used that describes the operation whereby a node attempting recovery tries to own or master the
resource(s) that were once mastered by another instance prior to the failure. When one instance leaves the cluster, the GRD of that
instance needs to be redistributed to the surviving nodes. RAC uses an algorithm called lazy remastering to remaster only a
minimal number of resources during a reconfiguration. The entire Parallel Cache Management (PCM) lock space remains invalid
while the DLM and SMON complete the below steps
1. IDLM master node discards locks that are held by dead instances, the space is reclaimed by this operation is used to
remaster locks that are held by the surviving instance for which a dead instance was remastered
2. SMON issues a message saying that it has acquired the necessary buffer locks to perform recovery
1
Lets look at an example on what happens during a remastering, lets presume the following
Instance B is removed from the cluster, only the resources from instance B are evenly remastered across the surviving nodes (no
resources on instances A and C are affected), this reduces the amount of work the RAC has to perform, likewise when a instance
joins a cluster only minimum amount of resources are remastered to the new instance.
Before Remastering
After Remastering
_lm_master_weight
controls which instance will hold or (re)master more resources than others
_gcs_resources
you can also force a dynamic remastering (DRM) of an object using oradebug
2
DLM recovery
I Pass recovery
The recovery set is prepared and built, memory space is allocated in the SMON PGA
II Pass recovery
Local
Global
Null (N)
NL
NG
Shared (S)
SL
SG
Exclusive (X)
XL
XG
States
SL
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
NL
XG
a block can have one or more PIs, the instance with the XG role has
the latest copy of the block and is the most likely candidate to write
the block to the disk. GCS can ask the instance to write the block and
serve it to other instances
NG
We will only use one block and it will reside at SCN 987654
first letter will indicate the lock mode - N = Null, S = Shared and X = Exclusive
The third letter will indicate the PIs - 0 = no PIs, 1 = a PI of the bloc
for example a code of SL0 means a global shared lock with no past images (PIs)
Reading a block from disk
instance C want to read the block it will request a lock in share
mode from the master instance
1. Instance C requests the block by sending a shared lock
request to master D
2. The block has never been read into the buffer cache of any
instance and it is not locked. Master D grants the lock to
instance C. The lock granted is SL0 (see above to work out
three-letter code)
3. Instance C reads the block from the shared disk into its
buffer cache
4. Instance C has the block in shard mode, the lock manager
updates the resource directory.
Reading a block from the cache
12
Operation on Node
A
update the
block
update the same
block
commit the
changes
trigger checkpoint
SCUR
C
read block from
disk
Buffer Status
CR
SCUR
XCUR
CR
CR
PI
CR
XCUR
PI
CR
XCUR
CR
XCUR
13
instance
crash
7
8
CR
XCUR
14