总结在日常中查看数据库连接情况的语句,供参看
1.
select count(*) from v$process
select count(*) from v$process where program=‘Oracle.EXE(SHAD)’; --当前的数据库连接数
2.
select value from v$parameter where name ='processes'--数据库允许的最大连接数
3.
alter system set processes = 300 scope = spfile;--修改最大连接数:
4.
shutdown immediate;
startup;--重启数据库
5.
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.
select count(*) from v$session
7.
select count(*) from v$session where status='ACTIVE' --并发连接数
8.
show parameter processes--最大连接
原文链接:https://www.f2er.com/oracle/208523.html