Chapter 18 · RAC and Clustered Oracle Concepts

Global Cache Waits, Hot Blocks, Sequence/Index Contention, and Scale-Out Workload Design

Diagnose global-cache latency and contention from gc waits, hot blocks, SQL/object evidence and service placement, then choose sequence/index/data-affinity changes that reduce inter-instance block movement before adding nodes.

Advanced125–145 minutesHot-index/sequence design + RAC diagnostic workflowNo AWR/ASH required in mandatory pathgc waits are RAC-only evidenceLast reviewed: August 2026

Learning outcomes

After adding a second RAC node, ServiceHub throughput gets worse. Both instances insert into the same right-growing primary-key index and update the same “open queue” rows. Sessions spend time transferring blocks between caches. More CPU was added, but the bottleneck became global cache contention. RAC performance work begins by locating the blocks/objects/SQL that move or wait—not by adding a third node.

01

Interpret the Cluster wait class and common gc current/cr/buffer-busy outcomes.

02

Map RAC waits to SQL and objects using GV$SYSTEM_EVENT, GV$SESSION, GV$SQLAREA and GV$SEGMENT_STATISTICS.

03

Explain hot blocks and why sequential right-growing indexes can ping between instances.

04

Use sequence CACHE/NOORDER, scalable-sequence concepts, reverse-key/hash-partitioned indexes and service/data affinity selectively.

05

Run a Free right-growing-index design lab while explicitly stating that no gc wait can occur on one instance.

Generation-time baseline, licensing, topology, and tooling boundary

This chapter was reviewed against Oracle AI Database 26ai RU 23.26.3, SQL Developer 26.2, and SQLcl 26.2.1. Oracle AI Database Free is limited to 2 foreground CPU cores, 2 GB combined SGA/PGA RAM, 12 GB user data, one installation per logical environment, and receives no Release Update patches or Oracle Support service requests. Current 26ai licensing marks Oracle Real Application Clusters (RAC) unavailable in Free, SE2-ODA, BaseDB SE, BaseDB EE, and BaseDB EE-HP; RAC is an extra-cost option on EE/EE-ES and included with BaseDB EE-EP and ExaDB. Actual RAC requires Oracle Grid Infrastructure/Clusterware, multiple cluster nodes, shared database storage, a low-latency private interconnect, public/VIP/SCAN networking, and a certified platform. Mandatory Free labs therefore validate single-instance workload/service/storage facts and RAC design decisions; they never attempt to form a RAC cluster. Dynamic V$/GV$ diagnostics shown for entitled RAC systems avoid AWR/ASH so the lesson does not require Diagnostics Pack.

1. A Cache Fusion request becomes a precise gc wait outcome

RAC global-cache waits belong to the Cluster wait class. A session initially requests a gc current block or gc cr block; Oracle later attributes the wait to a more precise outcome such as 2-way, 3-way, busy or congested.

gc current block busy/gc cr block busy mean the requested block could not be shipped immediately—for example it was pinned, busy, waiting on remote log flush, or queued behind concurrent access. gc buffer busy acquire/release indicates local access is waiting behind an outstanding global-cache operation on that buffer.

2. Start with cluster wait deltas, not lifetime totals

sql · entitled RAC: cumulative wait evidence by instance
SELECT  inst_id,  event,  total_waits,  time_waited_micro,  CASE WHEN total_waits > 0       THEN ROUND(time_waited_micro/1000/total_waits,3)  END AS avg_msFROM gv$system_eventWHERE wait_class='Cluster'ORDER BY time_waited_micro DESC;

Take two timestamped snapshots around the slow interval. High counts with tiny service time can be harmless; fewer long waits on a critical request path can be serious. Compare CPU/run queue and interconnect health before blaming “Cache Fusion” generically.

3. Find the active block and SQL

sql · entitled RAC: sessions currently waiting on gc blocks
SELECT  inst_id,  sid,  serial#,  sql_id,  event,  p1 AS file_no,  p2 AS block_no,  seconds_in_waitFROM gv$sessionWHERE event LIKE 'gc %'ORDER BY seconds_in_wait DESC;
sql · cluster wait time attributed to SQL
SELECT *FROM (  SELECT    inst_id,    sql_id,    executions,    buffer_gets,    cluster_wait_time,    elapsed_time,    sql_text  FROM gv$sqlarea  WHERE cluster_wait_time > 0  ORDER BY cluster_wait_time DESC)FETCH FIRST 20 ROWS ONLY;

CLUSTER_WAIT_TIME helps prioritize SQL, but high cluster time may be a symptom of object hot spots or instance placement. Read the plan and object access pattern before rewriting SQL.

4. Identify globally shared/hot segments

sql · entitled RAC: segment-level global-cache statistics
SELECT *FROM (  SELECT    inst_id,    owner,    object_name,    subobject_name,    object_type,    statistic_name,    value  FROM gv$segment_statistics  WHERE statistic_name IN (    'gc current blocks received',    'gc cr blocks received',    'gc buffer busy'  )  ORDER BY value DESC)FETCH FIRST 30 ROWS ONLY;

If the same few index/table blocks dominate across instances, investigate hot-row/update concentration, right-growing indexes, freelist/ITL/block concurrency, service placement and batch partitioning.

5. Sequential keys can create a right-hand index hot spot

When monotonically increasing primary keys are indexed, new keys target the right-most B-tree leaf range. Concurrent inserts from several RAC instances can repeatedly request/modify the same leaf blocks, causing inter-instance ownership movement.

A reverse-key index reverses key bytes so adjacent numeric keys land across different leaf areas; it can reduce right-edge contention, but ordinary range scans over the original key ordering lose their natural B-tree range-order benefit. A hash-partitioned index or scalable sequence can be better when range access still matters.

6. Sequence configuration can amplify or reduce coordination

Oracle recommends CACHE for sequences in RAC. CACHE NOORDER has the least sequence-generation coordination cost for ordinary surrogate keys and is the default style. ORDER guarantees request ordering and adds global ordering work; 26ai includes ordered-sequence optimizations, but ordering is still a semantic requirement you should request only when needed.

Scalable sequences add an instance/session-derived offset to spread high-concurrency generated keys and significantly reduce both sequence and index-block contention. They intentionally produce noncompact/nonchronological key values.

sql · entitled/single-instance valid SQL: ordinary cached surrogate-key sequence
CREATE SEQUENCE servicehub_event_seq  START WITH 1  INCREMENT BY 1  CACHE 1000  NOORDER;

1000 is a demonstration value, not a universal RAC cache size. Sequence gaps are normal and can increase after instance failure/restart; never use sequence gaplessness as a financial/legal numbering guarantee without a dedicated design.

7. Free design lab: observe the right-growing index and an alternative

sql · setup
BEGIN  EXECUTE IMMEDIATE 'DROP TABLE servicehub_rac_insert PURGE';EXCEPTION WHEN OTHERS THEN  IF SQLCODE != -942 THEN RAISE; END IF;END;/BEGIN  EXECUTE IMMEDIATE 'DROP SEQUENCE servicehub_event_seq';EXCEPTION WHEN OTHERS THEN  IF SQLCODE != -2289 THEN RAISE; END IF;END;/CREATE SEQUENCE servicehub_event_seq  CACHE 1000  NOORDER;CREATE TABLE servicehub_rac_insert (  event_id NUMBER NOT NULL,  status_code VARCHAR2(12) NOT NULL,  payload VARCHAR2(100),  CONSTRAINT sh18_event_pk PRIMARY KEY(event_id));INSERT INTO servicehub_rac_insertSELECT servicehub_event_seq.NEXTVAL,       'OPEN',       RPAD('x',50,'x')FROM dualCONNECT BY LEVEL <= 20000;COMMIT;
sql · inspect index design and reverse it for the structural experiment
SELECT index_name,index_type,statusFROM user_indexesWHERE table_name='SERVICEHUB_RAC_INSERT';ALTER INDEX sh18_event_pk REBUILD REVERSE;SELECT index_name,index_type,statusFROM user_indexesWHERE index_name='SH18_EVENT_PK';

The lab shows a real Oracle index design alternative, but on Free there is only one instance, so it cannot demonstrate global-cache block pinging. Compare point lookups and any required range queries before adopting reverse key.

sql · cleanup
DROP TABLE servicehub_rac_insert PURGE;DROP SEQUENCE servicehub_event_seq;

8. Service/data affinity can be more powerful than changing the index

If ServiceHub regions/tenants naturally own disjoint hot working sets, services can route those workloads preferentially to instances so the same blocks remain local more often. Affinity must follow real workload/data boundaries; arbitrary pinning can create imbalance or reduce failover capacity.

Symptom Possible mechanism Candidate response
Hot right-edge PK index Sequential concurrent inserts Scalable sequence, reverse/hash-partitioned index if access pattern fits
Same queue rows updated everywhere Cross-instance hot rows Service/data affinity, queue partitioning, redesign hot-row protocol
High gc waits + high CPU Remote instance cannot serve blocks quickly Fix CPU/load/interconnect before schema changes
Broad SQL touches shared working set Large cross-instance block footprint Tune SQL/plan/indexing; reduce blocks accessed

9. Deliberately wrong: add another RAC node to fix hot blocks

If two instances already fight over the same small set of blocks, adding a third requester can increase ownership movement and queuing. Capacity scale-out works best when the workload can be distributed; contention scale-out requires changing the contention mechanism.

10. Production judgment

Use cluster wait deltas, SQL/object attribution and interconnect/CPU evidence before changing schema or placement. Prefer ordinary SQL/index tuning first when a statement touches too many blocks. Use service affinity and specialized key/index designs only when the workload shape supports them and after validating range-query/operational tradeoffs.

No hidden/underscore RAC parameters are recommended. ADDM/AWR may help on licensed deployments, but this lesson's core views do not require them. Lesson 4 shifts from steady-state contention to state changes: a RAC node fails or is deliberately drained for maintenance and the cluster must reconfigure without turning a planned operation into an outage.

Check your understanding

  1. What wait class contains RAC global-cache waits?
  2. What does gc current block busy indicate at a high level?
  3. Why can a monotonically increasing key be problematic across RAC instances?
  4. What is the usual sequence recommendation for scalable surrogate keys in RAC?
  5. Why can adding another node worsen a hot-block problem?
Review the answers

The Cluster wait class.

The requested current block could not be shipped/granted immediately because it was busy/pinned/delayed/queued during global coordination.

Concurrent inserts can repeatedly modify the same right-most index leaf blocks, causing cross-instance ownership movement.

Use a cached sequence, normally CACHE NOORDER unless ordering semantics are truly required; consider scalable sequences for high-concurrency key ingestion.

More instances can become additional contenders for the same small block set, increasing Cache Fusion traffic and queues.

Authoritative references

Keep knowledge open

Help the academy stay free and grow.

If these tutorials save you time, a small donation supports new lessons, technical review, diagrams, examples, and long-term maintenance.

ETHEthereum / ERC-20 only
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0

Send only Ethereum or ERC-20 compatible assets to this address.