Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 550
  • Last Modified:

Need to add sysdba specifier to Oracle connection

Hello, I need to log on as a sysdba to execute the  "shutdown immediate" command.

Here is what I have thus far:

using System;
      using System.Data.OracleClient;
      public class OkShutdown
            public OkShutdown()
            static string ConnectString = "";
            public static void Main(string[] parms)
                        ConnectString = "Server=DBserver;User ID=" + parms[0] + ";Password=" + parms[1] + ";Integrated Security=no;";
                        OracleConnection conn = new OracleConnection(ConnectString);
                        OracleCommand comm = new OracleCommand("shutdown immediate",conn);
                  catch (Exception e)
Stella Pauley
Stella Pauley
1 Solution
Carl TawnSystems and Integration DeveloperCommented:
You could try something like:

   OracleCommand comm = new OracleCommand("CONNECT user/password AS sysdba; shutdown immediate;");

This is how you would do it through iSQLPlus, not sure if it will work through a command object though.
Stella PauleyAuthor Commented:
I will try this instead:

ConnectString = "Server=DBServer;User ID=SYS; Password=password;DBA Privelege=SYSDBA; Integrated Security=no;";

I am not sure how to configure the connect string in the scenario you provided.


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now