denrepo

OracleRAC & ASM

Sessions per instance and service

How connections are spread across RAC nodes and services. A lopsided spread usually means a service isn't running where you think it is.

All RAC instances

Not yet verified. How scripts are tested

ora-rac-services.sql
1CLEAR COLUMNS2SET LINESIZE 100 PAGESIZE 100 TRIMOUT ON TAB OFF3COLUMN inst_id      HEADING "INST"     FORMAT 9994COLUMN service_name HEADING "SERVICE"  FORMAT A355COLUMN total        HEADING "SESSIONS" FORMAT 99,9906COLUMN active       FORMAT 99,9907 8SELECT inst_id, service_name,9       COUNT(*) AS total,10       SUM(CASE WHEN status = 'ACTIVE' THEN 1 ELSE 0 END) AS active11FROM gv$session12WHERE type = 'USER'13GROUP BY inst_id, service_name14ORDER BY inst_id, service_name;

Save it as ora-rac-services.sql and run it with SQL> @ora-rac-services.

Open in denrepoRelated tool: Connection string builder

Helps with

More Oracle scripts: RAC & ASM