-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground_sessions.sql
More file actions
17 lines (16 loc) · 894 Bytes
/
Copy pathbackground_sessions.sql
File metadata and controls
17 lines (16 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
------------------------------------------------------------------------------
-- Script : instance/background_sessions.sql
-- Purpose : Show the database name and the server hosting the background
-- sessions, a quick check of which node you are connected to.
-- Usage : sqlplus / as sysdba @instance/background_sessions.sql
-- Requires : SELECT_CATALOG_ROLE
-- Tested on : Oracle Database 11gR2, 12cR1 and 12cR2
--
-- Copyright (c) 2026 Mohamed Dawood. MIT Licence; see LICENSE.
------------------------------------------------------------------------------
-- Sessions with no username are the background processes; this shows the
-- database and the server they are running on, which is the quickest way to
-- confirm which RAC node you reached.
SELECT DISTINCT d.name AS database_name, s.machine AS server
FROM v$database d, v$session s
WHERE s.username IS NULL;