解读sqlnet.ora文件

文件内容:

# sqlnet.ora Network Configuration File:D:\app\lenovo\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

# Generated by Oracle configuration tools.

 

# This file is actually generated by netca.But if customers choose to

# install “Software Only”, thisfile wont exist and without the native

# authentication, they will not be able toconnect to the database on NT.

 

#SQLNET.AUTHENTICATION_SERVICES= (NTS)

 

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

————————————————————————————–

 

文件作用:

 

sqlnet.ora文件控制着客户端Oracle NetServices的行为,例如跟踪级别和会话特性。

当客户发出请求时,通过使用tnsnames.ora文件首先解析Oracle Net Services的名称。tnsnames.ora文件中的参数将该请求指引到适当的数据库节点。监听器进程监听客户请求,并且将其与一个服务器进程相连接。该请求将被处理,其结果被返回到客户端机器。

 

官方文档:

The sqlnet.ora file is the profileconfiguration file. It resides on the client machines and the database server.Profiles are stored and implemented using this file. The database server can beconfigured with access control parameters in the sqlnet.ora file. These parameters specify whether clients are allowed ordenied access based on the protocol.

The sqlnet.ora file enables you to do thefollowing:

Specify the client domain to append tounqualified names

Prioritize naming methods

Enable logging and tracing features

Route connections through specificprocesses

Configure parameters for external naming

Configure Oracle Advanced Security

Use protocol-specific parameters torestrict access to the database

By default, the sqlnet.ora file is locatedin the ORACLE_HOME/network/admin directory. The sqlnet.ora file can also bestored in the directory specified by the TNS_ADMIN environment variable.

 

 

参数解释:

#SQLNET.AUTHENTICATION_SERVICES= (NTS)

none:作用是不允许通过os系统用户登录数据库,需要提供用户名及密码;

all:作用是允许所有的登录方式;

nts:作用是windows的本地操作系统用户认证;

 

表示可以采用os认证,在数据库服务器上,可以利用sqlplus / as sysdba登陆,一般这个配置在windows是没有问题的,但是在unix环境下可能有问题,一般在unix可以去掉这个配置

 

 

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

表示首先利用tnsnames进行解析,如果tnsnames解析不到,将使用EZCONNECT连接,EZCONNECT是oracle10g引出的简单连接,连接格式:
不是 sqlplus user/password@192.168.100:1521:orcl

而是 sqlplus user/password@192.168.100:1531/orcl

当然也可以在括号中加入hostname等解析方式

标签