文章目录
- 1. MySQL
- 2. Oracle
1. MySQL
-- 查看最大连接数
show variables like 'max_connections';
select @@max_connections;
-- select * from performance_schema.session_variables where VARIABLE_NAME in ('max_connections');
-- select * from performance_schema.global_variables where VARIABLE_NAME in ('max_connections');
-- select * from performance_schema.persisted_variables where VARIABLE_NAME in ('max_connections');
-- 查看当前连接数
show status like 'Threads_connected';
select count(1) from processlist;
2. Oracle
-- 允许最大进程数、连接数
select name,value from v$parameter where name in('processes' ,'sessions');
-- 当前进程数、连接数
select count(1) from v$session;
select count(1) from v$process;