今天使用Oracle时遇到一个问题,连接字符串中IP配置成127.0.0.1时可能正常访问数据库,当配置成实际IP地址时连接数据库失败。然后 telnet IP 1521 失败。
解决方案:
1. 打开listener.ora文件(位于Oracle数据库安装目录network\admin 文件夹);
2. 将 LISTENER连接串中的LOCALHOST改成本机电脑名称;
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = LOCALHOST)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )
修改后
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = PC-MAOMAOCHONG)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) )
3. 保存并关闭文件;
4. 打开本机服务管理工具,找到Oracle网络监听服务(OracleOraDBHome1TNSListener)重启服务,问题解决。
标签:127.0,PROTOCOL,DESCRIPTION,0.1,IP,数据库,ADDRESS,Oracle From: https://www.cnblogs.com/sdlz/p/18601674