Oracle设定允许访问数据库的IP

oracle服务器 192.168.1.9 Linux

oracle客户机 192.168.1.6 Windows

192.168.1.6 tnsping 192.168.1.9

Microsoft Windows [版本 5.2.3790]
(C) 版权所有 1985-2003 Microsoft Corp.

C:\Documents and Settings\Administrator>tnsping 192.168.1.9

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 09-11月-2012 10:20:40

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

已使用的参数文件:
C:\oracle11g\product\11.2.0\dbhome_2\NETWORK\ADMIN\sqlnet.ora

已使用 EZCONNECT 适配器来解析别名
尝试连接 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.95)(PORT
OK (20 毫秒)

 修改192.168.1.9上的sqlnet.ora,添加

tcp.validnode_checking = yes
tcp.invited_nodes = (192.168.1.9)

之后运行

lsnrctl reload
 

然后在192.168.1.6上重新tnsping 192.168.1.9

C:\Documents and Settings\Administrator>tnsping 192.168.1.9

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 09-11月-2012 10:21:07

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

已使用的参数文件:
C:\oracle11g\product\11.2.0\dbhome_2\NETWORK\ADMIN\sqlnet.ora

已使用 EZCONNECT 适配器来解析别名
尝试连接 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.95)(PORT
TNS-12547: TNS: 丢失连接

 192.168.1.6上的Toad 连192.168.1.9,报错ORA-12537: TNS:connection closed

另有tcp.excluded_nodes可用,与 tcp.invited_nodes同时存在的话,优先使用 tcp.invited_nodes

当192.168.1.9不在tcp.invited_nodes中时,192.168.1.6上的tomcat报错如下:

2012-11-09 10:54:23,093 WARN [org.hibernate.util.JDBCExceptionReporter] - SQL Er
ror: 17002, SQLState: null
2012-11-09 10:54:23,093 ERROR [org.hibernate.util.JDBCExceptionReporter] - Io 异
常: Got minus one from a read call

猜你喜欢

转载自benjaminyu.iteye.com/blog/1721560