Disclaimer

Tuesday, 19 November 2024

What is difference between GCS (Global Cache Service) and LMS in Oracle RAC

 

In Oracle RAC, GCS (Global Cache Service) and LMS (Lock Manager Server) are closely related, but they have distinct roles in managing the coordination and sharing of data blocks across RAC nodes. Here's a clear explanation of the difference:



1. GCS (Global Cache Service)

  • What It Is: GCS is a logical layer or service within Oracle RAC that ensures data consistency and efficient sharing of data blocks across RAC instances.

  • Primary Role: It manages:

    • Cache Fusion: Ensuring that data blocks are shared between instances without disk I/O whenever possible.
    • Global Resource Directory (GRD): Tracks the ownership and status of data blocks across all instances.
    • Locks for Blocks: Manages locks on data blocks to ensure consistent updates and avoid conflicts.
  • Scope:

    • GCS is responsible for high-level coordination of data sharing between instances.
    • It is part of the RAC's inter-instance communication layer.



2. LMS (Lock Manager Server)

  • What It Is: LMS is a background process in each RAC instance that implements the functionality of GCS. It executes the actual operations required by the GCS.

  • Primary Role:

    • Processes requests from other instances for data block access or transfer.
    • Handles the real-time messaging and locking mechanisms.
    • Participates in cache fusion by transferring or receiving blocks via interconnect.
  • Number of Processes:

    • The number of LMS processes is determined by the _lm_servers parameter. Typically, there are at least 2 LMS processes, and more are added for systems with larger workloads.
  • Scope:

    • LMS works at the instance level, carrying out GCS tasks in response to requests from other RAC nodes.


Key Differences Between GCS and LMS







How They Work Together

  1. GCS determines that a block is needed by Instance B but is currently held by Instance A.
  2. GCS requests the LMS process on Instance A to send the block to Instance B.
  3. The LMS process on Instance A transfers the block to Instance B via the RAC interconnect.
  4. GCS updates the Global Resource Directory (GRD) to reflect the new ownership of the block.




Monitoring GCS and LMS

  • Monitor LMS Processes:


    SELECT program, status FROM v$bgprocess WHERE program LIKE 'LMS%';
  • Monitor GCS and GRD:

    • View GCS-related activity:

      SELECT * FROM gv$gcs_server;
    • View locks and resource states:

      SELECT * FROM gv$ges_resource;

By managing the logic (GCS) and execution (LMS), Oracle RAC ensures efficient and consistent sharing of data across all nodes in the cluster.





No comments:

Post a Comment

Index rebuild online in Oracle - shell script

  [oracle@rac10p reorg]$ cat index_rebuild_EMP.sh #!/bin/ksh export ORACLE_HOME=/oracle/K12/19 export ORACLE_SID=K12 export PATH=$PATH:/$ORA...