oracle查看允许的最大连接数和当前连接数等信息(转自:http://blog.csdn.net/haiross/article/details/41944493)
2016-06-16 11:22
525 查看
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 --最大连接
相关文章推荐
- 钥匙串KeyChain的使用
- “机器学习”相关资料分享
- tail和head命令
- INS-35172 Target database memory(945MB) excessds the systems available shared memory({0}MB)
- 工作于内存和文件之间的页缓存, Page Cache, the Affair Between Memory and Files
- Paint House
- Openstack组件部署 — keystone(domain, projects, users, and roles)
- 2D Closest Pair Problem
- 朴素贝叶斯简易解释
- Intellij Idea essentails 翻译
- xiugai DNS
- 将main方法打成jar包,并引用第三方的maven jar包
- failed to load the JNI shared library
- Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536
- FATAL EXCEPTION: main,创建两个Activity,运行子Activity时程序崩溃的可能解决办法
- 等待通知机制 wait,notify,notifyAll
- git当移动文件与更改文件共存Please enter a commit message to explain why this merge is necessary
- The XLIFF file does not contain a target language
- AIDL跨进程通讯访问远程服务
- 李开复万字长文科普人工智能:AI是什么 将带我们去哪儿?