Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2835694
  • 博文数量: 599
  • 博客积分: 16398
  • 博客等级: 上将
  • 技术积分: 6875
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-30 12:04
个人简介

WINDOWS下的程序员出身,偶尔也写一些linux平台下小程序, 后转行数据库行业,专注于ORACLE和DB2的运维和优化。 同时也是ios移动开发者。欢迎志同道合的朋友一起研究技术。 数据库技术交流群:58308065,23618606

文章分类

全部博文(599)

文章存档

2014年(12)

2013年(56)

2012年(199)

2011年(105)

2010年(128)

2009年(99)

分类: Oracle

2014-02-21 22:04:11


需求:

目前有2台服务器,服务器A是应用服务器 IP地址为192.168.13.6:222(外网地址为:111.81.35.37:1111)
服务器B是ORACLE数据库服务器 IP地址为192.168.13.111 没有外网地址

A可以访问B,客户端服务器可以访问A服务器,但是不能直接访问数据库服务器B,
这将导致我们平常的PL SQL DEVELOPER 不能练到数据库中。




目前采用解决方法如下:

1、在 /etc/sysctl.conf  增加net.ipv4.ip_forward = 1  允许转发

2、防火墙中配置转发规则
[root@appserver01 ~]# iptables -t nat -A PREROUTING -p tcp -m tcp --dport 222 -j DNAT --to-destination 192.168.13.111:1521
[root@appserver01 ~]#
[root@appserver01 ~]# iptables -t nat -A POSTROUTING -p tcp -m tcp --dport 1521 -j SNAT --to-source 192.168.13.6
[root@appserver01 ~]#
[root@appserver01 ~]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables: [  OK  ]
[root@appserver01 ssh]# service iptables restart
iptables: Flushing firewall rules: [  OK  ]
iptables: Setting chains to policy ACCEPT: nat [  OK  ]
iptables: Unloading modules: [  OK  ]
iptables: Applying firewall rules: [  OK  ]

3、

C:\Documents and Settings\htaix>sqlplus test/test@111.81.35.37:1111/testdb

SQL*Plus: Release 10.2.0.1.0 - Production on 星期五 2月 21 21:54:23 2014

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select tname from tab;

TNAME
------------------------------------------------------------
TEST

阅读(7684) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~