hussainkhan22
asked on
Oracle database use
Hey how do I find if anyone accessing oracle 11g database on linux. I mean which users are accessing the database and what are there doing. I really appreciate your help. Thanks in advance
V$Session
where status = 'ACTIVE'
select username,sid, status,program,server,type ,serial#
from v$session order by username
where status = 'ACTIVE'
Try this instead of select * from
from v$session order by username
where status = 'ACTIVE'
Try this instead of select * from
To get 'what' they are doing and when, you need to turn on auditing.
V$session will tell you who is currently logged in but not a history of who was logged in over time.
You can also look in the listener log file to see who has been connecting.
V$session will tell you who is currently logged in but not a history of who was logged in over time.
You can also look in the listener log file to see who has been connecting.
I find that having status='ACTIVE' actually filters out some users who are online but are currently not running anything.
This is what I use:
select a.username, b.sql_text, a.status
from v$session a, v$sqlarea b
where a.sql_address = b.address(+)
and a.username is not null;
This is what I use:
select a.username, b.sql_text, a.status
from v$session a, v$sqlarea b
where a.sql_address = b.address(+)
and a.username is not null;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
turn on auditting to get a historical list of activity
the results will be in DBA_AUDIT_TRAIL
the results will be in DBA_AUDIT_TRAIL
I sometimes use this also
select sid, serial#, username, a.status
from v$session a, v$sqlarea b
where b.hash_value = a.prev_hash_value
and a.username is not null;
select sid, serial#, username, a.status
from v$session a, v$sqlarea b
where b.hash_value = a.prev_hash_value
and a.username is not null;