转载

【Case】ORA-12519: TNS:no appropriate service handler found

一、问题现象

今天有AP用户反映,数据库有时候连的上,有时候连不上,报如下的错误:

ORA-12519: TNS:no appropriate service handler found


二、原因解析

oracle@C01TEST03:/home/oracle>oerr ORA 12519
12519, 00000, "TNS:no appropriate service handler found"
// *Cause: The listener could not find any available service handlers that
// are appropriate for the client connection.
// *Action: Run "lsnrctl services" to ensure that the instance(s) have
// registered with the listener, and are accepting connections.

第一个原因可能是Instance没有注册到Listener;

第二个原因可能是数据库上当前的连接数目已经超过了它能够处理的最大值。


三、解决方法

根据第二步,检查两个地方:

1、查看Instance是否注册到Listener

oracle@C01TEST03:/home/oracle>lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 03-NOV-2017 15:29:45

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=C01TEST03)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                25-AUG-2017 13:37:06
Uptime                    70 days 1 hr. 52 min. 38 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/product/11.2.0/network/admin/listener.ora
Listener Log File         /oracle/product/diag/tnslsnr/C01TEST03/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=C01TEST03)(PORT=1521)))
Services Summary...
Service "MTH" has 1 instance(s).
  Instance "MTH", status READY, has 1 handler(s) for this service...

确认到"MTH" Instance已经注册到listener里了;


2、数据库上当前的连接数目已经超过了它能够处理的最大值。

(1)查看当前连接数

SQL> select count(*from v$process;

查看数据库允许最大的连接数

SQL> show parameter processes;


(2)适当加大processes的值

alter system set processes = 300 scope = spfile;


(3)重启数据库


(4)查看当前有哪些用户正在使用数据
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;


四、问题总结

   以上便是该问题的思考及处理方向。处理方法以第二种,修改参数processes的方法为主。

正文到此结束
Loading...