Need to add sysdba specifier to Oracle connection

Posted on 2006-03-29
Last Modified: 2008-02-01
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)
Question by:Stella Pauley
    LVL 52

    Accepted Solution

    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.
    LVL 1

    Author Comment

    by:Stella Pauley
    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    In one of my recent projects, I was working with IP cameras, I need to take some pictures from the camera and do some processing on it. The first step, was to retrieve the image from camera into Image object. So that it can be displayed or …
    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now