oracle数据库正常启动后。在本地能够正常訪问,可是远程使用sqldevelop却不能訪问。提示ORA 12505 Listener does not currently know of SID given in connection descriptor,解决问题之前,先看一下oracleserver正常启动流程

1.启动监听

命令:lsnrctl start

2.登陆sqlplus

命令:sqlplus /nolog

3.以系统管理员身份连接数据库

命令:conn /as sysdba

4.启动oracle实例

命令:startup

提示:假设启动后提示出现问号,可參考前一篇博客,oracle中文乱码问题解决

再回头来看上面提到的问题,因为本地訪问数据库正常。远程訪问不正常。非常easy想到,应该是监听出了问题,

能够用一下命令查看监听进程的状态

命令:lsnrctl status

下图是监听处于正常状态的截图(出错的时候忘记截图了)

ORA 12505 Listener does not currently know of SID given in connection descriptor-LMLPHP

在异常情况下,输入此命令,在The command completed successfully上方会提示the listener supports no services,顺着这个提示查问题,在网上找到一篇博客,

http://www.ha97.com/4788.html,尝试着使用第一种方法,在listener.ora配置文件后加上SID相关配置,问题攻克了。现附上改动后的配置例如以下(红色部分为新加入的):

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1234))

    )



    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

    )

)

SID_LIST_LISTENER =

    (SID_LIST =

      (SID_DESC =

          (GLOBAL_DBNAME = test)

          (SID_NAME = test)

          (ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1)

      )

    )



ADR_BASE_LISTENER = /home/oracle/app/oracle

05-11 20:16