How can i know my SID session when i connect to ORACLE ??
Printable View
How can i know my SID session when i connect to ORACLE ??
select sid, serial# , username from v$session
where username = 'yourname';
SELECT sid
FROM v$session
WHERE audsid = userenv('SESSIONID');
You can have more sessions with the same username.
Hi akkerend.
This query is great! But what exactly is audsid? And what does the function 'userenv' do? Thanks.
The function USERENV('option') returns information about the current session. Other options are TERMINAL and LANGUAGE.
AUDSID is the auditing session ID. It's a unique ID for sessions, used for auditing. AUDSID is 0 for sessions created by jobs.