监听中sqlnet.ora的作用(二)

2014-11-24 15:33:00 · 作者: · 浏览: 2
opyright (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
#################################################

服务端与客户端同时起作用==认证方式==>> SQLNET.AUTHENTICATION_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 ---这个只对WINDOWS上有用了。

当客户端与服务端SQLNET.AUTHENTICATION_SERVICES=(ALL)无法 用AA/BB用户名密码登陆。有一边是NONE即可连接。

1.服务器端不配置SQLNET.ORA文件,在客户端配置SQLNET.AUTHENTICATION_SERVICES=(ALL),可以正常登陆。

[oracle@ocm1 admin]$ cat sqlnet.ora
NAMES.DIRECTORY_PATH=(tnsnames,ezconnect)
SQLNET.AUTHENTICATION_SERVICES=(ALL)
[oracle@ocm1 admin]$ sqlplus bys/bys@bys3
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 17 11:24:45 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>

2.当客户端与服务端同时配置:SQLNET.AUTHENTICATION_SERVICES=(ALL)无法用AA/BB用户名密码登陆

--接上一步实验:
[oracle@bys3 admin]$ cat sqlnet.ora
SQLNET.AUTHENTICATION_SERVICES=(ALL)
从OCM1主机上测试:登陆报错:ORA-12641:
[oracle@ocm1 admin]$ sqlplus bys/bys@bys3
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 17 11:27:29 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12641: Authentication service failed to initialize
此时,将客户端或服务器的之一的sqlnet.ora 改为SQLNET.AUTHENTICATION_SERVICES=(NONE),即可连接--道理同上一步实验。