首页 > 代码库 > ORA-12505, TNS:listener does not currently know of SID given in connect desc

ORA-12505, TNS:listener does not currently know of SID given in connect desc

出现以上的问题是无法识别SID,解决方法如下:

 

1.找到以下目录,/opt/oracle/product/10.2.0/db_1/network/admin,修改listener.ora,(find -name listener.ora即可找到该文件)为:

   

    

# listener.ora Network Configuration File: /opt/oracle/product/10.2.0/db_1/network/admin/listener.ora    # Generated by Oracle configuration tools.    SID_LIST_LISTENER =        (SID_LIST =             (SID_DESC =                   (SID_NAME = PLSExtProc)                   (ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)                   (PROGRAM = extproc)             )            (SID_DESC =                   (GLOBAL_DBNAME = NIE)                   (ORACLE_HOME = /opt/oracle/product/10.2.0/db_1)                   (SID_NAME = NIE)            )        )    LISTENER =        (DESCRIPTION_LIST =              (DESCRIPTION =                    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC3))                    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1523))              )        )

  

添加红色字体部分,注意GLOBAL_DBNAME 和SID_NAME 改成你自己的。

 

2.启动TNS监听:lsnrctl start

3.查看监听状态:lsnrctl status

ORA-12505, TNS:listener does not currently know of SID given in connect desc