The block-related wait event statistics indicate that a block was received as either the result of a 2-way or a 3-way message, that is, the block was sent from either the resource master requiring 1 message and 1 transfer, or was forwarded to a third node from which it was sent, requiring 2 messages and 1 block transfer.

In last article, we discussed on Basic on Oracle RAC wait events.:- Click here to read.

The main wait events for block-related waits are:

  • gc current block 2-way
  • gc current block 3-way
  • gc cr block 2-way
  • gc cr block 3-way

If a transaction requesting for a block which itself have master copy of the block and it is also master the requested block then no global cache transfer will take place.

If a transaction needs a copy of a block and the master copy is on the another instance that has the block’s resource master,then only master copy needs to transfer and is called gc 2-way event.

1. gc current block 2-way (write/write with 2 nodes)

Current Block :The current block contains changes for all the committed and yet-to-be-committed transactions.

An instance requests authorization for a block to be accessed in the current mode to modify the block. The instance mastering the corresponding resource received the request. The master has the current version of the block and sends the current copy of the block to the requestor via the Cache Fusion mechanism. This event indicates write/write contention. The appearance of gc current block 2 way in the Top 5 event section does not necessarily indicate performance issues. It merely indicated that the instances are accessing copies of data present in each other’s cache and that the cache fusion mechanism is being used to transfer copies of the data among the instances. However if the average wait time for each event is very high, it might be impacting performance and needs further analysis.

For above scenario ,
There will be two actions performed. 

Example [Exclusive mode]: 

We have Instance A and Instance B 

  • Instance A will ask for current block and lock in exclusive mode so ,a call to the resource master from requested instance will be generated.
  • Instance B which masters the block will sends the current block via interconnect ,keeps a past Image and grants exclusive lock.

Example [Shared mode]: 

We have Instance A and Instance B 

  • Instance A will ask for current block and lock in shared mode so ,a call to the resource master from requested instance will be generated.
  • Instance B which master’s the instance and have current block ,makes a CR copy and sends it via the interconnect , with no lock granted

2.gc current block 3-way (write/write with 3 nodes)

When 3 instances are involved in the global cache transfer , the wait events are 3-way events.

We have Instance A,Instance B and Instance C

Example [Exclusive mode]: 

1.Instance A Ask for current block and lock in exclusive mode
2.Instance B which is master instance of the block forwards request to the Holding instance[in our case Instance C] and sends the message to other instances holding the shared locks to close their locks.
3.Instance C sends current block and transfers exclusive ownership to Instance A and keeps a past image of the block

Example [Shared mode]: 

1. Instance A ask for current block and lock in share mode
2. Instance B ,which master instance for that block , forwards request to the holder , no lock granted.
3. Instance C , holding Instance makes a CR copy and forwards block to the Instance A

Basic Solution to resolve above two wait events

  • Best Solution is to apply application Segregation means try to locate all select query on one node and all DML on another node.
  • Tune LGWR
  • Tune Interconnect

Stay Tuned for more detail on Oracle RAC wait events.

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

Anuradha’s LinkedIn: Anuradha’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

 

About The Author

Comments

  1. Pingback: Block-Related Oracle Rac Wait Events – Part 1 - SSWUG.ORG

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.