HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Why doesn't "As SYSDBA" work from SQL Developer?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
whysqldoesnworkdevelopersysdbafrom

Problem

I am a SQL Server developer/DBA consultant who is helping out a customer who recently lost their Oracle DBA. I have done development on Oracle, but not much DBA work, and not in multi-homed environments like this.

The Problem: I can connect using "SYS As SYSDBA" from SQL Plus, but not from SQL Developer on the same system. However, I can connect using "system" with either SQL Plus or SQL Developer.

Details:

On this server, in my windows Admin account (also entered as server administrator in Oracle Admin Asst.), this DOS command works:

D:\Oracle\app\product\11.2.0\dbhome_1\BIN>sqlplus /@MyDb as sysdba


and, Select * from V$INSTANCE shows that it is in MyDb and that both tool and db are 11.2.0.3

So does this one:

D:\Oracle\app\product\11.2.0\dbhome_1\BIN>sqlplus sys/@MyDb as sysdba


(ALSO: entering the wrong password works as well(!))

Using SQL-Plus start menu option from same (sever, account and home), these also work:

Enter user-name: /@MyDb as sysdba
Enter user-name: sys/@MyDb as sysdba


Select * from V$INSTANCE shows that it is in MyDb and that both tool and db are 11.2.0.3

Attempt to access MyDb from same with SQL Developer, succeeds for "system" username, but fails for "sys" "as sysdba" with “ORA-01031:insufficient privileges”. However, this does work when connecting to other databases on other servers.

I have researched this, and most of the posted help for this seems to be aimed at cases where no connections at all can be made, which is not the case here. Just to head off some of these:

  • The problem isn't that the network isn't setup, because SQL Developer works for "system" both locally and remotely.



  • The problem isn't that the DB/Instance isn't started, because again, it works for "system"



  • It's not that I am connecting to the wrong database, I checked it for "system"



  • AFAIK, it's not that I am using the wrong syntax in SQL Developer to connect to a DB "As SYSDBA" because it works when I connect to other server

Solution

To connect using 'as sysdba' from a client over sql*net you need to have the

  • remote_login_passwordfile parameter to have 'exclusive'



  • password file (orapw${ORACLE_SID}) present for the instance where you try to connect to



  • have the user granted sysdba in the database (sys has this default and uses the passwd file password.



The default location for the password file is $ORACLE_HOME/dbs but since Oracle v12 it can also be stored in ASM. In that case you find it using srvctl

Context

StackExchange Database Administrators Q#124191, answer score: 2

Revisions (0)

No revisions yet.