Skip to content

Ora 01031 error when using sqlplus

wordpress meta

title: 'ORA-01031 ERROR when Using Sqlplus'
date: '2013-09-27T19:36:23-05:00'
status: publish
permalink: /ora-01031-error-when-using-sqlplus
author: admin
excerpt: ''
type: post
id: 457
category:
    - Oracle
tag: []
post_format: []

Normally when you install the Oracle database software you should not have any problems like this but this happened to me because I cloned a system and it happens that we use different "dba" groups on different servers.

As I understand it the install binaries are linked to the "oinstall" or "dba" or your equivalent group specific to your environment used at the time of the install. So if you run the same binaries on a different server you lose the luxury of doing an un-authenticated login with sqlplus. This was difficult to track down so I documented my fix.

You can simulate this error very easily by taking your user out of the "dba" group or removing the group completely.

Error message ORA-01031: insufficient privileges as follow:

$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 26 11:28:33 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
ERROR:
ORA-01031: insufficient privileges
Enter user-name: ^C

Temporarily you can fix it by adding your user to the group you know worked on the source system:

# grep ag /etc/group
agprd::313:agprd_o
agdev1::305:agprd_o

$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 26 11:28:58 2013
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Connected to an idle instance.

Permanent fix as follow. Update the config.s file and relink.

$ tail -1 /etc/group
#agdev1::305:agprd_o

$ pwd
/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib
$ diff config.s /tmp/config.s
23c23
< .ascii "agprd\0"
---
> .ascii "agdev1\0"

$ relink as_installed

$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 26 11:55:29 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.