4.6 Global resource directory

 < Day Day Up > 



The global resource directory (GRD) contains information about the current status of all shared resources. It is maintained by the GCS and GES to record information about resources and enqueues held on these resources. GRD resides in memory and is used by GCS and GES to manage the global resource activity. It is distributed throughout the cluster to all nodes. Each node participates in managing global resources and manages a portion of the GRD.

Oracle 9i 

New Feature: GRD takes the place of the lock database used in OPS. However, unlike the lock database, the information contained in GRD is also used by Oracle for recovery during instance failure and cluster reconfigurations.

When an instance reads data blocks for the very first time, its existence is local, that is, no other instance in the cluster has a copy of the same block. The block in this state is called a current state block (XI). Therefore, the behavior of this block in memory is similar to any single instance configuration, with the exception that GCS keeps track of the block even in a local mode. Multiple transactions within the instance have access to these data blocks. Once another instance has requested for the same block, then the GCS process will update the GRD, taking the state of the data block from a local role to a global role.

Figure 4.5 provides the contents of the GRD. The structure and function of the GRD is similar to a redo log buffer. The redo log buffer contains the current and past images of the rows being modified, while the GRD contains information at a higher level, specifically the current and past image of the blocks being modified by the various instances in the cluster. As illustrated in Figure 4.5, the GRD consists of:

click to expand
Figure 4.5: A dissection of the global resource directory.

Database block address (DBA)  This is the basic address of the block that is being modified. An example would be block 600. This indicates that block 600 is accessed by a user on its current instance and, based on other values like mode (null, shared, and exclusive) and role (local or global), is determined if the current instance is the original holder or a requester of the block.

Location  This indicates the location of the current version of the data block. (This value is only present if multiple nodes share the block.)

Mode  This indicates the mode in which the data blocks are being held by instances. The various modes are described in Table 4.1.

Role  This indicates the role in which the data block is being held by each instance. The various roles are described in Table 4.2.

System change number (SCN)  The system change number is required in a single instance configuration to serialize activities such as block changes, redo entries, and replay of redo logs during a recovery operation. The SCN has a more robust role in a RAC environment.

In a RAC configuration there are multiple instances with a common shared database. Because more than one instance updates the shared database, data blocks are transferred via the cluster interconnect between the instances. The SCNs play an even more important part, providing synchronization in a RAC environment between various versions of data blocks. To track these successive generations of data blocks across instances, Oracle assigns (uses) a unique logical timestamp or SCN, to each data block that is generated. The SCN is used by Oracle to order the data block change events within each instance and across all instances.

Depending on the type of block request, each instance participating in the transaction maintains a PI of the block being requested. This enables Oracle to generate redo logs in an orderly manner and to accommodate subsequent recovery processing. Hence, the SCNs generated by all instances have to be synchronized globally.

To make the activity less complex, separate SCNs are generated by each instance. However, with the database being a commonly shared database, and in an effort to keep the transactions in a serial order, these SCNs have to resynchronize their own SCN to the highest SCN known in the cluster.

The method used by Oracle to resynchronize its own SCN to the highest SCN in the cluster is a broadcasting mechanism known as Lamport generation. Under this scheme, SCNs are generated in parallel on all instances and Oracle piggybacks an instance's current SCN onto any message being sent via the cluster interconnect to another instance. This allows the SCN to be propagated between instances without incurring any additional message overhead. Once propagated, the GCS process will manage the SCN synchronization process. The default interval is based on the platform-specific message threshold value of 7 seconds.

Note 

The Lamport SCN generation scheme is used when the value of MAX_COMMIT_PROPAGATION_DELAY is larger than the platform-specific threshold.

Past image (PI)  The past image is a copy of a globally dirty block image maintained in cache. It is saved when a dirty block is served to another instance after setting the resource role to global. A PI must be maintained by an instance until it, or a later version of the block, is written to disk. The GCS is responsible for informing an instance that its PI is no longer needed, after another instance writes the block. PI can be discarded when an instance writes a current block image to disk. With cache fusion, such writes occur to satisfy checkpoint requests and not to transfer blocks between instances.

Current image (XI)  The current image is a copy of a block held by the last (current) instance in the chain of instances that requested and transferred an image of the block.

The GRD tracks consistent read block images with a local resource in NULL mode. Once tracked, GRD does not have to retain any information about a resource being held in NULL mode by an instance. However, once it has some kind of global allocation, global block resource information is stored in the GRD to manage the history of block transfers even if the resource mode is NULL. With local resources, the GCS discards resource allocation information for instances which downgrade a resource to NULL mode.



 < Day Day Up > 



Oracle Real Application Clusters
Oracle Real Application Clusters
ISBN: 1555582885
EAN: 2147483647
Year: 2004
Pages: 174

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net