Oracle PL/SQL/SQL Plus/USERENV
userenv("sessionid")
SQL>
SQL> -- ALTER SESSION SET SQL_TRACE = TRUE
SQL> -- SQL statement(s) to be traced ...
SQL> -- ALTER SESSION SET SQL_TRACE = FALSE
SQL>
SQL>
SQL> select a.spid
2 from v$process a, v$session b
3 where a.addr = b.paddr
4 and b.audsid = userenv("sessionid")
5 /
928
1 row selected.
SQL>
USERENV("TERMINAL")
SQL>
SQL> SELECT USERENV("TERMINAL") FROM DUAL;
USERENV("TERMINA
----------------
J
SQL>
SQL>