ORA-01031: insufficient privileges - sqlplus "/ as sysdba"
                                                 Last update (2013-09-17 21:15:17)
                                                                                                                   Date added (2012-04-10 14:04:31)

When you try to connect from Linux (Unix) as sysdba you get the error:
$>sqlplus "/ as sysdba"

SQL*Plus: Release Production on Tue Apr 10 23:20:28 2012

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

ORA-01031: insufficient privileges
The error is caused in most cases because the user "oracle" is not setup correctly. There is something "wrong" with the dba group of the user.

Check the following:

1. At $ORACLE_HOME/rdbms/lib/config.c what is the value of "DBA GROUP". An example of wrong configuration:
/*  $Header: config_ux.tmp 120.0 2005/10/13 10:30:15 ssuraj noship $ */

/*  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 "oracle"
#define SS_OPER_GRP "oracle"

char *ss_dba_grp[] = {SS_DBA_GRP, SS_OPER_GRP};
You can find the groups of the oracle user with the command $ id
Typically the correct group for oracle user is: dba and not "oracle".

So the workaround is:
1. Edit $ORACLE_HOME/rdbms/lib/config.c and set the correct groups, for example
#define SS_DBA_GRP "dba"
#define SS_OPER_GRP "dba"
#define SS_ASM_GRP "dba"
2. Generate a new config.o
cd $ORACLE_HOME/rdbms/lib
mv config.o config.bck
3. relink oracle
make -f ins_rdbms.mk ioracle
Tip: to trace the sqlplus use the command:
strace -o /tmp/strace_sysdba.output -cfT sqlplus / as sysdba
Reviews (1)