TTITLE CENTER "More Session-Level Information from SYS_CONTEXT()"
COLUMN ipaddr FORMAT A15 HEADING "IP Address"
COLUMN host FORMAT A20 HEADING "Host"
COLUMN netprtc FORMAT A8 HEADING "Network|Protocol"
COLUMN curruser FORMAT A8 HEADING "Current|User"
COLUMN currschema FORMAT A8 HEADING "Current|Schema"
COLUMN fgjob FORMAT A4 HEADING "FG|Job?"
COLUMN bgjob FORMAT A4 HEADING "BG|Job?"
SELECT
SYS_CONTEXT('USERENV', 'IP_ADDRESS', 15) ipaddr
,SYS_CONTEXT('USERENV', 'HOST', 16) host
,SYS_CONTEXT('USERENV', 'NETWORK_PROTOCOL', 8) netprtc
,SYS_CONTEXT('USERENV', 'CURRENT_USER', 8) curruser
,SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA', 8) currschema
,SYS_CONTEXT('USERENV', 'FG_JOB_ID', 4) fgjob
,SYS_CONTEXT('USERENV', 'BG_JOB_ID', 4) bgjob
FROM DUAL;
Tags:
Oracle