Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle Rac-Cache Fusion

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Cache Fusion (cache fusion)

In a practical sense, block transfer is carried out between the SGA in each node of the cluster through the interconnection network, which has the advantage of avoiding writing the block to disk many times and then reading it back into the cache of other instances. When a block is read from disk into the sga of the first instance in the RAC environment, the block is assigned a lock resource (different from a row-level lock) to let other instances know that the block is being used (or read). When another instance requests the operation of the block, the current instance sga passes a copy of the block to another instance (the block is up-to-date and unchanged) If the block in memory has been changed but the change has not been committed, a copy of the CR will be passed and the level of the corresponding lock resource will be changed. In essence, the database does not need to write back to disk or read multiple times from disk into the sga of the relevant instances, sharing and passing in the cache in each instance, thus avoiding the extra iUnix cost of synchronizing the instance cache.

Application environment: when the speed of the interconnection network is much higher than the access speed of the disk IZX O.

Here is an introduction to some concepts in cache fusion

Global caching service (GCS): global caching (SGA) involves data blocks. The global cache service is responsible for maintaining cache consistency in the global cache, ensuring that an instance can obtain a global lock resource when it wants to modify a block at any time, thus avoiding the possibility that another instance will modify the block at the same time. The modified instance will have the current CP version of the block (both committed and uncommitted) as well as the post p_w_picpath of the block. If another instance also requests the block, then GCS is responsible for tracking the instance that owns the block, what version of the block is owned, and what resource mode the block is in. The LMS process is a key component of the global caching service. (LMS is the lock management server process that serves the delivery of cache fusion requests between instances)

Global queuing Service (GES): mainly responsible for maintaining consistency between dictionary cache and library cache. Dictionary cache is the cache of data dictionary information stored in the SGA of an instance for high-speed access. Because the dictionary information is stored in memory, changes made to the dictionary on one node, such as DDL, must be immediately propagated to the dictionary cache on all nodes. GES is responsible for handling the above situations and eliminating differences between instances. For the same reason, in order to analyze the SQL statements that affect these objects, the library cache locks on the objects in the database are removed. These locks must be maintained between instances, and the global queuing service must ensure that deadlocks do not occur between multiple instances requesting access to the same object. The LMON, LCK, and LMD processes work together to implement the global queuing service. GES is an important service to regulate other resources between nodes in the RAC environment in addition to the maintenance and management of the data block itself (completed by GCS).

1. Resource models: three

Null (default)

Share (S) (query)

Exclusive (X) (modify the content of block, other instances are null mode)

two。 Resource roles: two

Local:

The initial trial mode of the resource request for the first time; only one instance can have the dirty copy of this block (that is, the metadata content of the disk block)

Global:

When a Block changes to dirty in multiple instances, Local becomes Global and eventually only GCS can send requests to write to disk

Here's how cache fusion block is transmitted.

Environment: there are four nodes in A _ Magi B _ C _ D, and instance D has the permission of MASTER resources with data blocks (each data block has a master)

Read from no transfer

Suppose that the sga of the four instances has never cached the data block, if node C needs to read a block to shared data disk. Then node C sends a request to GCS, and at this time the request is directed to node D (because node D is the master of the data block), GCS changes the resources of the block to share mode (S) and local role and records the status in the GCS of node D, and informs the GCS of C to start the resource mode from Null- > Share C to read the block from Null- O read disk.

Read to Write transfer

B wants to read and write this data block, the GCS of B sends a request to D, and the GCS of D sends a request to C, asking C to send the data block to B Magee C, and the mode Null- > Exclusive (X) of the data block CP to BMagee B's GCS modification block, and the mode of other nodes is-> null.

Write to Write transfer

Node An also needs to modify the data block. The GCS of A sends a request to D, and the GCS of D points to B. if the request has not been completed at this time, it will be put in the GES queue. B cancels the modification and sends the block to A (this will force log flush) b's block mode is changed to null A with X lock after receiving the block. At this time, although B has block cp, it cannot be modified because b block mode is null.

Write to Read transfer

C to read the GCS of block,C sends a request to D, D points to A Magi A to lock the block from X-> Share mode, C receives the block CP of A to take out the SCN, and GCS updates the SCN of the metadata block CP.

You can turn off Cache Fusion by setting the parameter gc_files_to_locks.

When closed, other nodes must wait for the instance node that occupies the block to submit and write back to the data file when they want to read / write the block.

Note 1: when a new node is added / crashed, the lock resources of the original node will be rebalanced

Note 2: when a node no longer needs master, the dynamic resource control process moves it to the node with the highest frequency of requests.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report