1、
select s.machine, s.username, s.status, s.prev_exec_start, s.logon_time, s.* from v$session s
where s.service_name = '數據庫sid' and s."USERNAME"='數據庫連接用戶名' and s.machine like '%當前計算機名%'
order by s.machine, s.username, s.prev_exec_start desc;
2、
select s.machine, s.username, s.status, s.prev_exec_start, s.logon_time, s.* from v$session s
where s.service_name = 'xxxx' and s.machine like '%xxxxxxx%'
order by s.machine, s.username, s.prev_exec_start desc;
Status of the session:
ACTIVE - Session currently executing SQL
INACTIVE
KILLED - Session marked to be killed
CACHED - Session temporarily cached for use by Oracle*XA
SNIPED - Session inactive, waiting on the client