SQL Developer-无法连接,侦听器当前不知道SID /服务名称

时间:2018-10-23 16:50:12

标签: oracle oracle-sqldeveloper sqlplus

我知道这是一个常见的问题,我已经尝试了所有可以在网上找到的内容,但没有任何解决方案可以解决我的问题。我什至卸载了Oracle 11g XE和SQL Developer,删除了我可以找到并重新安装的每个文件,没有任何帮助。

我可以通过SQL * Plus命令行和CMD完美连接。

我从来没有遇到过这个问题,但是从今天开始,当我尝试与DQL Developer建立连接时,我一直收到此错误:

Error

AND

enter image description here

这是我的tnsnames.ora文件:

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-5MFACN6)(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) 
    ) 
  ) 

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 = DESKTOP-5MFACN6)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

SQL * Plus的一些测试的输出:

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> select value from v$parameter where name='service_names';

VALUE
--------------------------------------------------------------------------------
XE

SQL> select instance from v$thread;

INSTANCE
--------------------------------------------------------------------------------
xe

SQL> select host_name,instance_name,version from v$instance;

HOST_NAME
----------------------------------------------------------------
INSTANCE_NAME    VERSION
---------------- -----------------
DESKTOP-5MFACN6
xe               11.2.0.2.0


SQL> select global_name from global_name;

GLOBAL_NAME
--------------------------------------------------------------------------------
XE

和收听者状态:

C:\Users\Arne>lsnrctl status

LSNRCTL for 64-bit Windows: Version 11.2.0.2.0 - Production on 23-OCT-2018 18:27:07

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                23-OCT-2018 18:19:35
Uptime                    0 days 0 hr. 7 min. 31 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\DESKTOP-5MFACN6\listener\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DESKTOP-5MFACN6)(PORT=1521)))
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...
The command completed successfully

关于如何解决此问题的任何想法?我真的不知道该怎么办

1 个答案:

答案 0 :(得分:0)

通常,当我没有看到列出的服务时,我会运行一个alter system寄存器,该服务将服务名刷新到侦听器,而不是等待列表器进行轮询并找到它们本身

$ sql  / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Tue Nov 13 14:17:28 2018
Version 18.3.0.0.0

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


Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> alter system register;

System altered.

SQL>