I am talking about the user id of the application, You see when a user logs in (using his user id) in the web application it passes to the Weblogic Server, and oracle sees the connection pool the user is using and not the user id. I am looking at another way of doing that with the help of the application, only I need to find out my current session id when I log into the database. Using sqlplus, how can I do that?
it's the SID in v$session I guess is what you are looking for? But anyway how can you know which application user is using which connection, at least in our case the connection from the connection pool are shared mostly.... and there isnt anyway to determine in what moment an application user is using that connection (or not that I am aware since I am not very familiar with Java and WebLogic) And from v$session it just says JDBC connection
What I am thingking is to embed a code in the application so that everytime a user logs in the Web application, it first check his own Oracle session id, then together with the user id, the java code will store that information to a table, which I can relate to the v$session.
Let's say I log in to the database(SQL Plus) as my own user id, how can I querry my own session id from v$session without getting the other session id.
Ex.
Select sid from v$session where sid=(my current sid)
------------------------------------------
select sid, username
from v$session
where audsid = userenv('sessionid');
------------------------------------------
Have you tried putting this SQL in a DB trigger? I tried but I am getting some errors. I am tring to get the session id of user who fired the trigger(update or delete a table). Is this possible?
Without the error(s) it is difficult to tell what can be the problem.
Probably privilege SELECT ON V_$SESSION is granted to the owner of the trigger trough a role and not directly to the user.
Try granting SELECT ON V_$SESSION, as SYS, to the owner of the trigger.
Bookmarks