Oracle服务器更换IP后,办公网络里面可以正常访问了,外地的同事,连了vpn 也可以访问,以为可以收工回家,突然又有同事过来说,机房的服务器ping不通新的ip了。
换了几台机器,都ping不通,ping其他新ip一个段的服务器又正常,也可以ssh,又试了下以前的ip地址,可以ping通。
总结起来,ping不通的服务器都是Oracle服务器在同一个网段的服务器,以前都是10段的,Oracle服务器换了ip后,外部访问的地址就不是10段了,但是同一个段的服务器,又不能去另一个路由器绕一圈回来访问192段,所有不能访问。(猜测)
Oracle服务器路由如下,默认访问地址为192段
[oracle@venn01 admin]$ route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 192.xx.xx.0 * 255.255.255.0 U 0 0 0 eth1 192.xx.xx.0 * 255.255.255.0 U 0 0 0 virbr0 10.xx.xx.0 * 255.255.255.0 U 0 0 0 eth0 link-local * 255.255.0.0 U 1002 0 0 eth0 link-local * 255.255.0.0 U 1003 0 0 eth1 default 192.xx.xx.x 0.0.0.0 UG 0 0 0 eth1复制
网卡 eth0 ip :10.xx.xx.xx
网卡 eth1 ip :192.xx.xx.xx
服务器的默认路由地址是192段的
不想去配路由,因为不会
所以解决办法就是,给Oracle启动两个监听,分别监听服务器的两个IP地址,端口保持不变
修改 listener.ora
[oracle@ut25 admin]$ pwd /opt/oracle/db01/app/oracle/product/11.2.0/network/admin [oracle@venn01 admin]$ more listener.ora # listener.ora Network Configuration File: /opt/oracle/db01/app/oracle/product/11.2.0/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /opt/oracle/db01/app/oracle/product/11.2.0) (PROGRAM = extproc) ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) (ADDRESS = (PROTOCOL = TCP)(HOST = 10.xx.xx.xx)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.xx.xx.xx)(PORT = 1521)) ) ) ADR_BASE_LISTENER = /opt/oracle/db01/app/oracle 重启监听: [oracle@venn01 ~]$ lsnrctl stop LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-SEP-2018 13:11:05 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))) The command completed successfully [oracle@venn01 admin]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-SEP-2018 13:25:51 Copyright (c) 1991, 2009, Oracle. All rights reserved. TNS-01106: Listener using listener name LISTENER has already been started [oracle@venn01 admin]$ lsnrctl stop LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-SEP-2018 13:25:55 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))) The command completed successfully [oracle@venn01 admin]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 11-SEP-2018 13:26:00 Copyright (c) 1991, 2009, Oracle. All rights reserved. Starting /opt/oracle/db01/app/oracle/product/11.2.0/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.2.0.1.0 - Production System parameter file is /opt/oracle/db01/app/oracle/product/11.2.0/network/admin/listener.ora Log messages written to /opt/oracle/db01/app/oracle/diag/tnslsnr/venn01/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.xx.xx.xx)(PORT=1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.xx.xx.xx)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 11-SEP-2018 13:26:00 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/oracle/db01/app/oracle/product/11.2.0/network/admin/listener.ora Listener Log File /opt/oracle/db01/app/oracle/diag/tnslsnr/venn01/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.xx.xx.xx)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.xx.xx.xx)(PORT=1521))) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully复制
可见,Oracle的两个监听分别在两个IP地址:10和192 都起来了
在办公网可以正常访问
在机房内网也可以正常访问了
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
632次阅读
2025-04-18 14:18:38
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
614次阅读
2025-04-15 17:24:06
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
510次阅读
2025-04-08 09:12:48
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
502次阅读
2025-04-20 10:07:02
【ORACLE】记录一些ORACLE的merge into语句的BUG
DarkAthena
474次阅读
2025-04-22 00:20:37
Oracle 19c RAC更换IP实战,运维必看!
szrsu
450次阅读
2025-04-08 23:57:08
一页概览:Oracle GoldenGate
甲骨文云技术
446次阅读
2025-04-30 12:17:56
【ORACLE】你以为的真的是你以为的么?--ORA-38104: Columns referenced in the ON Clause cannot be updated
DarkAthena
445次阅读
2025-04-22 00:13:51
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
440次阅读
2025-04-17 17:02:24
火焰图--分析复杂SQL执行计划的利器
听见风的声音
392次阅读
2025-04-17 09:30:30