【问题标题】:TNS listener does not currently know of SID given in connect descriptorTNS 侦听器当前不知道连接描述符中给出的 SID
【发布时间】:2018-11-12 18:47:06
【问题描述】:

嗨, 我在笔记本电脑上安装了Oracle 11g 用于练习 Oracle。 我已连接到 HR 帐户。它已经连接了 3 天,但之后我尝试通过 SQL Developer 连接时出现此错误:

TNS-12505: TNS:listener does not currently know of SID given in connect descriptor 

【问题讨论】:

标签: oracle oracle11g database-connection


【解决方案1】:

确保

  • 您的数据库已启动

    $ sqlplus / as sysdba
    SQL> startup
    
  • ORACLE_SID 参数设置为路径值;

    Windows 上,通过以下方式查找:

    C:\Users\pc> echo %ORACLE_SID%
    mydb
    

    Unix 上,查找方式:

    $ echo $ORACLE_SID
    mydb
    
  • 并且 Listener 正在运行:

    $ lsnrctl status
    LSNRCTL for Linux : Version 12.1.0.2.0 - Production on 03-JUN-2018 09:31:07
    
    Copyright (c) 1991, 2014, Oracle.  All rights reserved.
    
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER
    Version                   TNSLSNR for Linux: Version 12.1.0.2.0 - Production
    Start Date                30-MAR-2018 22:29:45
    Uptime                    53 days 11 hr. 1 min. 10 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/12.1.0.2/grid/network/admin/listener.ora
    Listener Log File         /u01/app/grid/diag/tnslsnr/mydb/listener/alert/log.xml
    Listening Endpoints Summary...
     (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
     (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.15.81)(PORT=1521)))
     (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=mycompany.com)(PORT=5505))(Presentation=HTTP)(Session=RAW))
     (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=mycompany.com)(PORT=5506)) 
     (Security=(my_wallet_directory=/u01/app/oracle/product/12.1.0.2/dbhome_1/admin/mydb/xdb_wallet))(Presentation=HTTP)(Session=RAW))
      Services Summary...
     Instance "mydb", status READY, has 1 handler(s) for this service...
     The command completed successfully
    

【讨论】:

  • 对不起。我有类似的问题,想知道我能做些什么来解决这个问题,如果我的输出是:[oracle@oracl oracle]$ lsnrctl status ... Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracl)(PORT=1521))) ... Listener Parameter File path_to/listener.ora Listener Log File path_to/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracl)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) The listener supports no services The command completed successfully
  • @Gryu 也许你需要通过SQL> alter system register;注册监听器
  • 不幸的是,它没有帮助。但是这个答案有帮助:stackoverflow.com/questions/22437910/…我的 listener.ora 文件缺少:SID_LIST_LISTENER = (SID_LIST = (SID_DESC= (GLOBAL_DBNAME=oracl) (ORACLE_HOME=/u01/app/oracle/product/19c/dbhome_1) (SID_NAME=orcl) ) ) ADR_BASE_LISTENER=/u01/app/oracle
  • 另外,有趣的是,现在lsnrctl status 命令显示状态为未知:Services Summary... Service "oracl" has 1 instance(s). Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...。不好吗?
  • @Gryu 通常可能会遇到这样的消息,并不重要,但最好重启。
猜你喜欢
  • 2015-08-31
  • 2021-08-03
  • 2013-08-14
  • 2014-04-21
  • 2014-01-07
  • 2017-05-10
相关资源
最近更新 更多