2

I want to login to the oracle db as a system admin, and I am specifying DBA privilege as SYSDBA in connection string and I am getting this error:

Keyword not supported: 'dba privilege'

Do you have any suggestions?

2
  • 4
    .NET is not a programming language, you do not want to connect to your database as the DBA from your application, and, well, I don't know. Commented Apr 20, 2011 at 3:46
  • Post your connection string please. Commented Apr 20, 2011 at 3:47

1 Answer 1

4

straight from oracle:

Privileged Connections

Oracle allows database administrators to connect to Oracle Database with either SYSDBA or SYSOPER privileges. This is done through the DBA Privilege attribute of the ConnectionString property.

The following example connects scott/tiger as SYSDBA:

// C#

using System;
using Oracle.DataAccess.Client; 

class PrivilegedConnectionSample
{
  static void Main()
  {
    OracleConnection con = new OracleConnection();

    //Connect scott/tiger as SYSDBA   
    con.ConnectionString = "User Id=scott;Password=tiger;" + 
      "DBA Privilege=SYSDBA;Data Source=oracle;";
    con.Open();
    Console.WriteLine("Connected to Oracle" + con.ServerVersion);

    // Close and Dispose OracleConnection object
    con.Close();
    con.Dispose();
    Console.WriteLine("Disconnected");
  }
}

Here's another source that has different connection strings for the various providers:

http://www.connectionstrings.com/oracle

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.