处理ORA-01031一例
现象
oracle用户登录不了:
[oracle@centos65-195 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Tue Dec 24 15:14:44 2019 Copyright © 1982, 2011, Oracle. All rights reserved. ERROR: ORA-01031: insufficient privileges
分析
查看network的配置文件,发现参数SQLNET.AUTHENTICATION_SERVICES 设置为 NONE, 初步怀疑是这个参数的问题,把它封住:
[oracle@centos65-195 admin]$ cat sqlnet.ora # Generated by Oracle configuration tools. NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) #SQLNET.AUTHENTICATION_SERVICES =NONE ADR_BASE = /u01/app/oracle
还是不行,故障照旧,再查看那个os组被设置为oracle dba:
[oracle@centos65-195 admin]$ 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. */ /* IMPORTANT: this file needs to be in sync with rdbms/src/server/osds/config.c, specifically regarding the number of elements in the ss_dba_grp array. */ #define SS_DBA_GRP "dba" #define SS_OPER_GRP "" #define SS_ASM_GRP "" char *ss_dba_grp[] = {SS_DBA_GRP, SS_OPER_GRP, SS_ASM_GRP};
再看看oracle的用户id:
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),504(asmdba)
根源
看来是oracle的用户不属于dba这个组造成的,加上这个组:
# usermod -G dba oracle 退出重新登录试试,成功了。 $ id uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba) $ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Tue Dec 24 15:24:37 2019 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> quit