您的位置:首页 > 其它

ora-01031:insufficient privileges解决方法总结 .

2016-08-18 11:20 232 查看
sqlplus "/ as sysdba" 连不上,报ora-01031:insufficient privileges解决方法
 

注意多个数据库实例时候,set ORACLE_SID='',

1、检查sqlnet.ora(WINDOWS下位于%ORACLE_HOME%NETWORKADMIN目录)是否包含这句:SQLNET.AUTHENTICATION_SERVICES=(NTS),没有的话加上

 

2、检查登陆windows的用户(administrator或安装oracle时候使用的用户)是不是在包含在ORA_DBA组中,域用户没有连上域服务器时就可能出现这种现象。

3. 要保证 remote_login_passwordfile 参数 = EXCLUSIVE .

4. 看看是否需要使用orapassw生成口令文件 .

一种解决方法案例:

1、检查系统参数:

SQL> show parameter password

NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

remote_login_passwordfile            string      EXCLUSIVE

2、

select * from v$pwfile_users;

SQL>

为空

3、

SQL> grant sysdba to sys;

grant sysdba to sys

*

ERROR at line 1:

ORA-01994: GRANT failed: password file missing or disabled

4、建立password文件

--D:/>orapwd file="D:/oracle/product/10g/db_1/database/PWDoratest.ora" password=gp

--oswong entries=10

发现没有password文件;

检查password文件是否正确

[oracle@guohuias3 dbs]$ cd $ORACLE_HOME/dbs

[oracle@guohuias3 dbs]$ ls -l orapw*
-rw-r-----
1 oracle oinstall
5120 Jul
9 2010 orapwAUXY.pwd
-rw-r-----
1 oracle oinstall
2560 Feb
18 20:26 orapworcl

检查当前 $ORACLE_SID=ORCL

发现password文件的orcl是小写的,把它改正过来

[oracle@guohuias3 dbs]$ mv orapworcl orapwORCL

并再次查询相关视图:

SQL> select
* from v$pwfile_users;

USERNAME SYSDB SYSOP
------------------------------
-----
-----

SYS TRUE
TRUE

可以看到有对应的password文件了。

现在再次登入

[oracle@guohuias3 dbs]$ sqlplus sys/kelantas@orcl
as sysdba

SQL*Plus: Release
10.2.0.1.0
- Production on Fri Feb
18 20:51:05
2011

Copyright (c) 1982,
2005, Oracle. All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
- Production

With the Partitioning, OLAP and Data Mining options

SQL>

问题解决了。

5、

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP

------------------------------ ----- -----

SYS                            TRUE  TRUE

SYS正常显示出来。

6、重新在远程以SYSDBA登录,可正常使用。

如果口令文件创建的有问题,也是会报如下的错误:

ora-01031:insufficient privileges

口令文件的命名格式应为orapwsid,并且sid是区分大小写的。由于Target Database连接Auxiliary Database时需要验证口令,

如果违反了以上规则,将会提示ORA-01031: insufficient privileges。

我在用linux创建duplicate数据库的时候 就是因为口令文件创建的路径和名称不对才遇到这个错误

-----end-------
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: