1、Listener refused the connection with the following error
安装之后如果遇到如下问题
状态: 失败 -测试失败: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
解决办法:
1、首先使用SQL Plus用管理员账户登录:sys/manager as sysdba
输入select * from v$instance; 当前使用的SID查看
修改product12.1.0dbhome_1NETWORKADMIN下的listener.ora文件:
原始文件:
# listener.ora Network Configuration File: D:Oracle reeproduct12.1.0dbhome_1NETWORKADMINlistener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = D:Oracle reeproduct12.1.0dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:D:Oracle reeproduct12.1.0dbhome_1inoraclr12.dll") ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = D:Oracle reeproduct12.1.0dbhome_1log
修改之后的文件:
# listener.ora Network Configuration File: D:Oracle reeproduct12.1.0dbhome_1NETWORKADMINlistener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = D:Oracle reeproduct12.1.0dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:D:Oracle reeproduct12.1.0dbhome_1inoraclr12.dll") ) (SID_DESC = (GLOBAL_DBNAME = ORCL) (ORACLE_HOME = /app/oracle/oracle/product/10.2.0/db_1) (SID_NAME = ORCL) (ENVS = "EXTPROC_DLLS=ONLY:D:Oracle reeproduct12.1.0dbhome_1inoraclr12.dll") ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = D:Oracle reeproduct12.1.0dbhome_1log
之后再使用SQL Developer可视化界面登录,修改对应的SID即可: