displaying sid & serial# of current user
Hi,
I want to display sid and serial# of currently connected user but the sid & serial# should be displayed right after connection. I mean, once a user enters username/pass and press enter, before the SQL prompt, sid & serial# should be display. I tried running select sid,serial# from v$session where username=user; statement from glogin.sql file before setting the prompt but of no use. Even I tried creating a folder but could not. Below is my glogin.sql:
set lines 120
set pages 1000
set termout off
col sid new_value sid1
col prom new_value prom
select sys_context('USERENV','SESSION_USER')||'@'||sys_context('USERENV','DB_NAME')||'>' prom
from dual;
set sqlprompt ''
select sid,serial# from v_$session where username=user;
set sqlprompt "&prom "
set termout on
set lines 120
set pages 1500
Though Oracle version and OS is not applicable for this but still, I am running Oracle (9i,10g and 11g) on win xp. This is just a test system which I use for small testing of commands/triggers before deploying in any official environment.
TIA
-Onkar