Oracle and PowerShell - Connection String with SYSDBA

From: Hoff, Brad <BHoff_at_tnsk.com>
Date: Thu, 10 Feb 2011 17:59:04 -0600
Message-ID: <3EA2F5B0D243A344A129C7BCE70EC511932C6DB6B1_at_EMAIL.tps.local>



I am trying to write a powershell script to get some information from one of my Oracle instances on a regular basis. The script works great when I run it with low privilege, but I am trying to figure out how to run the script as SYSDBA.

When I use a connection string like the one shown on this website: http://www.connectionstrings.com/oracle Data Source=urOracle;User Id=urUsername;Password=urPassword;DBA Privilege=SYSDBA; I get the following error in PowerShell:
$connectionString = "Data Source=MYDB;User Id=sys;Password=xyz;DBA Privilege=SYSDBA;"
[System.Reflection.Assembly]::LoadWithPartialName("System.Data.OracleClient")
$connection = New-Object System.Data.OracleClient.OracleConnection($connectionString)
New-Object : Exception calling ".ctor" with "1" argument(s): "Keyword not supported: 'dba privilege'."

What is the correct syntax for elevated privileges in Oracle through PowerShell?

Thanks,
Brad Hoff
Lead Database Administrator
Microsoft SQL and Oracle
Tenaska Power Services

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Feb 10 2011 - 17:59:04 CST

Original text of this message