出现以上的问题是无法识别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