页面“Linux安全及服务器安全”与“Oracle最大连接数查看及修改”之间的差异
(页面间的差异)
跳到导航
跳到搜索
小 (导入1个版本) |
docker>Evan |
||
第1行: | 第1行: | ||
− | + | <pre> | |
− | + | SQL: | |
− | + | 1. 查看当前的数据库连接数 | |
− | |||
− | + | select count(*) fromv$process | |
− | + | select count(*) from v$process where program=‘Oracle.EXE(SHAD)’; | |
− | = | ||
− | + | 2. 查看数据库允许的最大连接数 | |
− | + | select value from v$parameter where name ='processes' | |
− | = | ||
− | = | + | 3. 查看当前有哪些用户正在使用数据 |
+ | SELECT osuser, a.username,cpu_time/executions/1000000||'s',b.sql_text,machine | ||
+ | from v$session a, v$sqlareab | ||
+ | where a.sql_address =b.address order by cpu_time/executionsdesc; | ||
− | + | 4. 查看当前的session连接数 | |
+ | select count(*) fromv$session | ||
− | = | + | 5. 查看并发连接数 |
− | + | select count(*) from v$session where status='ACTIVE' | |
+ | |||
+ | 命令: | ||
+ | 1. 查看最大连接数 | ||
+ | show parameter processes | ||
− | = | + | 2. 修改最大连接数 我们用了这个 并重启oracle 201811 |
+ | alter system set processes = 300 scope = spfile; | ||
− | + | 3. 重启数据库 | |
− | + | shutdown immediate; | |
+ | startup; </pre> | ||
− | + | [https://blog.csdn.net/hongweigg/article/details/61919723 ORACLE 查看当前连接数、修改最大连接数相关SQL] | |
− | + | [http://st4024589553.iteye.com/blog/2367373 oracle 查看最大连接数和当前连接数,查看当前有哪些用户正在使用数据] | |
− | + | [[category:oracle]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
2018年11月1日 (四) 06:14的版本
SQL: 1. 查看当前的数据库连接数 select count(*) fromv$process select count(*) from v$process where program=‘Oracle.EXE(SHAD)’; 2. 查看数据库允许的最大连接数 select value from v$parameter where name ='processes' 3. 查看当前有哪些用户正在使用数据 SELECT osuser, a.username,cpu_time/executions/1000000||'s',b.sql_text,machine from v$session a, v$sqlareab where a.sql_address =b.address order by cpu_time/executionsdesc; 4. 查看当前的session连接数 select count(*) fromv$session 5. 查看并发连接数 select count(*) from v$session where status='ACTIVE' 命令: 1. 查看最大连接数 show parameter processes 2. 修改最大连接数 我们用了这个 并重启oracle 201811 alter system set processes = 300 scope = spfile; 3. 重启数据库 shutdown immediate; startup;