Oracle查看和修改连接数(进程/会话/并发等等)
时间:2024-01-21 15:59:42
1.查询数据库当前进程的连接数:
select count(*) from v$process;
2.查看数据库当前会话的连接数:
elect count(*) from v$session;
3.查看数据库的并发连接数:
select count(*) from v$session where status='ACTIVE';
4.查看当前数据库建立的会话情况:
select sid,serial#,username,program,machine,status from v$session;
5.查询数据库允许的最大连接数:
select value from v$parameter where name = 'processes';
或者命令:show parameter processes;
6.修改数据库允许的最大连接数:
alter system set processes = 300 scope = spfile;
(需要重启数据库才能实现连接数的修改)
重启数据库:
SQL>shutdown immediate;
SQL>startup;
查看当前有哪些用户正在使用数据:
SQL>select osuser,a.username,cpu_time/executions/1000000||'s',sql_fulltext,machine
SQL>from v$session a,v$sqlarea b
SQL>where a.sql_address = b.address
SQL>order by cpu_time/executions desc;
备注:UNIX 1个用户session对应一个操作系统process,而Windows体现在线程。
启动oracle
su - oracle
SQL>sqlplus system/pwd as sysdba //进入sql
SQL>startup //启动数据库
SQL>lsnrctl start //启动监听
sqlplus "/as sysdba"
SQL>shutdown immediate; //关闭数据库
SQL>startup mount;
SQL>alter database open;
标签:Oracle,连接数
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
mysql使用LOAD语句批量录入数据
2010-03-18 16:19:00
详解Python模块化编程与装饰器
2023-06-30 19:49:07
python数据分析实战指南之异常值处理
2023-04-19 21:02:18
![](https://img.aspxhome.com/file/2023/9/123479_0s.png)
Go语言如何使用golang-jwt/jwt/v4进行JWT鉴权详解
2024-02-07 05:13:41
![](https://img.aspxhome.com/file/2023/7/105147_0s.jpg)
python将一个英文语句以单词为单位逆序排放的方法
2022-03-23 16:48:08
Python设计模式之状态模式原理与用法详解
2022-04-16 06:37:36
![](https://img.aspxhome.com/file/2023/3/108023_0s.png)
vue语法之拼接字符串的示例代码
2024-04-30 10:21:30
![](https://img.aspxhome.com/file/2023/0/130260_0s.png)
Python自动化测试之登录脚本的实现
2022-11-18 07:30:50
![](https://img.aspxhome.com/file/2023/8/81628_0s.jpg)
关于Python包导入报错的问题总结
2021-02-05 18:13:46
![](https://img.aspxhome.com/file/2023/7/75257_0s.png)
MySQL索引之主键索引
2024-01-25 01:52:04
python自动化脚本安装指定版本python环境详解
2022-08-14 11:31:46
![](https://img.aspxhome.com/file/2023/9/113129_0s.png)
Pyscript使用本地Pyodide配置步骤
2021-06-12 06:58:49
如何让新页面在新窗口打开?
2009-04-12 19:41:00
SQLServer注释快捷键操作
2024-01-25 20:45:38
![](https://img.aspxhome.com/file/2023/5/79155_0s.jpg)
MySQL使用IF函数动态执行where条件的方法
2024-01-25 02:46:34
![](https://img.aspxhome.com/file/2023/4/71054_0s.png)
python scatter函数用法实例详解
2021-12-17 11:51:50
![](https://img.aspxhome.com/file/2023/4/101434_0s.png)
正则表达式字面量在ECMAScript5中的变化
2012-04-26 16:23:16
用Pelican搭建一个极简静态博客系统过程解析
2022-07-21 19:18:39
![](https://img.aspxhome.com/file/2023/3/127123_0s.png)
Django如何配置mysql数据库
2024-01-18 03:27:30
![](https://img.aspxhome.com/file/2023/6/70196_0s.png)
python处理文本文件并生成指定格式的文件
2021-05-16 15:43:42