-
How to get Session ID
How can I get the session id of my currently connected session
-
select userenv('sessionid') from dual;
well Stestakov is having better idea than me , may be u can search on this in this web site itself
-
The sessionid returned from userenv('sessioid') is not listed in the output of V$SESSION.
SQL> select userenv('sessionid') from dual;
USERENV('SESSIONID')
--------------------
18817
SQL> select username,sid,serial# from v$session;
USERNAME SID SERIAL#
------------------------------ ---------- ----------
1 1
2 1
3 1
4 1
5 1
6 1
7 1
PFIN 9 3284
SPA 10 1490
SPA 16 2298
SPA 18 788
USERNAME SID SERIAL#
------------------------------ ---------- ----------
PROSPECTOR 19 975
21 957
SPA 22 480
14 rows selected.
-
SELECT sid FROM v$mystat WHERE rownum=1;
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
select * from v$session
where sid= (Select distinct sid from v$mystat);
-
Originally posted by mrvajrala
select * from v$session
where sid= (Select distinct sid from v$mystat);
pretty costy query to get your sid
-
Well I tried to get all my session info.. an it took 1 sec for me to get the output...
-
because you are the only user arnet you? your query uses an innecessary order by and subquery...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|