【发布时间】:2020-10-15 20:57:01
【问题描述】:
当我尝试与 hr/hr 用户创建数据库连接时,我正在使用 JDeveloper 我收到以下消息:
Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:ORCL
然后我去命令行,我把 tnsping ORCL
C:\Users\Administrator>tnsping ORCL
TNS Ping Utility for 64-bit Windows: Version 12.2.0.1.0 - Production on 20-FEB-2
018 15:55:23
Copyright (c) 1997, 2016, Oracle. All rights reserved.
Used parameter files:
C:\app\oracle\virtual\product\12.2.0\dbhome_1\network\admin\sqlnet.ora
Used EZCONNECT adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTO
COL=TCP)(HOST=213.130.77.281)(PORT=1521)))
OK (90 msec)
C:\Users\Administrator>é2@
并检查 Oracle 侦听器是否正在运行:
C:\Users\Administrator>lsnrctl status
LSNRCTL for 64-bit Windows: Version 12.2.0.1.0 - Production on 22-FEB-2018 12:34
:05
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=TESTINFRA)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for 64-bit Windows: Version 12.2.0.1.0 - Produ
ction
Start Date 20-FEB-2018 15:02:35
Uptime 1 days 21 hr. 31 min. 34 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\oracle\virtual\product\12.2.0\dbhome_1\network\
admin\listener.ora
Listener Log File C:\app\oracle\virtual\diag\tnslsnr\TESTINFRA\listener\
alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=TESTINFRA)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
【问题讨论】:
-
检查你的听众实际在听什么:“lsnrctl status”
-
您应该使用服务名称而不是 SID 进行连接,但侦听器没有显示任何内容;要么您的数据库未启动,要么无法注册。这曾经奏效过吗?你能以任何其他方式连接(例如使用 SQL*Plus 在本地连接)吗? This answer可能有用。
-
您是否检查了数据库是否已启动,以及它的
local_listener设置,并尝试修改它和/或手动尝试注册?还是您已经通过其他方式解决了这个问题?