oracle 查看最大连接数和当前连接数,查看当前有哪些用户正在使用数据
发布日期:2021-10-03 01:52:03 浏览次数:12 分类:技术文章

本文共 1251 字,大约阅读时间需要 4 分钟。

oracle查看允许的最大连接数和当前连接数等信息
标签:
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 --最大连接

转载地址:https://blog.csdn.net/kai402458953/article/details/88340428 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:varchar(16)在mysql和oracle中分别能插入多少汉字
下一篇:在Eclipse中使用Axis2插件自动生成WSDL文件

发表评论

最新留言

能坚持,总会有不一样的收获!
[***.219.124.196]2024年04月25日 06时41分04秒