Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Oracle returns an error "ORA-01031: insufficient privileges" When I run sqlplus / as sysdba but sqlplus sys/oracle123 as sysdba doesn't, why?

  • Oracle version: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit
  • Linux version: SUSE Linux Enterprise Server 11 (x86_64)

I know that Oracle uses OS authentication when running sqlplus / as sysdba, I also checked sqlnet.ora carefully and it contains SQLNET.AUTHENTICATION_SERVICES = (NTS).

I also changed the oracle user's group, oracle user absolutely belongs to dba group because when I run command id the following information returns:

oracle@linux-mage:~> id
uid=103(oracle) gid=106(dba) groups=105(oinstall),106(dba)

Another information is I can logged on through sqlplus sys/oracle123 as sysdba, but I can not shutdown the instance:

oracle@linux-mage:~> sqlplus sys/oracle123 as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 5 16:29:57 2011

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

Connected.
SQL> shutdown immediate
ORA-24324: service handle not initialized
ORA-24323: value not allowed
ORA-27140: attach to post/wait facility failed
SQL> shutdown abort
ORA-01031: insufficient privileges
SQL>

i ran strace -o trace.out sqlplus "/ as sysdba" and get the following output message. the strace message is too big. so i paste it into pastebin. please visit this link

http://pastebin.com/YpjVeG8u

ipcs -s and ipcs -ls information:
oracle@linux-mage:~> ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems

oracle@linux-mage:~> ipcs -ls

------ Semaphore Limits --------
max number of arrays = 200
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 100
semaphore max value = 32767
share|improve this question

migrated from stackoverflow.com Sep 5 '11 at 10:09

This question came from our site for professional and enthusiast programmers.

    
Are you logged on as the oracle user in linux? – Klas Lindbäck Sep 5 '11 at 7:24
    
yes, i logged on the server computer as oracle user. – redhatlinux10 Sep 5 '11 at 7:32
    

Something must have gone wrong at the O/S level - check this page for some steps to track down the problem

share|improve this answer
cat $ORACLE_HOME/network/admin/sqlnet.ora

echo $ORACLE_SID

ls -l $ORACLE_HOME/dbs/orapw*
share|improve this answer

Post/wait is the semaphore IPC subsystem - it is likely that either you have run out of semaphores, or the semaphores have been created with permissions that don't permit your user to access them - check the output of ipcs -s, where are the permissions there? Compare the number of semaphores to ipcs -ls.

share|improve this answer

It seems that once the shutdown immediate fails, the connection is dropped, although it doesn't show it. Exiting sqlplus, reconnecting and immediately issuing shutdown abort got things unstuck for me.

From https://community.oracle.com/thread/459659

share|improve this answer
    
This doesn't answer the question. – Colin 't Hart Mar 15 '15 at 19:58

I had the same problem of getting an ORA-01031 error when doing a sqlplus / as sysdba. My problem was corrected when I unset the environment variable TWO_TASK.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.