, , ,

ORA-01031: insufficient privileges

If you get the above error with / as sysdba i.e. when you are trying to connect to LOCAL instance as specified in the environment variables ORACLE_HOME and ORACLE_SID, then thee is something wrong at OS level.

One might argue that all the environment variables are perfectly set and they are logged in as oracle user, however, the issue still occurs.

Most common issue is that the oracle owner(usually oracle user) is not the part of the dba group in Linux or ORA_DBA group in Windows.


-sh-4.1$ cat /etc/group | grep dba

If you do not find oracle to be part of the dba group, then login as “root” user and modify the /etc/group file to add oracle user to the dba group.

-sh-4.1$ sudo su root
[root@lalit bin]# vi /etc/group

Add oracle to the dba group as comma separated users list. Save and exit ESC + colon + wq!

Verify your changes:

-sh-4.1$ cat /etc/group | grep dba

Now try connecting sys / as sysdba:

export ORACLE_HOME=<dbhome directory>
export ORACLE_SID=<sid name>
sqlplus / as sysdba

The best way to quickly find out the ORACLE_HOME and ORACLE_SID environment variables is see the entry in /etc/oratab:

cat /etc/oratab

Hopefully you should be able to connect to the local instance without ORA-01031.

Hope it helps!