Any way to get contextual information about different db connections

We have an application identifier (suppose APP_ID) to connect to the database and use dbms_session.set_context () to set the actual registered user (for example: user1, user2) for VPD.

For performance issues in queries, we want to define the user that runs it (user1, user2). Is there a way to get dbms_session.get_context () connections by providing sid?

  • Suppose a DBA can run it.
  • I want to reset the actual user id from the context and its connection identifier (sid)
  • Oracle Database

I know that an application registration or dba trace or information registration procedure can be created ... I just want to know if there is any of the mailboxes?

+3
source share
1 answer

If you have a DBA running, you can access the view V$SESSION. A simple query like this will give you all the connected sid and their usernames:

select
       substr(sid,1,5) sid,
       substr(serial#,1,5) ser_num,
       substr(machine,1,6) box,
       substr(username,1,10) username,
       substr(osuser,1,8) os_user,
       substr(program,1,30) program
from v$session
where
and type='USER'
order by username;

If you are only looking for current requests and the user / sid, you can run something like the one described here in this.

0
source

All Articles