oracle 最大連接數 併發連接數
兩個參數間的關係:sessions=1.1*processes+5
目前總結的語句,在查看數據的連接情況很有用,寫完程序一邊測試代碼一邊查看數據庫連接的釋放情況有助於分析優化出一個健壯的系統程序來。
1.Sql代碼
1.select count(*) fromv$process
select count(*) from v$process where program=‘ORACLE.EXE(SHAD)’; --當前的數據庫連接數
2.Sql代碼
1.select value from v$parameter where name ='processes'
select value from v$parameter where name ='processes'--數據庫允許的最大連接數
3.Sql代碼
1.alter system set processes = 300 scope =spfile;
alter system set processes = 300 scope = spfile;--修改最大連接數:
4.Sql代碼
1.shutdown immediate;
2.startup;
shutdown immediate;
startup;--重啓數據庫
5.Sql代碼
1.SELECT osuser, a.username,cpu_time/executions/1000000||'s',b.sql_text,machine
2.from v$session a, v$sqlareab
3.where a.sql_address =b.address order by cpu_time/executionsdesc;
SELECT osuser, a.username,cpu_time/executions/1000000||'s',b.sql_text,machine
from v$session a, v$sqlarea b
where a.sql_address =b.address order by cpu_time/executionsdesc;
--查看當前有哪些用戶正在使用數據
6.Sql代碼
1.select count(*) fromv$session
select count(*) from v$session --當前的session連接數
7.Sql代碼
1.select count(*) from v$session wherestatus='ACTIVE'
select count(*) from v$session where status='ACTIVE' --併發連接數
8.Sql代碼
1.show parameterprocesses
show parameter processes --最大連接
參考:
Oracle 動態性能表 v$session & v$process各個字段的說明
v$process 中的TRACEFILE 字段
v$session & v$process各字段的說明【轉載】
v$session,v$process,v$mystat,v$statname剖析(還算不錯)