sqlplus / as sysdba 报错:ora-01031 insufficient privileges

23 篇文章 0 订阅
1 篇文章 0 订阅

今天在使用sqlplus / as sysdba登陆时,竟然报错:ora-01031 insufficient privileges。当时我直接就纳闷掉了,平时等的时候都好好的啊,怎么现在就不行了。

这时我想,我这样是属于操作系统认证的登陆方法啊,而且用户也是oracle用户啊。

[oracle@normal ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Sep 7 21:54:21 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
ERROR:
ORA-01031: insufficient privileges

[oracle@normal ~]$ id
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(vboxsf)
这时,郁闷的时候我随便又试了一下用其他账户登竟然可以登陆,这真是太神奇了:

[oracle@test ~]$ sqlplus chenhao/oracle
SQL*Plus: Release 11.2.0.3.0 Production on Sun Sep 7 21:57:45 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>
在我抓狂的时候,想了下是不是在哪里有设置啊,能设置使用sqlplus登陆相关文件也就只用tnsnames.ora、listener.ora、sqlnet.ora。应该和tnsnames.ora、listener.ora没有很大的关系吧。于是就去看了一下sqlnet.ora其中有SQLNET.AUTHENTICATION_SERVICES选项:

SQLNET.AUTHENTICATION_SERVICES

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_SERVICESis 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.

根据官方推荐的使用默认值none,于是我就设置为none:

[oracle@test admin]$ cat sqlnet.ora 
SQLNET.AUTHENTICATION_SERVICES= (NONE) 
NAMES.DIRECTORY_PATH= (TNSNAMES,HOSTNAME) 
再次使用sqlplus / as sysdba登陆成功:

[oracle@test ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Sun Sep 7 21:57:45 2014
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL>

提示:如设置none不行那就直接把SQLNET.AUTHENTICATION_SERVICES个删了;

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值