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-12505"是由于TNS Listener无法识别连接描述符中给定的SID所引起的。这个错误通常表示数据库实例的SID无法被正确识别或连接。 解决这个问题的方法有以下几种: 1. 确认数据库实例的SID: 确保数据库实例的SID在连接描述符中正确配置。可以通过运行命令`lsnrctl services`来查看监听器中注册的数据库服务和SID。 2. 检查监听器配置: 确保监听器的配置文件(tnsnames.ora)中包含正确的数据库服务和SID。确保SID和服务与连接描述符中的信息匹配。 3. 检查监听器状态: 使用命令`lsnrctl status`来检查监听器的状态。如果监听器已停止或未运行,请启动监听器并重新测试数据库连接。 4. 检查网络连接: 确保数据库服务器和客户端之间的网络连接正常。可以使用ping命令测试网络的连通性。 5. 检查防火墙设置: 如果有防火墙存在,请确保允许数据库服务器和客户端之间的通信。 6. 使用正确的连接字符串: 确保在连接描述符中使用正确的连接字符串,包括主机名、端口号、SID和服务名等。 综上所述,解决数据库连接报错"Listener refused the connection with the following error: ORA-12505"的方法包括确认数据库实例的SID、检查监听器配置、检查监听器状态、检查网络连接、检查防火墙设置以及使用正确的连接字符串。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [解决数据库连接报错Listener refused the connection with the following error: ORA-12505](https://blog.csdn.net/rhyy1230/article/details/103558587)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *3* [【数据源】连接Oracle失败 Listener refused the connection with the following error: ORA-12505](https://blog.csdn.net/weixin_40142258/article/details/131169923)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值