locked
ORA-1031: insufficient privileges RRS feed

  • Question

  • User1004669611 posted

    Dear all,

    I am trying to connect my asp.net app to a database as sysdba and i get "ORA-1031: insufficient privileges".

    I can login as sysdba using sqlplus, pl/sql developer and toad, so I am guessing that I am missing some kind of dodgy Oracle setting.

    I have tried 2 different connection strings

    TNS : Data Source = server; User Id = sys; Password = pwd; DBA Privilege = SYSDBA;

    Direct: Data Source = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = server)(PORT = 1521))) (CONNECT_DATA = (SID = ORCL))); User Id = sys; Password = pwd; DBA Privilege = SYSDBA;

    Any ideas?

    Thanks in advance!

    Wednesday, October 12, 2011 7:50 AM

Answers

  • User269602965 posted

    Furthermore, Oracle would recommend you not log in as SYS as SYSDBA, but rather create a user account and assign DBA privileges to that account.

     

    what does this show from your remote Oracle client

    SQL> show parameter password;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 12, 2011 6:56 PM

All replies

  • User269602965 posted
      <connectionStrings>
        <add name="OraConnStr" connectionString="Data Source={YourSID};Persist Security Info=True;User Id={YourSchema};Password={YourPW};DBA Privilege=SYSDBA;" providerName="Oracle.DataAccess.Client"></add>
      </connectionStrings>
    
    Put the connection string in your web config then call from code like this:
     Dim connstr As String = ConfigurationManager.ConnectionStrings("OraConnStr").ConnectionString
       Using conn As New OracleConnection(connstr)
       etc.  
    
    
    Wednesday, October 12, 2011 9:22 AM
  • User1004669611 posted
    Thanks for the swift reply, but I don't understand what you are contributing.
    Is it Persist Security Info=True;?
    If that's it then it hasn't made a difference.
    Just a reminder, the problem is the ORA-1031

    Wednesday, October 12, 2011 9:26 AM
  • User818889995 posted

    Hi,

    Are you using ODP.Net? I guess the DBA Privilege is available in ODP.Net. Or are you using standard System.Data.OracleClient?

    -Thanks

    -Raghu

    Wednesday, October 12, 2011 10:48 AM
  • User1004669611 posted

    I'm using in ~\ODP.NET\bin\2.x\Oracle.DataAccess.dll with .NET 4

    Wednesday, October 12, 2011 10:52 AM
  • User818889995 posted

    ok,

    then in the connection string Data Source = server; User Id = sys; Password = pwd; DBA Privilege = SYSDBA;

    you should be setting the Data Source with the SID and not the server. This is the only thing that i can think of as of now.

    Try changing "server" to SID and se what happens

    -Thanks,

    -Raghu.

    Wednesday, October 12, 2011 11:14 AM
  • User1004669611 posted

    I appreciate you trying to help and everything, but there is no point answering a thread which you either haven't read or don't understand.

    The problem isn't connecting to the DB but rather logging sys in as sysdba.

    As I wrote above, the 2 connecton strings (TNS & Direct) work perfectly for any user except sys as sysdba.

    Wednesday, October 12, 2011 4:37 PM
  • User269602965 posted

    I'm using  ~\ODP.NET\bin\4.x\Oracle.DataAccess.dll with .NET 4

    I'm using  ~\ODP.NET\bin\2.x\Oracle.DataAccess.dll with .NET 2 and 3.5

    Wednesday, October 12, 2011 6:46 PM
  • User269602965 posted

    Furthermore, Oracle would recommend you not log in as SYS as SYSDBA, but rather create a user account and assign DBA privileges to that account.

     

    what does this show from your remote Oracle client

    SQL> show parameter password;

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, October 12, 2011 6:56 PM