sqlnet.ora最常用的两个功能是: 客户端起作用==连接方式 用于指定客户端的名称解析查询的命名方法的顺序。== names.directory_path=(tnsnames, onames, hostname) 服务端与客户端同时起作用==认证方式== sqlnet.authentication_services sqlnet.ora内容作用
sqlnet.ora最常用的两个功能是:
客户端起作用==连接方式 用于指定客户端的名称解析查询的命名方法的顺序。==>> names.directory_path=(tnsnames, onames, hostname)
服务端与客户端同时起作用==认证方式==>> sqlnet.authentication_services
sqlnet.ora内容作用详见官方文档:#netrf006
配置sqlnet.ora限制ip访问oracle
一些重要参数及解释:
1.bequeath_detach
控制unix系统中signal handling 的开关,默认是no,即signal handling 打开。
2.default_sdu_size
指定session data unit (sdu) 的大小,单位是bytes,建议在client端和server端都设置这个参数,确保链接的时候使用相同的sdu size,如果client端和server端配置的值不匹配会使用较小的。
3.log_directory_client/log_directory_server
指定客户端/server端log日志文件的位置
4.names.default_domain
设定客户端解析名字的域
5.names.directory_path
指定client name解析方法的次序,,默认是names.directory_path=(tnsnames, onames, hostname)
取值可以是tnsnames,ldap(dictionary server),hostname/ezconnect,cds (分布式环境下),nis (network information service (nis)
6.sqlnet_allowed_logon_versions
指定运行链接的oracle的版本sqlnet_allowed_logon_versions=(10,9,8)
7.sqlnet.authentication_services
指定启动一个或多个认证服务
authentication methods available with oracle net services:
none for no authentication methods. a valid username and password can be used to access the database.
all for all authentication methods
nts for windows nt native authentication
8.sqlnet.inbound_connect_timeout
指定客户端没有链接成功超时的时间。超时之后oracle会中断链接,同时报错。
9.ssl_version
指定ssl链接的版本
10.tcp.excluded_nodes
指定不允许访问oracle的节点,可以使用主机名或者ip地址
11.tcp.invited_nodes
指定允许访问db的客户端,他的优先级比tcp.excluded_nodes高。
12.tcp.validnode_checking
使用这个参数来启用上边的两个参数。
13.tnsping.trace_directory
使用这个参数指定tnsping trace文件的目录,默认是$oracle_home/network/trace目录
更多参数信息参见:oracle database net services reference
##################
官方文档上的说明:use the parameter names.directory_path to specify the order of the naming methods used for client name resolution lookups.
names.directory_path==>>指定用于客户端命名方法的名称解析查询的顺序。不在此参数中的连接方式将不能用。
[oracle@ocm1 admin]$ cat tnsnames.ora
bys3 =
(description =
(address = (protocol = tcp)(host = 192.168.1.211)(port =1521))
(connect_data =
(server = dedicated)
(service_name = bys3)
)
)
示例:
[oracle@ocm1 admin]$ vi sqlnet.ora
names.directory_path=(tnsnames)
~
[oracle@ocm1 admin]$ sqlplus bys/bys@bys3 --使用本地名可以连接
sql*plus: release 10.2.0.1.0 - production on fri jan 17 11:13:16 2014
copyright (c) 1982, 2005, oracle. all rights reserved.
connected to:
oracle database 11g enterprise edition release 11.2.0.4.0 - production
with the partitioning, olap, data mining and real application testing options
sql> exit
[oracle@ocm1 admin]$ sqlplus bys/bys@192.168.1.211:1521/bys3 --使用简易连接的方法,不能连
sql*plus: release 10.2.0.1.0 - production on fri jan 17 11:13:27 2014
copyright (c) 1982, 2005, oracle. all rights reserved.
error:
ora-12154: tns:could not resolve the connect identifier specified
[oracle@ocm1 admin]$ cat sqlnet.ora
names.directory_path=(tnsnames,ezconnect)
使用tnsnames中本地名和简易连接都可以
[oracle@ocm1 admin]$ sqlplus bys/bys@bys3
sql*plus: release 10.2.0.1.0 - production on fri jan 17 11:18:47 2014
copyright (c) 1982, 2005, oracle. all rights reserved.
connected to:
oracle database 11g enterprise edition release 11.2.0.4.0 - production
with the partitioning, olap, data mining and real application testing options
sql>
[oracle@ocm1 admin]$ sqlplus bys/bys@192.168.1.211:1521/bys3
sql*plus: release 10.2.0.1.0 - production on fri jan 17 11:13:59 2014
copyright (c) 1982, 2005, oracle. all rights reserved.
connected to:
oracle database 11g enterprise edition release 11.2.0.4.0 - production
with the partitioning, olap, data mining and real application testing options
sql> exit
#################################################
有三个参数:
none for no authentication methods. a valid username and password can be used to access the database.
all for all authentication methods
nts for windows nt native authentication ---这个只对windows上有用了。
当客户端与服务端sqlnet.authentication_services=(all)无法 用aa/bb用户名密码登陆。有一边是none即可连接。
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!