簡體   English   中英

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 狀態顯示主機為 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\11.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 on SQL Plus 我能夠使用 conn 系統連接到數據庫,但不能通過通過 JBOSS7.1 服務器部署的應用程序連接。

Listener.ora如下:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.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 )的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.

重啟數據庫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM