TNS-12514: TNS:listener 当前不知道连接描述符中请求的服务

TNS-12514: TNS:listener does not currently know of service requested in connect descriptor

我在服务器上安装了 oracle 11.2.0。一切都很好,直到星期一。 现在我无法通过客户端连接到数据库,SQL 开发人员,SQL Plus。

服务器上的 lsnrctl 状态

C:\Users\User1>lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 14-JAN-2016 09:21
:14

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SERVERNAME.DOMAIN)(PORT=1
521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   64-bit Windows Error: 61: Unknown error
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ
ction
Start Date                13-JAN-2016 21:36:13
Uptime                    0 days 11 hr. 48 min. 19 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   C:\app\Administrator\product.2.0\dbhome_2\network\a
dmin\listener.ora
Listener Log File         c:\app\administrator\diag\tnslsnr\SERVERNAME\listener\
alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(SERVERNAME.DOMAIN)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\.\pipe\EXTPROC1521ipc)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 2 handler(s) for this service...
Service "LAND3XDB" has 1 instance(s).
  Instance "land3", status READY, has 1 handler(s) for this service...
Service "TEST3XDB" has 1 instance(s).
  Instance "test3", status READY, has 1 handler(s) for this service...
Service "TESTT10XDB" has 1 instance(s).
  Instance "testt10", status READY, has 1 handler(s) for this service...
Service "TESTXDB" has 1 instance(s).
  Instance "test", status READY, has 1 handler(s) for this service...
Service "TEST_T10" has 1 instance(s).
  Instance "testt10", status READY, has 1 handler(s) for this service...
Service "land3" has 1 instance(s).
  Instance "land3", status READY, has 1 handler(s) for this service...
Service "test" has 1 instance(s).
  Instance "test", status READY, has 1 handler(s) for this service...
Service "test3" has 1 instance(s).
  Instance "test3", status READY, has 1 handler(s) for this service...
The command completed successfully

tnsping 数据库:

C:\Users\USER1>tnsping TEST3

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 14-JAN-2
016 09:25:55

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:
C:\app\Administrator\product.2.0\dbhome_2\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = SERVERNAME.DOMAIN)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (S
ERVICE_NAME = TEST3)))
TNS-12541: TNS:no listener

LISTENER.ORA

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\app\Administrator\product.2.0\dbhome_2)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product.2.0\dbhome_2\bin\oraclr11.dll")
    )
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\app\Administrator\product.2.0\dbhome_2)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product.2.0\dbhome_2\bin\oraclr11.dll")
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERNAME.DOMAIN)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = C:\app\Administrator

SQLNET.ORA

SQLNET.AUTHENTICATION_SERVICES = (NONE)

tnsnames.ora

TEST3 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERNAME.DOMAIN)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TEST3)
    )
  )

TEST_T10 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERNAME.DOMAIN)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TEST_T10)
    )
  )

TEST3_X64 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERNAME.DOMAIN)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TEST3)
    )
  )

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

LAND3 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERNAME)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = LAND3)
    )
  )

TEST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERNAME.DOMAIN)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = TEST)
    )
  )

在日志 C:\app\Administrator\diag\tnslsnr\SERVERNAME\listener\alert:

<msg time='2016-01-14T09:21:53.324+03:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNOWN' level='16' host_id='SERVERNAME'
 host_addr='::1'>
 <txt>14-JAN-2016 09:21:53 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=SERVERNAME$))(SERVICE_NAME=TESTLD.DOMAIN)) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.29.17.141)(PORT=62670)) * establish * TESTLD.DOMAIN * 12571
 </txt>
</msg>
<msg time='2016-01-14T09:22:03.324+03:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNOWN' level='16' host_id='SERVERNAME'
 host_addr='::1'>
 <txt>TNS-12571: TNS:packet writer failure
 TNS-12560: TNS:protocol adapter error
  TNS-00530: Protocol adapter error
   64-bit Windows Error: 54: Unknown error
    TNS-12514: TNS:listener does not currently know of service requested in connect descriptor
 </txt>
</msg>

所有服务都已启动。 我不知道这有什么问题。

请做:

  1. Check hostname status from OS.
  2. Check your firewall and windows 64 is not forbidding port access.

此设置有很多问题 - 例如,listener.ora 中 test3 的侦听器 SID/SERVICE_NAME 定义在哪里?无论如何,您可以在 windows.

下没有特定的侦听器定义而逃脱

不过我觉得你的问题很容易解决,线索在这里:

Service "test3" has 1 instance(s).
Instance "test3", status READY, has 1 handler(s) for this service...

您的 tnsnames.ora 正在寻找服务名称 TEST3

TEST3 =
 (DESCRIPTION =
  (ADDRESS_LIST =
   (ADDRESS = (PROTOCOL = TCP)(HOST = SERVERNAME.DOMAIN)(PORT = 1521))
  )
  (CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = TEST3)
)
)

替换

(SERVICE_NAME = TEST3)

(SID = test3)