Oracle 監控當前用戶在當前機器下的連接信息Sql

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

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章