12
返回列表 发新帖
楼主: wargod

oracle8i 与防火墙

[复制链接]
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
11#
发表于 2001-11-5 21:43 | 只看该作者

你的法防火墙是不是有所问题

如果是可以连接,但是突然断调,药叉一下防火墙的性能。好像天网的双机不是太好

使用道具 举报

回复
论坛徽章:
50
现任管理团队成员
日期:2011-05-07 01:45:08马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:14马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:112013年新春福章
日期:2013-02-25 14:51:24咸鸭蛋
日期:2012-11-23 22:47:18ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:32
12#
发表于 2001-11-6 00:34 | 只看该作者
你仔细看我发的贴子没有?那里面讲为什么只设1521会出现问题。解决办法我没有试过,(没有环境啊),但是我觉得你可以照下面的方法试一下!就是改注册表嘛。

If you are on Oracle 8, you can use a WINSOCK V2 API feature called Shared Sockets . This allows a socket to be shared (or passed) between multiple processes. To use this functionality in a single Oracle Home enviroment, set USE_SHARED_SOCKET = TRUE in the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE section of the registry. If you are using Multiple Oracle Homes, change to the desired Oracle 8 Home and view the oracle.key file in ORACLE_HOME\BIN to find which registry key to add USE_SHARED_SOCKET to.


最初由 wargod 发布
[B]我在书上看到的例子,只需开放1521.这本书是:<<oracle8/8i 开发使用手册>>,有谁做过,请告诉我具体怎么办.万分感谢呢. [/B]

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
13#
发表于 2001-11-6 09:04 | 只看该作者
Look at this article from metalink,I think you should configure cman.

When the Oracle client makes a sqlplus connection to the database
(sqlplus userid/password@alias), it will compare the alias name you
supplied in the sqlplus line and look for a match in the tnsnames.ora
file or names server.  Once it obtains the address for the database
server, a connetion attempt is made to the server from the client.
The listener is contacted on the database server and port redirection
can take place depending on the platform, configuration of the init<sid>.ora
file and/or the Oracle product being used.  The OS will obtain a free port
from the OS and send back to the client via the listener the new port
assignment.  The client will then try to connect to the database on a
new port.

A remote Oracle client making a connection to an Oracle database can
fail if there is a firewall installed between the client and the server
if there is port redirection.  The firewall will block the port when
the Oracle client connects to the database and can fail with the client
receiving Oracle error ora-12203 or ora-12535.   The Client connection
failure is due to port redirection from the Windows operating system.  
Port redirection requires the Client to connect to the database using
a different port than originally configured in the configuration ora files.
Oracle MTS on Unix platforms, (without specifying the address with the
ports in the init ora file), Oracle SSL, and NT platforms will cause port
redirection.

A level 16 client trace file can verify if the problem is a firewall
issue.  In the sqlnet.ora file on the client add the followng lines:

trace_level_client  =  16
trace_file_client = client
trace_directory_client = < a valid directory and path > ie:  c:\temp

Save the changes to the sqlnet.ora file and try connecting with sqlplus
to force the error.  This will create the trace file.  Here are several
excerts from a level 16-trace file of what to look for.

The initial packets sent to the listener on port 1521 in trace file.

niotns: Calling address: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)
(HOST=server1)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=v815.world)
(CID=(PROGRAM=D:\V815\BIN\SQLPLUSW.EXE)(HOST=server1)(USER=system))))
nladget: entry
nladget: exit
nscall: entry
nscall: connecting...
nsc2addr: entry
nttbnd2addr: entry
nttbnd2addr: port resolved to 1521


The received packet from the listener telling the client to use 1729 port.

nscon: recving a packet
nsprecv: entry
nsbal: entry
nsbgetfl: entry
nsbgetfl: normal exit
nsmal: entry
nsmal: 44 bytes at 0xb892d0
nsmal: normal exit
nsbal: normal exit
nsprecv: reading from transport...
nttrd: entry
nttrd: socket 232 had bytes read=64
nttrd: exit
nsprecv: 64 bytes from transport
nsprecv: tlen=64, plen=64, type=5
nsprecv: packet dump
nsprecv:00 40 00 00 05 00 00 00  |.@......|
nsprecv:00 36 28 41 44 44 52 45  |.6(ADDRE|
nsprecv:53 53 3D 28 50 52 4F 54  |SS=(PROT|
nsprecv:4F 43 4F 4C 3D 74 63 70  |OCOL=tcp|
nsprecv:29 28 48 4F 53 54 3D 31  |)(HOST=1|
nsprecv:33 38 2E 32 2E 32 31 33  |38.2.213|
nsprecv:2E 36 31 29 28 50 4F 52  |.61)(POR|
nsprecv:54 3D 31 37 32 39 29 29  |T=1729))|    <- port change
nsprecv: normal exit
nscon: got NSPTRD packet
nscon: got 54 bytes connect data
nscon: exit (0)

The client resolving the connection to port 1729.

nscall: connecting...
nsc2addr: entry
nttbnd2addr: entry
nttbnd2addr: port resolved to 1729
nttbnd2addr: using host IP address: 138.2.213.61
nttbnd2addr: exit
nsc2addr: normal exit

Edit the trace file and you can see the send packets sent from the client
on port 1521 (or your port if different) to the listener.  There will be
receive packets packets returned from the server to the client reflecting
a new port assignment.  Then the client will send packets again from the
client only this time to a different port.  The connection will then fail
at this point in the trace file.

The port that is assigned to the client is randomly chosen by the
operating system and can't be modified.  It can be any free port available
that the server determines is not is use by any other software or hardware.

Once it is determined that the problem is the firewall causing the
connection to fail, the next step is to select a solution to resolve
the issue

Being that Oracle is working correctly, and the firewall is working
correctly, there are several solutions to correct the problem to
allow the clients to connect to the database.


Solution: Firewall Vendor
The first solution is to contact the firewall vendor and see if they have
an upgrade to allow for oracle connectivity with OS port redirection.  If
the firewall software can be upgraded, it is the best solution to follow.


Solution: Connection Manager
The second solution is used for Oracle net8 versions and above, and
requires setting up connection manager (cman) to allow the clients to
connect through a firewall (note:2077721.6 explains cman in more
detail with configuration examples).  Connection Manager is an executable
that can be run from the bin directory, which allows clients to connect
when a firewall is in place between the client and the server.
Connection Manager is similar to a listener.  It reads a cman.ora file,
which contains an address that Connection Manager listens on for incoming
connections, usually default ports of 1610 or 1630.  Connection Manager
starts similar to the listener and will enter a listening state.  The
Oracle client needs to be running net8 or above, and will need to have
the following entered into the tnsnames.ora file.

cmantest =
   (description =
     (address_list =
       (address =                        <- first address is to the cman               
         (protocol=tcp)
         (host=hostname or ip of cman)
         (port=1610)
       )
       (address=                        <- second address is to listener
         (protocol=tcp)
         (host=hostname or ip of listener)
         (port=1521)
       )
     )
     (connect_data = (sid =  sidname))
     (source_route = yes)                <-This tells the client that it is
    )                                          using cman and it must take the
                                          first two addresses listed.


When the client contacts the connection manager, cman will look in
cache for the second address the client brought with it.  The second
address will point to the host machine where the listener is running.
Cman will then use that address to direct the client to the listener
and then the connection to the database will be made.

There are many documents on metalink, which will explain connection
manager and configuration in more detail.  This note is to explain the
connection process with firewalls, and not to go into detail with
connection manager.


Solution: Use_Shared_Socket
A third solution for NT servers is to add the use_shared_socket = true
into the registry (see 124140.1).  This will allow the OS to share port
1521 and clients will then stay on 1521 when connecting to the database
and will not be port redirected.  A downfall of this option is all connetions
will stay on the listener port and if the listener is stopped or
restarted all the connections will be severed from the database.

Unix
Unix Platforms can have problems connecting to a database through a
firewall if they have implemented Multi Threaded Server (MTS).  MTS
dispatchers will redirect connection ports like NT Platform does as
mentioned above.

Solution: Setting MTS ports
A work around for this is to specify the port in the mts parameters of
the init.ora file (note:1016349.102).  This will allow the dispatcher
to use the port specified and will not select a port a random.  Then make
sure the port is open on the firewall.  The following example will show
the ports set to 2450 and 3125.  Please set these parameters according to
your individual systems.  This solution will also work with NT.

Example
mts_dispatchers="(address=(protocol=tcp)(host=hostname)
                 (port=2450))(dispatchers=1)"
mts_dispatchers="(address=(protocol=tcp)(host=hostname)
                 (port=3125))(dispatchers=1)"


SSL
Using SSL will cause Port redirection.  The work around is to select
and set the ports using MTS in the init.ora, or by setting the Ports
with Connection Manager in the cman.ora file.

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
14#
 楼主| 发表于 2001-11-6 19:29 | 只看该作者
按snow_feeling 提供的资料试了一下,有点效果,还要看一段时间的测试结果.先谢谢你了.

使用道具 举报

回复
论坛徽章:
50
现任管理团队成员
日期:2011-05-07 01:45:08马上有对象
日期:2014-02-19 11:55:14马上有钱
日期:2014-02-19 11:55:14马上有房
日期:2014-02-19 11:55:14马上有车
日期:2014-02-19 11:55:14马上有车
日期:2014-02-18 16:41:112014年新春福章
日期:2014-02-18 16:41:112013年新春福章
日期:2013-02-25 14:51:24咸鸭蛋
日期:2012-11-23 22:47:18ITPUB 11周年纪念徽章
日期:2012-10-09 18:03:32
15#
发表于 2001-11-7 10:47 | 只看该作者
wargod,你的问题好了么?我对这个问题很感兴趣,在unix下没有这个问题的。只有NT下才出这种问题。

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
16#
 楼主| 发表于 2001-11-8 21:36 | 只看该作者
snow_feeling 我修改注册表后,从防火墙查看信息,客户端与数据库通讯所需端口确实都变成1521.原理上讲是可以了.但我们的环境可能还有其它的地方有问题,所以还是有断的现象.

使用道具 举报

回复
论坛徽章:
0
17#
发表于 2006-3-16 12:43 | 只看该作者
怎么样才能有个天网注册号呢?

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表