oracle数据库所在的机器更改IP地址后,发现无法连接,
解决这个问题,需要修改一下对应的文件:
F:\app\zhaohe\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
F:\app\zhaohe\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
把其中对应的IP地址进行修改后再重新启动oracle就可以解决问题了;
注:重启实例服务、OracleOraDb11g_home1TNSListener后,稍等1分钟后即可。
listener.ora
# listener.ora Network Configuration File: F:\app\zhaohe\product\11.2.0\dbhome_1\network\admin\listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = F:\app\zhaohe\product\11.2.0\dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:F:\app\zhaohe\product\11.2.0\dbhome_1\bin\oraclr11.dll") ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.5)(PORT = 1521)) ) ) ADR_BASE_LISTENER = F:\app\zhaohe
tnsnames.ora
# tnsnames.ora Network Configuration File: F:\app\zhaohe\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora # Generated by Oracle configuration tools. ORACLR_CONNECTION_DATA = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) (CONNECT_DATA = (SID = CLRExtProc) (PRESENTATION = RO) ) ) LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.5)(PORT = 1521)) ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.5)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
注意:HOST位置要用机器名或机器的网络IP(如192.168.1.5)
时间: 2024-11-02 03:06:02