MySQL、Oracle數(shù)據(jù)庫如何查看最大連接數(shù)和當(dāng)前連接數(shù)
1. MySQL
-- 查看最大連接數(shù) 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'); -- 查看當(dāng)前連接數(shù) show status like 'Threads_connected'; select count(1) from processlist;
2. Oracle
-- 允許最大進程數(shù)、連接數(shù) select name,value from v$parameter where name in('processes' ,'sessions'); -- 當(dāng)前進程數(shù)、連接數(shù) select count(1) from v$session; select count(1) from v$process;
附:Oracle連接數(shù)的調(diào)整
1. 查看最大連接數(shù)
您可以使用以下任意一個方法來查詢:
show parameter processes;
或
select value from v$parameter where name ='processes';
2. 查看當(dāng)前連接數(shù)
select count(*) from v$process;
3. 調(diào)整最大連接數(shù)
與共享池大小一樣,建議您根據(jù)實際需求進行調(diào)整。
alter system set processes=1000 scope=spfile;
調(diào)整完畢后,請重啟數(shù)據(jù)庫服務(wù)以使更改生效。
總結(jié)
到此這篇關(guān)于MySQL、Oracle數(shù)據(jù)庫如何查看最大連接數(shù)和當(dāng)前連接數(shù)的文章就介紹到這了,更多相關(guān)SQL查看最大連接數(shù)和當(dāng)前連接數(shù)內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
使用MySQL子查詢和CASE語句判斷關(guān)聯(lián)狀態(tài)
在這篇文章中,我們將詳細講解如何使用 MySQL 的子查詢和 CASE 語句來實現(xiàn)復(fù)雜的邏輯判斷,具體案例是我們有兩個表 card_management 和 card_auth_register,通過代碼示例講解的非常詳細,需要的朋友可以參考下2024-06-06基于Mysql的IP處理函數(shù)inet_aton()與inet_ntoa()的深入分析
本篇文章是對Mysql的IP處理函數(shù)inet_aton()與inet_ntoa()進行了詳細的分析介紹,需要的朋友參考下2013-06-06MySQL線程處于Opening tables的問題解決方法
在本篇文章里小編給大家分享了關(guān)于MySQL線程處于Opening tables的問題解決方法,有興趣的朋友們學(xué)習(xí)下。2019-01-01MySQL產(chǎn)生隨機數(shù)并連接字符串的方法示例
這篇文章主要介紹了MySQL產(chǎn)生隨機數(shù)并連接字符串的方法,簡單分析了相關(guān)函數(shù),并結(jié)合實例形式給出了相應(yīng)的SQL語句實現(xiàn)方法,需要的朋友可以參考下2017-05-05