1、Listener refused the connection with the following error 安裝之後如果遇到如下問題狀態: 失敗 -測試失敗: Listener refused the connection with the following error:ORA-1250 ...
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即可: