ORA-01031: insufficient privileges问题解决办法
在操作系统本地在oracle用户下使用sqlplus / as sysdba连接sqlplus的时候提示ORA-01031: insufficient privileges
查看操作系统版本信息
[oracle@OracleBak admin]$ lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.6 (Final)
Release: 6.6
Codename: Final
正常本地登陆的时候应该不需要授权的,检查sqlnet.ora文件,文件路径为$ORACLE_HOME/network/admin/sqlnet.ora,
[oracle@OracleBak admin]$ cat sqlnet.ora
# sqlnet.ora Network Configuration File: /opt/ora11/product/11.2/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT)
检查监听和tnsping均正常,查阅资料后发现sqlnet.ora中的SQLNET.AUTHENTICATION_SERVICES
1、在windows下,SQLNET.AUTHENTICATION_SERVICES必须设置为NTS才能使用OS认证;
不设置或者设置为其他任何值都不能使用OS认证。
2、在linux下,在SQLNET.AUTHENTICATION_SERVICES的值设置为ALL,或者不设置的情况下,OS验证才能成功;
将此参数修改为ALL后即可使用sqlplus / as sysdba;直接登陆了,可是使用sqlplus sys/oracle@orcl as sysdba;登陆的时候提示ORA-12641: Authentication service failed to initialize,将sqlnet.ora中的
SQLNET.AUTHENTICATION_SERVICES= (ALL)
这一行去掉之后再使用用户名和密码登陆可以正常登陆了
sqlnet.ora文件内容
# sqlnet.ora Network Configuration File: /opt/ora11/product/11.2/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
#SQLNET.AUTHENTICATION_SERVICES= (ALL)
NAMES.DIRECTORY_PATH= (TNSNAMES,EZCONNECT)
tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/ora11/product/11.2/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = OracleBak)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
listener.ora
# listener.ora Network Configuration File: /opt/ora11/product/11.2/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(SID_NAME = orcl)
)
)
ORCL =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.10.242)(PORT = 1521))
)
)
ADR_BASE_GNNT = /opt/ora11
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341