今天在客户现场一个Windows平台的数据库中,Administrator用户使用 sqlplus "/ as sysdba"登陆提示ORA-01031 insufficient privileges 权限不足异常,无法采用操作系统认证登陆数据库。
首先,检查了Administrator管理员是否属于组ORA_DBA,无疑这点是肯定的,所以对于数组这方面设置是正常。

OK,今天的主角就是sqlnet.ora中的 SQLNET.AUTHENTICATION_SERVICES 参数。
1、SQLNET.AUTHENTICATION参数,官网给出一下解释说明
Purpose
To enable one or more authentication services. If authentication has been installed, then it is recommended that this parameter be set to either none or to one of the authentication methods.
Default
None
Note:
When installing the database with Database Configuration Assistant (DBCA), this parameter may be set to nts in the sqlnet.ora file.
Values
Authentication Methods Available with Oracle Net Services:
NONE for no authentication methods, including Microsoft Windows native operating system authentication. When SQLNET.AUTHENTICATION_SERVICES is set to none, a valid user name and password can be used to access the database.
ALL for all authentication methods.
NTS for Microsoft Windows native operating system authentication.
Authentication Methods Available with Oracle Advanced Security:
kerberos5 for Kerberos authentication.
radius for RADIUS authentication.
tcps for SSL authentication.
2、对于windows平台 ,需要设置参数SQLNET.AUTHENTICATION_SERVICES = (NTS) 开启操作系统认证的登陆。
不设置(如,把该行语句加#注释符号)或者设置为其他任何值都不能使用OS认证。
主要是以下几种情况:
1. sqlnet.ora文件为空,或用#注释掉 --基于Oracle密码文件验证
2. SQLNET.AUTHENTICATION_SERVICES = (NTS) --基于操作系统验证
3. SQLNET.AUTHENTICATION_SERVICES = (NONE) --基于Oracle密码文件验证
4. SQLNET.AUTHENTICATION_SERVICES = (NONE,NTS) --基于操作系统验证(前后顺序颠倒也一样)
3、对于Linux和Unix平台,编辑$ORACLE_HOME/network/admin/sqlnet.ora文件,分别验证参数值为NONE或是ALL时,登陆测试结果
- 设置SQLNET.AUTHENTICATION_SERVICES=(NONE)时,不启用操作系统验证,需要使用密码登陆
SQLNET.AUTHENTICATION_SERVICES=(NONE)
[oracle@node01 admin]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Feb 15 21:31:10 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
- 设置SQLNET.AUTHENTICATION_SERVICES=(ALL) 时,可以启用操作系统验证登陆。
总结一下:
1、在windows中,是通过sqlnet.ora这个文件来实现验证机制控制的,当你装完数据库并用netca创建了监听,就会生成这个文件,通常默认是以下内容:
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file won't exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES = (NTS)
也就是说,默认就是采用操作系统验证的,也许Oracle认为,拥有了SA权限,就拥有了系统最高权限,所以数据库DBA的sys用户也无需再验证密码了
如果设置成(NONE),就表示采用数据库身份验证,还可以设置成(NONE,NTS),其实这样设也没有意义了,只要括号中有NTS,就会采用操作系统验证,NONE就没有用了
2、对于Linux/UNIX平台,在$ORACLE_HOME/NETWORK/admin 其实是没有sqlnet.ora文件,似乎好像就没有必要在非windows平台讨论SQLNET.AUTHENTICATION_SERVICES参数了。
其实不是这样的,就如上面的操作验证一样。如果我们需要控制Oracle的登陆,同样可以在admin目录下使用sqlnet.ora文件,还可以下控制Oracle Net中其它设置参数,如:SQLNET.INBOUND_CONNECT_TIMEOUT = 120
参考博客 :
http://blog.youkuaiyun.com/aaron8219/article/details/38904965
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27039319/viewspace-2133605/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27039319/viewspace-2133605/