當前位置:首頁 » 編程語言 » sql查詢連接數

sql查詢連接數

發布時間: 2024-04-09 21:02:53

sql+server+如何查看資料庫連接數

查詢資料庫當前進程的連接數:

selectcount(*)fromv$process;

查看資料庫當前會話的連接數:

selectcount(*)fromv$session;

查看資料庫的並發連接數:

selectcount(*)fromv$sessionwherestatus='ACTIVE';

查看當前資料庫建立的會話情況:

selectsid,serial#,username,program,machine,statusfromv$session;

查詢資料庫允許的最大連接數:

selectvaluefromv$parameterwherename='processes';

或者:

showparameterprocesses;

查詢所有資料庫的連接數

selectschemaname,count(*)fromv$sessiongroupbyschemaname;

查詢終端用戶使用資料庫的連接情況。

selectosuser,schemaname,count(*)fromv$sessiongroupbyschemaname,osuser;

#查看當前不為空的連接

select*fromv$sessionwhereusernameisnotnull

#查看不同用戶的連接數

selectusername,count(username)fromv$

Ⅱ sqlserver資料庫最大連接數是多少

設置最大連接數

下面的T-SQL 語句可以配置SQL Server 允許的並發用戶連接的最大數目。

exec sp_configure 'show advanced options', 1
exec sp_configure 'user connections', 100
第一句用以表示顯示sp_configure 系統存儲過程高級選項,使用user connections 時,要求show advanced options 值為1。

第二句配置最大連接數為100,0 表示不限制,但不表示無限,後面將談談。

也可以在企業管理器中配置,在企業管理器中,可以在實例上點右鍵->「屬性」->「連接」裡面更改。

需要重新啟動SQL Server,該值才會生效。

@@max_connections

select @@max_connections
它總是返回32767,它並不是指上面設置的user connections,實際上它表示user connections 最大可設置為多少。由於它的最大值是32767,那麼user connections 為0 時,最大連接數也就是32767 了,並不是無限。

默認情況下user connections 值是0,也就是說默認情況下SQL Server 的最大連接數是32767。

獲得當前設置的最大連接數:

select value from master.dbo.sysconfigures where [config]=103

Ⅲ 如何用sql語句查看Oracle當前的所有會話

用sql語句查看oracle當前連接數 怎樣查看oracle當前的連接數呢?只需要用下面的SQL語句查詢一下就可以了。

select * from v$session where username is not null

select username,count(username) from v$session where username is not null group by username #查看不同用戶的連接數

select count(*) from v$session #連接數

Select count(*) from v$session where status='ACTIVE' #並發連接數

show parameter processes #最大連接

SQL> show parameter process

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes integer 0
db_writer_processes integer 1
gcs_server_processes integer 0
job_queue_processes integer 10
log_archive_max_processes integer 2
processes integer 1500

alter system set processes = value scope = spfile;重啟資料庫 #修改連接

/home/oracle9i/app/oracle9i/dbs/init.ora

/home/oracle9i/app/oracle9i/dbs/spfilexxx.ora ## open_cursor

當 前的連接數

select count(*) from v$process;

設置的最大連接數(默認值 為150)

select value from v$parameter where name = 'processes';

修改最大連接數

alter system set processes = 300 scope = spfile; 重新啟動

當資料庫最大連接數不夠時會出現客戶端連接間歇性失敗,報錯ORA-12519

熱點內容
24寸密碼箱能裝多少東西 發布:2024-05-11 01:13:07 瀏覽:325
怎麼看自己的電腦配置的參數 發布:2024-05-11 01:08:45 瀏覽:811
python查找子字元串 發布:2024-05-11 01:04:24 瀏覽:85
易語言充值源碼 發布:2024-05-11 00:59:51 瀏覽:959
私人伺服器怎麼登錄ip地址 發布:2024-05-11 00:45:29 瀏覽:668
淘寶客返利源碼 發布:2024-05-11 00:25:46 瀏覽:577
生鮮倉庫視頻拍攝腳本 發布:2024-05-11 00:23:40 瀏覽:701
成功人生教育密碼是什麼 發布:2024-05-11 00:19:18 瀏覽:276
安裝了個分享雲盤需要伺服器地址 發布:2024-05-11 00:18:27 瀏覽:383
如何查看radmin密碼 發布:2024-05-10 23:52:03 瀏覽:798