【sys用户权限不足,本地登录失败 |ORA-01031 insufficient privileges|】

 

sys用户权限不足,本地登录失败 |ORA-01031 insufficient privileges|

OS:2.4.21-20.19AXsmp #1 SMP Wed Jan 5 05:02:09 EST 2005 i686 i686 i386 GNU/Linux

Oracle:Oracle 10.2.0.1

安装完数据库 并且dbca建完库后,数据库起来了

sqlplus / as sysdba总是报权限不足,ORA-01031: insufficient privileges

[oracle@wz_oracle2 dbs]$ sqlplus / as sysdba   
 
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 21 16:41:01 2010
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
ERROR:
ORA-01031: insufficient privileges
 
Enter user-name:
 
[oracle@wz_oracle2 dbs]$ sqlplus sys/oracle
 
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Sep 21 16:41:05 2010
 
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
 
SQL>
就可以登录 并且都可以startup 和 shutdown,
 
一直以为是OS认证不成功,查找了大量资料
最终看到一个可以解决问题的
检查当前所连接的操作系统用户是否是"osdba" 并且已经定义在:
"$ORACLE_HOME/rdbms/lib/config.s"  
or 
"$ORACLE_HOME/rdbms/lib/config.c". 
通常应为dba
 
但我的数据库如下:
[oracle@bakserver oracle]$ cat $ORACLE_HOME/rdbms/lib/config.c /* SS_DBA_GRP defines the UNIX group ID for sqldba adminstrative access. */ /* Refer to the Installation and User's Guide for further information. */ #define SS_DBA_GRP "dba"【Oracle默认推荐用dba组,但安装的时候建了dbagroup组】 #define SS_OPER_GRP "dba" Oracle默认推荐用dba组,但安装的时候建了dbagroup组
char *ss_dba_grp[] = {SS_DBA_GRP, SS_OPER_GRP};
 
如下为建Oracle用户组和用户时的东西:

1)、创建用户组

[root@lc /]# groupadd dbagroup

[root@lc /]# groupadd oinstall

2)、添加oracle用户

[root@lc /]#  useradd -g oinstall -G dbagroup oracle

[root@lc /]# passwd oracle

当时用的是 dbagroup组,但应该是Oracle标准是用dba组的,将$ORACLE_HOME/rdbms/lib/config.c文件里面的dba修改成我数据库的dbagroup组,最后再relink all一下

重新试试登录:

[oracle@bakserver oracle]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Fri Dec 23 15:35:59 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> select status from v$instance;

STATUS

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

OPEN

SQL> exit

可以通过OS认证了,文件解决!!

 

你可能感兴趣的:(职场,AS,sysdba,休闲,ORA-01031,权限不足)