如何檢視oracle當前連線數,會話數 收藏
檢視session:
select * from v$session where username is not null
select username,count(username) from v$session where username is not null group by username
當前連線數:
select count(*) from v$process
檢視連線數引數的設定情況
select value from v$parameter where name = 'processes'
select count(*) from v$session where status='active' #併發連線數
先檢視哪些表被鎖住了
select b.owner,b.object_name,a.session_id,a.locked_mode
from v$locked_object a,dba_objects b
where b.object_id = a.object_id;
select b.username,b.sid,b.serial#,logon_time
from v$locked_object a,v$session b
where a.session_id = b.sid order by b.logon_time;
殺會話alter system kill session 'sid,serial#';
1.查哪個過程被鎖
查v$db_object_cache檢視:
select * from v$db_object_cache where owner='過程的所屬使用者' and clocks!='0';
2. 查是哪乙個sid,通過sid可知道是哪個session.
查v$access檢視:
select * from v$access where owner='過程的所屬使用者' and name='剛才查到的過程名';
3. 查出sid和serial#
查v$session檢視:
select sid,serial#,paddr from v$session where sid='剛才查到的sid'
查v$process檢視:
select spid from v$process where addr='剛才查到的paddr';
4. 殺程序
(1).先殺oracle程序:
alter system kill session '查出的sid,查出的serial#';
(2).再殺作業系統程序:
kill -9 剛才查出的spid
或orakill 剛才查出的sid 剛才查出的spid
Oracle會話數量查詢及結束會話方法
一 資料庫會話數量查詢 查詢當前資料庫會話數量 select from v session 修改資料庫最大會話數量 alter system set processes 500 scope spfile 在命令模式下執行 檢視當前資料庫最大會話上限 show parameters processes...
Oracle會話學習
1.檢視當前會話和程序 select count 1 from v session select count 1 from v process 檢視當前總會話數和程序數,這兩個檢視就是跟會話及程序有關的重要檢視啦,資訊都是從這裡面取的。2.查詢應用連線數多少,訪問的機器和應用程式 select b....
oracle 當前會話
查詢oracle正在執行的sql語句及執行該語句的使用者 select b.sid oracleid,b.username 登入oracle使用者名稱 b.serial spid 作業系統id paddr,sql text 正在執行的sql b.machine 計算機名 from v process...