oracle 限制ip访问

为了安全,很多都要求对访问数据库的客户端进行ip限制,

从9i开始,这个实现很方便,只要

修改$$ORACLE_HOME/network/admin 下的sqlnet.ora

tcp.validnode_checking=yes

tcp.invited_nodes=(192.168.1.100,192.168.1.101)

tcp.excluded_nodes=(192.168.1.100,192.168.1.101)

1. 功能描述

l  不能同时使用tcp.invited_nodes tcp.excluded_nodes ,两个同时存在tcp.invited_nodes生效

l  只能制定具体ip地址,不能制定ip

l  只能限制TCP协议

l  设定后,需要重新启动监听服务,不需要重启数据库

l  tcp.invited_nodes 中应该包含数据库本机ip地址或者tcp.excluded_nodes中不能包括数据库本身ip地址

2. tcp.validnode_checking=yes

这个参数的作用主要就是检查sqlnet.ora 的合法性,如果合法性检查失败,多数在启动监听服务的时候会报错:

常见错误信息:

Started with pid=368816
Error listening on: (DESCRIPTION=(SID_NAME=testdb)(ADDRESS=(PROTOCOL=TCP)(HOST=myocldb)(PORT=1521)))
TNS-12560: TNS:protocol adapter error
 TNS-00583: Valid node checking: unable to parse configuration parameters

可以把参数tcp.validnode_checking=yes 注释,在启动,如果能启动,说明sqlnet.ora 配置有误,那就需要检查sqlnet.ora

tcp.invited_nodes=(192.168.1.100,

192.168.1.101)

这个地址似乎这样换行也会报错,因此常常的地址列表最好也要一行。

=======================这是网上的一个详细解释==============

sqlnet.ora 参数tcp.validnode_checking尴尬  

2010-06-25 10:37:04|  分类: Oracle |  标签: |字号 订阅

如果要对Oracle 进行IP Check合法性,就必须在Server 的sqlnet.ora中增加参数  tcp.validnode_checking=yes 。但参数tcp.validnode_checking  在sqlnet.ora 中设定后,如果要对Listener进行管理时出现下面错误:

[oracle@itc-test9 admin]more sqlnet.ora
tcp.validnode_checking=yes
#tcp.inited_nodes=(10.89.53.90)

[oracle@itc-test9 admin]lsnrctl start

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 12-JUN-2009 10:04:53

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

Starting /disk/oracle/OCM/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /disk/oracle/OCM/network/admin/listener.ora
Log messages written to /disk/oracle/OCM/network/log/listener.log
Error listening on: (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
TNS-12560: TNS:protocol adapter error
 TNS-00583: Valid node checking: unable to parse configuration parameters

让我们做另一个测试
删掉sqlnet.ora 中的 tcp.validnode_checking=yes

[oracle@itc-test9 admin]more sqlnet.ora
#tcp.validnode_checking=yes
#tcp.inited_nodes=(10.89.53.90)

[oracle@itc-test9 admin]lsnrctl start ABC

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 12-JUN-2009 10:15:27

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

Starting /disk/oracle/OCM/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /disk/oracle/OCM/network/admin/listener.ora
Log messages written to /disk/oracle/OCM/network/log/abc.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.89.53.63)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.89.53.63)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     ABC
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                12-JUN-2009 10:15:27
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /disk/oracle/OCM/network/admin/listener.ora
Listener Log File         /disk/oracle/OCM/network/log/abc.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.89.53.63)(PORT=1521)))
Services Summary...
Service "study" has 1 instance(s).
  Instance "study", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

能正常启动Listener 。
那我们现在修改 sqlnet.ora 增加参数 tcp.validnode_checking=yes
Client 端一样能正常连接。

参数tcp.validnode_checking=yes  的作用是为了check sqlnet.ora 中
参数 TCP.INVITED_NODES 中的IP address 合法性的。
如果由一个IP Address 或 Hostname 不能正常访问,就会导致Listener 不能正常启动。

进场会有一些Client 的用户由于机器改变,或关机。这样的情况下数据库的Listener 就不能正常打开,虽然Oracle 数据库的Lisenter 不是经常的打开关闭但我认为这个参数设置比较尴尬,在Oracle 9i 大到 11.1.0.6都有这种情况。
我希望在11R2中能将这个参数去掉,确实没有什么大用处。

 

metalink 对这种情况给出下列解释 “This behavior. is by design.”,

我认为这个设计很不好,应该去掉。

如果你看到这个参数,你是否认为合理呢?

Changes

Applied the patch for security alert # 68 or if this is a new installation.  If some hostname changes have occurred on your network, this problem may also appear.

Cause

There is an invalid or unreachable hostname in the TCP.INVITED_NODES list in the sqlnet.ora file.

Oracle no longer  allows  the listener to startup if an invalid hostname or ip address is specified in the invited_nodes list.  The listener will not start if any of the hosts or ip addresses are unreachable.   The only solution to this issue is to ensure that all the hostnames and ip addresses in the invited nodes list are reachable from the host where the listener is starting.

Solution

This behavior. is by design. 

轉自:http://space.itpub.net/34596/viewspace-605999  

2.sqlnet.ora 的作用

sqlnet.ora 用在oracle client端,用于配置连接服务端oracle的相关参数.
tnsnames.ora 用在oracle client端,用户配置连接数据库的别名参数
listener.ora 用在oracle server端,配置oracle服务端程序的监听参数

# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

当客户端通过sql net 连接的数据库的时候,会通过sqlnet.ora 来去查找tnsnames,sqlnet 可以定义子标识符的朝着顺序。

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

转载于:http://blog.itpub.net/21634752/viewspace-708377/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值