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
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
異常:
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]查詢數據庫當前進程的連接數:
select count(*) from v$process;
查看數據庫當前會話的連接數:
elect count(*) from v$session;
查看數據庫的并發連接數:
select count(*) from v$session where status='ACTIVE';
查看當前數據庫建立的會話情況:
select sid,serial#,username,program,machine,status from v$session;
查詢數據庫允許的最大連接數:
select value from v$parameter where name = 'processes';
或者:show parameter processes;
修改數據庫允許的最大連接數:
alter system set processes = 300 scope = spfile;
(需要重啟數據庫才能實現連接數的修改)
重啟數據庫:
shutdown immediate;
startup;
查看當前有哪些用戶正在使用數據:
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對應一個操作系統process,而Windows體現在線程。
啟動oracle
su - oracle
sqlplus system/pwd as sysdba //進入sql
startup //啟動數據庫
lsnrctl start //啟動監聽
sqlplus "/as sysdba"
shutdown immediate;
startup mount;
alter database open;
--
web應用連接oracle數據庫時,經常在查詢數據時發生
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
這種錯誤,網上查了很多,都說是ip地址改變之后的問題,要把tnsnames.ora中的實例配置中改為計算機名,我試過之后問題還是不能解決,今天終于找到問題所在了,是數據庫連接數量的問題,12519錯誤為監聽不能提供服務,通常為數據庫進程達到上限導致。
可以先執行下 select count(*) from v$process ,看下現在系統有多少連接數,然后再查詢 select value from v$parameter where name = 'processes' ,看下oracle設置中設置了多少連接數,一般一個應用都會使用20個,所以如果你開了幾個應用的話(web、pl/sql、……)就會出這個問題了,這時只需要執行下
alter system set processes = 300 scope = spfile;[/quote]
就可以了,當然300可以根據實際情況設置。
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]查詢數據庫當前進程的連接數:
select count(*) from v$process;
查看數據庫當前會話的連接數:
elect count(*) from v$session;
查看數據庫的并發連接數:
select count(*) from v$session where status='ACTIVE';
查看當前數據庫建立的會話情況:
select sid,serial#,username,program,machine,status from v$session;
查詢數據庫允許的最大連接數:
select value from v$parameter where name = 'processes';
或者:show parameter processes;
修改數據庫允許的最大連接數:
alter system set processes = 300 scope = spfile;
(需要重啟數據庫才能實現連接數的修改)
重啟數據庫:
shutdown immediate;
startup;
查看當前有哪些用戶正在使用數據:
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對應一個操作系統process,而Windows體現在線程。
啟動oracle
su - oracle
sqlplus system/pwd as sysdba //進入sql
startup //啟動數據庫
lsnrctl start //啟動監聽
sqlplus "/as sysdba"
shutdown immediate;
startup mount;
alter database open;
--
web應用連接oracle數據庫時,經常在查詢數據時發生
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
這種錯誤,網上查了很多,都說是ip地址改變之后的問題,要把tnsnames.ora中的實例配置中改為計算機名,我試過之后問題還是不能解決,今天終于找到問題所在了,是數據庫連接數量的問題,12519錯誤為監聽不能提供服務,通常為數據庫進程達到上限導致。
可以先執行下 select count(*) from v$process ,看下現在系統有多少連接數,然后再查詢 select value from v$parameter where name = 'processes' ,看下oracle設置中設置了多少連接數,一般一個應用都會使用20個,所以如果你開了幾個應用的話(web、pl/sql、……)就會出這個問題了,這時只需要執行下
alter system set processes = 300 scope = spfile;[/quote]
就可以了,當然300可以根據實際情況設置。
總結
以上是生活随笔為你收集整理的Listener refused the connection with the following error: ORA-12519, TNS:no appr的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Jenkins搭建前后端分离项目流水线实
- 下一篇: 使用Elasticsearch计算布林带