Listener refused the connection with the following error: ORA-12519, TNS:no appr
生活随笔
收集整理的這篇文章主要介紹了
Listener refused the connection with the following error: ORA-12519, TNS:no appr
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
異常:
Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: localhost:1521:orcl
Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: localhost:1521:orcl ; nested exception is java.sql.SQLException: Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: localhost:1521:orcl
[quote]查詢數(shù)據(jù)庫當(dāng)前進(jìn)程的連接數(shù):
select count(*) from v$process;
查看數(shù)據(jù)庫當(dāng)前會(huì)話的連接數(shù):
elect count(*) from v$session;
查看數(shù)據(jù)庫的并發(fā)連接數(shù):
select count(*) from v$session where status='ACTIVE';
查看當(dāng)前數(shù)據(jù)庫建立的會(huì)話情況:
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個(gè)用戶session對(duì)應(yīng)一個(gè)操作系統(tǒng)process,而Windows體現(xiàn)在線程。
啟動(dòng)oracle
su - oracle
sqlplus system/pwd as sysdba //進(jìn)入sql
startup //啟動(dòng)數(shù)據(jù)庫
lsnrctl start //啟動(dòng)監(jiān)聽
sqlplus "/as sysdba"
shutdown immediate;
startup mount;
alter database open;
--
web應(yīng)用連接oracle數(shù)據(jù)庫時(shí),經(jīng)常在查詢數(shù)據(jù)時(shí)發(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
這種錯(cuò)誤,網(wǎng)上查了很多,都說是ip地址改變之后的問題,要把tnsnames.ora中的實(shí)例配置中改為計(jì)算機(jī)名,我試過之后問題還是不能解決,今天終于找到問題所在了,是數(shù)據(jù)庫連接數(shù)量的問題,12519錯(cuò)誤為監(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ù),一般一個(gè)應(yīng)用都會(huì)使用20個(gè),所以如果你開了幾個(gè)應(yīng)用的話(web、pl/sql、……)就會(huì)出這個(gè)問題了,這時(shí)只需要執(zhí)行下
alter system set processes = 300 scope = spfile;[/quote]
就可以了,當(dāng)然300可以根據(jù)實(shí)際情況設(shè)置。
Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: localhost:1521:orcl
Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: localhost:1521:orcl ; nested exception is java.sql.SQLException: Listener refused the connection with the following error: ORA-12519, TNS:no appropriate service handler found The Connection descriptor used by the client was: localhost:1521:orcl
[quote]查詢數(shù)據(jù)庫當(dāng)前進(jìn)程的連接數(shù):
select count(*) from v$process;
查看數(shù)據(jù)庫當(dāng)前會(huì)話的連接數(shù):
elect count(*) from v$session;
查看數(shù)據(jù)庫的并發(fā)連接數(shù):
select count(*) from v$session where status='ACTIVE';
查看當(dāng)前數(shù)據(jù)庫建立的會(huì)話情況:
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個(gè)用戶session對(duì)應(yīng)一個(gè)操作系統(tǒng)process,而Windows體現(xiàn)在線程。
啟動(dòng)oracle
su - oracle
sqlplus system/pwd as sysdba //進(jìn)入sql
startup //啟動(dòng)數(shù)據(jù)庫
lsnrctl start //啟動(dòng)監(jiān)聽
sqlplus "/as sysdba"
shutdown immediate;
startup mount;
alter database open;
--
web應(yīng)用連接oracle數(shù)據(jù)庫時(shí),經(jīng)常在查詢數(shù)據(jù)時(shí)發(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
這種錯(cuò)誤,網(wǎng)上查了很多,都說是ip地址改變之后的問題,要把tnsnames.ora中的實(shí)例配置中改為計(jì)算機(jī)名,我試過之后問題還是不能解決,今天終于找到問題所在了,是數(shù)據(jù)庫連接數(shù)量的問題,12519錯(cuò)誤為監(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ù),一般一個(gè)應(yīng)用都會(huì)使用20個(gè),所以如果你開了幾個(gè)應(yīng)用的話(web、pl/sql、……)就會(huì)出這個(gè)問題了,這時(shí)只需要執(zhí)行下
alter system set processes = 300 scope = spfile;[/quote]
就可以了,當(dāng)然300可以根據(jù)實(shí)際情況設(shè)置。
總結(jié)
以上是生活随笔為你收集整理的Listener refused the connection with the following error: ORA-12519, TNS:no appr的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Jenkins搭建前后端分离项目流水线实
- 下一篇: python二重积分_用python求一