Oracle RAC and the Lamport algorithm

In Oracle's RAC, the Lamport algorithm works with system change numbers (SCN) and the distributed lock manager (DLM) to control and lock management and conflict resolution; read more in this excerpt from "Oracle Database 10g: Real Application Clusters Handbook."

Oracle RAC and the Lamport algorithm

The Lamport algorithm is fast and scalable in RAC as it generates the SCNs in parallel and the SCNs are assigned to the transactions on a first come, first serve basis. The distributed lock manager (DLM) controls and monitors the lock management and conflict resolution.

Another algorithm that is simpler than Dr. Lamport's bakery algorithm is based on the broadcasting operation after a commit operation, and this is the default SCN generation algorithm in single instance Oracle implementations. In this method, the SCN is broadcasted to the participating nodes immediately after a commit operation. This ensures that read consistency is at the highest level so that the participating nodes know the current state of the transaction irrespective of the workload. This method puts additional load on the systems, as it has to broadcast the SCN for every commit; however, the other nodes can see the committed SCN immediately.

The initialization parameter max_commit_propagation_delay limits the maximum delay allowed for SCN propagation to the participating nodes and controls the SCN scheme used in the OPS/RAC environment. This parameter defaults to 7 seconds (700 centiseconds) in most of the platforms except for the Compaq Tru64 UNIX. When we set the max_commit_propagation_delay initialization parameter to any value less than 100, the broadcast on commit algorithm is used. The alert log is updated immediately after startup with the method used for SCN generation.

Let's start the second instance and check the reconfiguration event entries in the alert.log:

SQL> startup nomount;

In the alert log of the second instance we see this:

Mon Aug 29 17:40:35 2005 lmon registered with NM - instance id 2 (internal mem no 1) Mon Aug 29 17:40:37 2005 Reconfiguration started (old inc 0, new inc 2) List of nodes: 0 1 Global Resource Directory frozen Update rdomain variables

Now two nodes in the clusters have internal IDs of 0 and 1. The rest of the messages are pretty much the same as in the first instance's alert log file.

Use the following table of contents to navigate to chapter excerpts or click here to view RAC Troubleshooting in its entirety.

Oracle Database 10g: Real Application Clusters Handbook
  Home: Oracle RAC troubleshooting: Introduction
  1: Oracle RAC: Log directory structure in cluster ready services
  2: Oracle RAC: Log directory structure in Oracle RDBMS
  3: Oracle RAC and the Lamport algorithm
 4: Oracle RAC: ON and OFF
  5: Oracle RAC: Database performance issues
  6: Oracle RAC: Debugging node eviction issues
  7: Oracle RAC: Member voting
  8: Oracle RAC: Cluster reconfiguration steps
  9: Oracle RAC: Debugging CRS and GSD using DTRACING
About the book:   
Oracle Database 10g: Real Applications Clusters Handbook Learn to implement Oracle real application clusters from the ground up. Maximize database availability, scalability, and efficiency. Find RAC concepts, administration, tuning, and troubleshooting information. You'll learn how to prepare and create Oracle RAC databases and servers, and automate administrative tasks. You'll also get full coverage of cutting-edge Oracle RAC diagnostic tools, backup and recovery procedures, performance tweaks and custom application design strategies. Buy this book at McGraw-Hill/Osborne
About the author:   
K Gopalakrishnan is a senior principal consultant with the Advanced Technology Services group at Oracle Corporation, specializing exclusively in performance tuning, high availability, and disaster recovery. He is a recognized expert in Oracle RAC and Database Internals and has used his extensive expertise in solving many vexing performance issues all across the world for telecom giants, banks, financial institutions, and universities.

This was first published in May 2007

Dig Deeper on Database Management Products and Solutions



Find more PRO+ content and other member only offers, here.



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: