How to find your session id (SID)?

Using one of the following you can find your session id (SID).

SQL> SELECT sid FROM v$mystat WHERE rownum = 1;

SID
———-
145

SQL> SELECT sid FROM V$SESSION WHERE audsid = userenv(‘sessionid’);

SID
———-
145

SQL> SELECT sid FROM V$SESSION WHERE audsid = SYS_CONTEXT(‘userenv’,’sessionid’);

SID
———-
145

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s