ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Oracle客户端穿过防火墙连接服务器[转载]

Oracle客户端穿过防火墙连接服务器[转载]

原创 Linux操作系统 作者:jlandzpa 时间:2019-07-19 18:15:01 0 删除 编辑
http://www.cnblogs.com/zyk/archive/2004/11/16/59538.html

Oracle客户端连接服务器,首先去找1521监听端口,服务器的1521监听端口再向server process进程发出请求,并返回一个随机端口,返回给客户端,客户端再来连接这个端口。

这样就给服务器上的防火墙设置带来了麻烦,这个端口是随机的,如何开放?

 

windows 平台上的这个问题成了一大难题,很多论坛都有人问,但很少有人能解决。 unix平台不用担心,系统自动会解决这个问题.

Matalink上提供了三种解决办法,实际上USE_SHARED_SOCKET 是最有效最方便的。

但经过无数次实现,仍然没有成功,最后终于发现是Oracle 8.1.7bug

需要打补丁,升级到Oracle 8.1.7.1.2

 

需要在MTS模式下(共享模式)

Oracle默认是专用模式。

经试验发现,如果不在init文件中设参数的话,Oracle仍然会要求一个随机端口和1521端口来共同通讯,只是这个随机端口,并不随客户端会话和登录的变化而变化,在没有重启服务器时,是固定的。

 

(试验发现,在专用模式下,每次连接,oracle服务器会按+1方式,提供一个非1521的端口。)

所以,还需要在init.ora文件的最后加上一条参数:

mts_dispatchers="(address=(protocol=tcp)(host=myoradb)(port=1521))(dispatchers=1)"

这样才真正实现只用一个端口,穿过防火墙。

 

参考资料:

 

Oracle uses dynamic ports under windows NT because of a bug in windows, so oracle can't use shared sockets. This bug got fixed with service pack 3 I think. By default, oracle uses the dynamic ports without caring which service pack is installed. There is a registry setting to force oracle to use shared sockets. The parameter is (what a surprise!) USE_SHARED_SOCKET in LOCAL_MACHINESoftwareOracleHomeX where X is your desired homedir. This parameter should be set to TRUE. There's a whitepaper from oracle for this too, somewhere on their site. Anyway, this parameter doesnt work for 8.1.7 Some users reported that it worked with 8.1.6.3, but 8.1.7 termiates every conection immediately...

 

Contributed by Arne Brutschy (abrutschy@xylon.de) on July 5, 2001.

 

Actually, I want to establish a replication system in my local machine.. for replicating objects(tables) from remote database to a local database... what data security option i must take in to account. I request you to give me the detail description like which protocal must be used and what parameter must be set in init.ora file,sqlnet.ora and listener.ora file and what other steps to be taken... I would be very thankful to you ... if you kindly describe the things...actually i want to maintain the data privacy which happens between remote and local database while replication take place.. any one can trap the net and extract the data ... so i need to stop that. 

 

I would be very thankful to you ... this is a request.. please mail me on the address p_v_raju73@rediffmail.com. 

 

regards p.v.raju

Contributed by pvraju (p_v_raju73@rediffmail.com) on October 8, 2001.

Modify Windows registry. 

 

USE_SHARED_SOCKET = TRUE 

 

- Oracle 8.1.6 for NT/2k HKEY_LOCAL_MACHINESOFTWAREORACLEHOME<#> (# is your desired homedir)

- Oracle 8.1.7.0.0 for NT/2k Doesn't work in Oracle 8.1.7.0.0 for NT/2k

- Oracle 8.1.7.1.2 for NT/2k HKEY_LOCAL_MACHINESOFTWAREORACLE 

 

- FAQ Site

http://www.orafaq.net/archive/comp.databases.oracl e.server/2002/04/13/143024.htm http://www.orafaq.net/archive/comp.databases.oracl e.server/2002/04/13/143024.htm http://www.pauck.de/marco/misc/oracle_and_firewall s.html

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/936/viewspace-60513/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2001-10-12

  • 博文量
    240
  • 访问量
    172298