Home » RDBMS Server » Server Utilities » v$session module :(
v$session module :( [message #69573] Mon, 04 February 2002 01:11 Go to next message
JOHN
Messages: 182
Registered: April 1998
Senior Member
Hi Folks, i'm trying to write a little sql which will pick up the name of the sql script that is being executed by the user. I can get this information by selecting module from v$session ... but this will only work if the user runs the script from sqlplus, and NOT svrmgr.

Does anyone know why there is no data in the v$session column module, when selected from svrmgr ???

any ideas, tips would be greatly appreciated !

best regards.

p.s Here's the code which works when the user runs the script from sqlplus...

SELECT sysdate, module, osuser, userenv('TERMINAL')FROM dual, v$session where v$session.audsid = (select userenv('SESSIONID') from dual);
Re: v$session module :( [message #69586 is a reply to message #69573] Tue, 05 February 2002 08:15 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Oracle doesn't automatically know which program is connecting to it, that program needs to identify itself. You can bet that sqlplus uses dbms_application_info to do that. Just include this in your script...

begin
dbms_application_info.set_module( 'svrmgr script #1', 'stage 3/7' );
end;

Of course it's the script identifying itself so if you run it from sqlplus it will report the same info. In sqlplus there is glogin.sql (for all users) and login.sql (your specific startup script) where you could run stuff like this. Maybe svrmgr has something similar. Remember though, that when you connect to a new user (and get a new session) using "connect user/pass" the login.sql or glogin.sql doesn't run. Using dbms_application_info you can set this info at each stage of your script so that you can monitor it's progress as it runs.
Previous Topic: oracle - export
Next Topic: Re: Import txt file to Oracle SQL* Plus
Goto Forum:
  


Current Time: Thu Mar 28 13:42:28 CDT 2024