ORASOLU TOOLBOX · HIGH AVAILABILITY

RAC Services

Practical Oracle RAC SQL for reviewing active services, service placement, session distribution and service-level performance.

ORASOLU TOOLBOX · HIGH AVAILABILITY

Understand how services are distributed across RAC

Review active services, instance placement, session distribution and service-level metrics to understand how application workload is being delivered across the cluster.

01 · ACTIVE SERVICES

Review active RAC services

View services currently active on RAC instances and inspect their connection and load-balancing attributes.

SELECT
    inst_id,
    service_id,
    name,
    network_name,
    goal,
    clb_goal,
    blocked
FROM gv$active_services
ORDER BY name, inst_id;
02 · SERVICE INSTANCES

Map services to RAC instances

Identify which RAC instances are currently hosting each active database service.

SELECT
    s.name AS service_name,
    i.inst_id,
    i.instance_name,
    i.host_name,
    s.blocked
FROM gv$active_services s
JOIN gv$instance i
    ON i.inst_id = s.inst_id
ORDER BY s.name, i.inst_id;
03 · SESSION DISTRIBUTION

Review sessions by service

See how current database sessions are distributed across services and RAC instances.

SELECT
    inst_id,
    service_name,
    status,
    COUNT(*) AS session_count
FROM gv$session
WHERE service_name IS NOT NULL
GROUP BY
    inst_id,
    service_name,
    status
ORDER BY
    service_name,
    inst_id,
    status;
04 · SERVICE ATTRIBUTES

Inspect service configuration

Review service names, network names, runtime load-balancing goals and HA notification settings.

SELECT
    service_id,
    name,
    network_name,
    goal,
    dtp,
    aq_ha_notification,
    clb_goal
FROM v$services
ORDER BY name;
05 · SERVICE METRICS

Review service call metrics

Compare recent service-level call rate, CPU per call and database time per call.

SELECT
    service_name,
    begin_time,
    end_time,
    dbtimepercall,
    cpupercall,
    callspersec
FROM gv$servicemetric
WHERE group_id = 10
ORDER BY
    service_name,
    begin_time DESC
FETCH FIRST 20 ROWS ONLY;
06 · SERVICE WAIT CLASSES

Review waits by service

Identify wait classes accumulating the most waits and wait time for each database service.

SELECT
    service_name,
    wait_class,
    total_waits,
    ROUND(time_waited / 100, 2) AS wait_seconds
FROM gv$service_wait_class
WHERE wait_class <> 'Idle'
ORDER BY
    time_waited DESC
FETCH FIRST 20 ROWS ONLY;

ORASOLU TOOLBOX · HIGH AVAILABILITY

RAC services connect application workload to the cluster.

Service placement and session distribution should be considered together when investigating RAC workload behavior. Active service views show where services are currently offered, while service metrics and wait statistics provide additional workload context.

Oracle documents GV$ views as global versions of dynamic performance views, with INST_ID identifying the instance that supplied each row.