ORA-12518,TNS:listener 无法切换客户端连接 oracle 11g

ORA-12518, TNS:listener could not hand off client connection oracle 11g

我在 eclipse 中有一个 JAVA 应用程序试图连接到 Oracle 11G 数据库,但出现以下错误:

Caused by: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12518, TNS:listener could not hand off client connection
The Connection descriptor used by the client was:
127.0.0.1:1521/XE

尽管 listener.ora 和 tnsnames.ora 的主机名为 "LP-5CD9296CDZ" lsnrctl status 显示主机为 LP-5CD9296CDZ.XXX.CORP.XXX.IN

C:\WINDOWS\system32>lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 14-DEC-2019 18:20:51

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.2.0 - Production
Start Date                14-DEC-2019 17:52:45
Uptime                    0 days 0 hr. 28 min. 6 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   C:\oraclexe\app\oracle\product.2.0\server\network\admin\listener.ora
Listener Log File         C:\oraclexe\app\oracle\diag\tnslsnr\LP-5CD9296CDZ\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=LP-5CD9296CDZ.XXX.CORP.XXX.IN)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=LP-5CD9296CDZ.XXX.CORP.XXX.IN)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
  Instance "xe", status READY, has 1 handler(s) for this service...
Service "xe" has 1 instance(s).
  Instance "xe", status READY, has 1 handler(s) for this service...
The command completed successfully

我的JDBC连接URL如下: jdbc:oracle:thin:@LP-5CD9296CDZ:1521/XE 在 SQL 另外,我可以使用 conn 系统连接到数据库,但不能通过 JBOSS7.1 服务器部署的应用程序连接。

Listener.ora如下:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product.2.0\server)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product.2.0\server)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

tnsnames.ora is as follows:
XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

ORACLR_CONNECTION_DATA = 
  (DESCRIPTION = 
    (ADDRESS_LIST = 
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1)) 
    ) 
    (CONNECT_DATA = 
      (SID = CLRExtProc) 
      (PRESENTATION = RO) 
    ) 
  ) 

结果:

   SQL>select * from v$resource_limit;

    RESOURCE_NAME CURRENT_UTIL MAX_UTIL  INITIAL_ALLOCAT  LIMIT_VALUE
    -----------------------------------------------------------------
    processes         32        100         100                100

    sessions          33        101         176                176

    enqueue_locks     16        90          2180              2180

    enqueue_resources 15        15           992              UNLIMITED

    ges_procs         0         0            0                 0

    ges_ress          0         0            0                 UNLIMITED

    ges_locks         0         0            0                 UNLIMITED

    ges_cache_ress    0         0            0                 UNLIMITED

    ges_reg_msgs      0         0            0                 UNLIMITED

    ges_big_msgs      0         0            0                 UNLIMITED

    ges_rsv_msgs      0         0            0                 0

    gcs_resources     0         0            0                 0

    gcs_shadows       0         0            0                 0

    dml_locks         0         0           772                UNLIMITED

temporary_table_locks 0         0       UNLIMITED              UNLIMITED

    transactions      0         0           193                UNLIMITED

    branches          0         0           193                UNLIMITED

    cmtcallbk         0         1           193                UNLIMITED

max_rollback_segments 11        11          193                65535

    sort_segment_locks 0        4        UNLIMITED             UNLIMITED

    k2q_locks          0        0           352                UNLIMITED

    max_shared_servers 4        4        UNLIMITED             UNLIMITED

    parallel_max_serve 0        0             0                3600


    23 rows selected.

您的系统负载过重,已达到数据库进程(limit 100 , max_utilisation 100) 和数据库会话(limit 176, max_utilisation 101) 的最大值。您需要增加数据库进程和会话的最大数量。

>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Dec 16 08:48:42 2019

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production

SQL> show parameter processes

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes                      integer     1
db_writer_processes                  integer     1
gcs_server_processes                 integer     0
global_txn_processes                 integer     1
job_queue_processes                  integer     1000
log_archive_max_processes            integer     4
processes                            integer     150
SQL> alter system set processes = 500 scope = spfile;

System altered.

重启数据库。