当前位置:Gxlcms > mysql > ORA-01031:insufficientprivileges,ORA-01925:maximumof30e

ORA-01031:insufficientprivileges,ORA-01925:maximumof30e

时间:2021-07-01 10:21:17 帮助过:50人阅读

ORA-01031:insufficient privileges,ORA-01925: maximum of 30 enabled roles exce

(一)ora-01031:insufficient privileges

1.sqlplus "/ as sysdba" 连不上,,报ora-01031:insufficient privileges解决方法

select instance_name from v$instance;#查看Oracle实例名


SQL> select instance_name from v$instance;

INSTANCE_NAME
--------------------------------
orcl


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

(2)检查登陆的用户是不是在包含在ORA_DBA组中,

windows上是(administrator或安装oracle时候使用的用户),域用户没有连上域服务器时就可能出现这种现象;

linux、unix上root或安装oracle的授权账户

SQL> select * from v$pwfile_users;

USERNAME SYSDBA SYSOPER

------------------------------------------------------------ ---------- ---------
SYS TRUE TRUE



如果返回空,则SYS无dba权限

SQL> grant sysdba to sys;
grant sysdba to sys
*
ERROR at line 1:
ORA-01994: GRANT failed: password file missing or disabled

此次应重建或修改密码文件,详见第(4)步



V$PWFILE_USERS

这个视图列出从口令文件中导出的授予SYSDBA和SYSOPER权限的用户。

列 数据类型 说明

USERNAME

VARCHAR2(30)

包含在口令文件中的用户名

SYSDBA

VARCHAR2(5)

如果此列的值为TURE,则该用户可利用SYSDBA权限进行连接

SYSOPER

VARCHAR2(5)

如果此列的值为TURE,则该用户可利用SYSOPER权限进行连接


(3)要保证 remote_login_passwordfile 参数 = EXCLUSIVE

SQL> show parameter password

NAME TYPE
------------------------------------ ----------------------
VALUE
------------------------------
remote_login_passwordfile string
EXCLUSIVE


#---------如果不是运行

SQL>alter system set remote_login_passwordfile=EXCLUSIVE scope=spfile;

#/*-------------------------

REMOTE_LOGIN_PASSWORDFILE=

{NONE | SHARED}

REMOTE_LOGIN_PASSWORDFILE specifies whether Oracle checks for a password file.



Values:

NONE

Oracle ignores any password file. Therefore, privileged users must be authenticated by the operating system.


SHARED

One or more databases can use the password file. The password file can contain SYS as well as non-SYS users.


Note:

The value EXCLUSIVE is supported for backward compatibility. It now has the same behavior as the value SHARED.

#-----------------------*/


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

比如机器是windows系统:

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



SQL> select * from v$pwfile_users;

USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE

SYS正常显示出来,重新在远程以SYSDBA登录,可正常使用。

linux

人气教程排行