Oracle Core # RAC, 1-way, 2-way and 3-way block transfer

I am reading Jonathan Lewis’s latest book Oracle Core recently.

I’d like to summary what I learned from chapter Rac and Ruin about x-way block transfer.

1-way block transfer (I created the name myself, oracle didn’t have it)
No block transfer at all. Oracle does a simple check and finds itself is the master of the block and no other nodes hold that block. It’s very similar to single instance case.

2-way block transfer
Node A calculates a hash(or check a map in some cases) , and finds out another node is the master of this block, let’s say node B. Node A send a message to B for that block. Node B found no other nodes hold that block(or only itself). It reply to node A let it read from disk (or send that block). Messages come back and forth between A and B 2 times. That’s 2-way block transfer.

3-way block transfer
This time node A is not that lucky. Node B found that another node is currently hold that block, let’s say node C. So it sends a message to node C, and then node C send the block to node A. That’s 3-way. There is no more expensive case than this one, no matter how many nodes you have. But if you have more nodes, the possibility of 3-way block transfer is much higher. Obviously, 2-node RAC didn’t have 3-way cases.

RAC coordinate mechanisms

Two major mechanisms to coordinate instances to get stuff in GRD(global resource directory):
GES(global enqueue service) handles the right(enqueues on resources) to access a block. The functionality for GES is essentially handled by three background processes LCK0, LMD, and LMON.
GCS(global cache service) manage the actual block (or cache coherency). The functionality of GCS is essentially handled by LMSn.

Thoughts about RAC

Based on the book and my experiences on RAC, I have some thoughts to share(it may not correct or thoughtful enough): applications should split in the way we split instances, one application access some tables in one instance, the other application connects to another instance, and accesses some other tables. Otherwise the overhead will be significant.

I finish reading the book before the new year. It’s a great book. I really appreciate the writer Jonathan Lewis who must spend lots of time to write it. I believe he is a generous man.

About Alex Zeng
I would be very happy if this blog can help you. I appreciate every honest comments. Please forgive me if I'm too busy to reply your comments in time.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: