查看session:
創(chuàng)新互聯(lián)2013年至今,公司自成立以來始終致力于為企業(yè)提供官網(wǎng)建設、移動互聯(lián)網(wǎng)業(yè)務開發(fā)(成都小程序開發(fā)、手機網(wǎng)站建設、重慶APP軟件開發(fā)等),并且包含互聯(lián)網(wǎng)基礎服務(域名、主機服務、企業(yè)郵箱、網(wǎng)絡營銷等)應用服務;以先進完善的建站體系及不斷開拓創(chuàng)新的精神理念,幫助企業(yè)客戶實現(xiàn)互聯(lián)網(wǎng)業(yè)務,嚴格把控項目進度與質(zhì)量監(jiān)控加上過硬的技術實力獲得客戶的一致贊譽。
select * from v$session where username is not null
select username,count(username) from v$session where username is not null group by username
當前連接數(shù):
select count(*) from v$process
查看連接數(shù)參數(shù)的設置情況
select value from v$parameter where name = 'processes'
Select count(*) from v$session where status='ACTIVE' #并發(fā)連接數(shù)
查看session:
select * from v$session where username is not null
select username,count(username) from v$session where username is not null group by username
當前連接數(shù):
select count(*) from v$process
查看連接數(shù)參數(shù)的設置情況
select value from v$parameter where name = 'processes'
Select count(*) from v$session where status='ACTIVE' #并發(fā)連接數(shù)
SQL select count(*) from v$session #當前的連接數(shù) SQL Select count(*) from v$session where status='ACTIVE' #并發(fā)連接數(shù) SQL select value from v$parameter where name = 'processes' --數(shù)據(jù)庫允許的最大連接數(shù) SQL show parameter processes #最大連接 SQL select username,count(username) from v$session where username is not null group by username; #查看不同用戶的連接數(shù) 希望能幫到你
用sql語句查看oracle當前連接數(shù) 怎樣查看oracle當前的連接數(shù)呢?只需要用下面的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 #查看不同用戶的連接數(shù)
select count(*) from v$session #連接數(shù)
Select count(*) from v$session where status='ACTIVE' #并發(fā)連接數(shù)
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;重啟數(shù)據(jù)庫 #修改連接
/home/oracle9i/app/oracle9i/dbs/init.ora
/home/oracle9i/app/oracle9i/dbs/spfilexxx.ora ## open_cursor
當 前的連接數(shù)
select count(*) from v$process;
設置的最大連接數(shù)(默認值 為150)
select value from v$parameter where name = 'processes';
修改最大連接數(shù)
alter system set processes = 300 scope = spfile; 重新啟動
當數(shù)據(jù)庫最大連接數(shù)不夠時會出現(xiàn)客戶端連接間歇性失敗,報錯ORA-12519
1,查看當前會話數(shù)
SQL?conn?/?as?sysdba
已連接。
SQL?select?count(*)?from?v$session;
COUNT(*)
----------
45
注:session值=processes值*1.1+5
2,查看數(shù)據(jù)庫最大進程數(shù)
SQL?show?parameter?processes
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?????50
3,查看數(shù)據(jù)庫最大會話數(shù)
SQL?show?parameter?sessions
NAME???????????????????????????????TYPE????????VALUE
----------------------------------?-----------?------------
java_max_sessionspace_size?????????integer?????0
java_soft_sessionspace_limit???????integer?????0
license_max_sessions???????????????integer?????0
license_sessions_warning???????????integer?????0
logmnr_max_persistent_sessions?????integer?????1
sessions???????????????????????????integer?????60
shared_server_sessions?????????????integer
4,修改processes和sessions值
SQL?alter?system?set?processes=300?scope=spfile;
系統(tǒng)已更改。
SQL?alter?system?set?sessions=300?scope=spfile;
系統(tǒng)已更改。
注:一般只執(zhí)行第一個命令就可以,session自動更改
5,創(chuàng)建pfile
SQLcreate?pfile?from?spfile;
注:如果不做此步,可能會導致更改最大連接數(shù)之后數(shù)據(jù)庫不能啟動現(xiàn)象
6,重啟數(shù)據(jù)庫,使更改生效
SQL?shutdown?immediate
SQL?startup
注:shutdown?normal正常關閉數(shù)據(jù)庫可能會相當相當?shù)穆?/p>
shutdown?abort?可能會導致啟動數(shù)據(jù)庫時很慢。
7,查看進程數(shù),會話數(shù),已經(jīng)修改過來了
SQL?show?parameter?processes
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?????300
SQL?show?parameter?sessions
NAME?????????????????????????????????TYPE????????VALUE
------------------------------------?-----------?------------
java_max_sessionspace_size???????????integer?????0
java_soft_sessionspace_limit?????????integer?????0
license_max_sessions?????????????????integer?????0
license_sessions_warning?????????????integer?????0
logmnr_max_persistent_sessions???????integer?????1
sessions?????????????????????????????integer?????335
shared_server_sessions???????????????integer