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查看
修改\product\12.1.0\dbhome_1\NETWORK\ADMIN下的listener.ora文件:
原始文件:
# listener.ora Network Configuration File: D:\Oracle\tree\product\12.1.0\dbhome_1\NETWORK\ADMIN\listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = D:\Oracle\tree\product\12.1.0\dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle\tree\product\12.1.0\dbhome_1\bin\oraclr12.dll") ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = D:\Oracle\tree\product\12.1.0\dbhome_1\log
修改之后的文件:
# listener.ora Network Configuration File: D:\Oracle\tree\product\12.1.0\dbhome_1\NETWORK\ADMIN\listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = D:\Oracle\tree\product\12.1.0\dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle\tree\product\12.1.0\dbhome_1\bin\oraclr12.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\tree\product\12.1.0\dbhome_1\bin\oraclr12.dll") ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = D:\Oracle\tree\product\12.1.0\dbhome_1\log
之后再使用SQL Developer可视化界面登录,修改对应的SID即可:
时间: 2024-12-28 23:11:35