Listener refused the connection with the following error 错误解决(最大连接数)
查詢數(shù)據(jù)庫當(dāng)前進(jìn)程的連接數(shù):?
select count(*) from v$process;?
查看數(shù)據(jù)庫當(dāng)前會話的連接數(shù):?
elect count(*) from v$session;?
查看數(shù)據(jù)庫的并發(fā)連接數(shù):?
select count(*) from v$session where status='ACTIVE';?
查看當(dāng)前數(shù)據(jù)庫建立的會話情況:?
select sid,serial#,username,program,machine,status from v$session;?
查詢數(shù)據(jù)庫允許的最大連接數(shù):?
select value from v$parameter where name = 'processes';?
或者:show parameter processes;?
修改數(shù)據(jù)庫允許的最大連接數(shù):?
alter system set processes = 300 scope = spfile;?
(需要重啟數(shù)據(jù)庫才能實(shí)現(xiàn)連接數(shù)的修改)?
重啟數(shù)據(jù)庫:?
shutdown immediate;?
startup;?
查看當(dāng)前有哪些用戶正在使用數(shù)據(jù):?
select osuser,a.username,cpu_time/executions/1000000's' ,sql_fulltext,machine?
from v$session a,v$sqlarea b?
where a.sql_address = b.address?
order by cpu_time/executions desc;?
備注:UNIX 1個用戶session對應(yīng)一個操作系統(tǒng)process,而Windows體現(xiàn)在線程。?
啟動oracle?
su - oracle?
sqlplus system/pwd as sysdba //進(jìn)入sql?
startup //啟動數(shù)據(jù)庫?
lsnrctl start //啟動監(jiān)聽?
sqlplus "/as sysdba"?
shutdown immediate;?
startup mount;?
alter database open;?
--
web應(yīng)用連接oracle數(shù)據(jù)庫時,經(jīng)常在查詢數(shù)據(jù)時發(fā)生
Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: 127.0.0.1:1521:ORCL
這種錯誤,網(wǎng)上查了很多,都說是ip地址改變之后的問題,要把tnsnames.ora中的實(shí)例配置中改為計(jì)算機(jī)名,我試過之后問題還是不能解決,今天終于找到問題所在了,是數(shù)據(jù)庫連接數(shù)量的問題,12519錯誤為監(jiān)聽不能提供服務(wù),通常為數(shù)據(jù)庫進(jìn)程達(dá)到上限導(dǎo)致。
????? 可以先執(zhí)行下 select count(*) from v$process ,看下現(xiàn)在系統(tǒng)有多少連接數(shù),然后再查詢 select value from v$parameter where name = 'processes' ,看下oracle設(shè)置中設(shè)置了多少連接數(shù),一般一個應(yīng)用都會使用20個,所以如果你開了幾個應(yīng)用的話(web、pl/sql、……)就會出這個問題了,這時只需要執(zhí)行下
alter system set processes = 300 scope = spfile;
就可以了,當(dāng)然300可以根據(jù)實(shí)際情況設(shè)置。
總結(jié)
以上是生活随笔為你收集整理的Listener refused the connection with the following error 错误解决(最大连接数)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Matlab仿真PID控制(带M文件、s
- 下一篇: Oracle中insert into s