主页
http://www.oracle.com/technetwork/topics/dotnet/index-085163.html
下载页:
http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html
Linux DLL :
https://www.nuget.org/packages/Oracle.ManagedDataAccess.Core
————————————————-【ps 调用oracle .net连接器库,读写oracle的脚本例子】————————————————-
$AssemblyFile = “C:\Oracle\product\10.2.0\client_1\
ODP.NET\bin\2.x\Oracle.DataAccess.dll”
$ConnectionString = “User ID=Username;Password=Password;Data Source=Server;Persist Security Info=True”
$CommandText = “SELECT * FROM Table”
[Reflection.Assembly]::LoadFile($AssemblyFile) | Out-Null
$OracleConnection = New-Object -TypeName Oracle.DataAccess.Client.OracleConnection
$OracleConnection.ConnectionString = $ConnectionString
$OracleConnection.Open()
$OracleCommand = New-Object -TypeName Oracle.DataAccess.Client.OracleCommand
$OracleCommand.CommandText = $CommandText
$OracleCommand.Connection = $OracleConnection
$OracleDataAdapter = New-Object -TypeName Oracle.DataAccess.Client.OracleDataAdapter
$OracleDataAdapter.SelectCommand = $OracleCommand
$DataSet = New-Object -TypeName System.Data.DataSet
$OracleDataAdapter.Fill($DataSet) | Out-Null
$OracleDataAdapter.Dispose()
$OracleCommand.Dispose()
$OracleConnection.Close()
$DataSet.Tables[0]
powershell如何连接oracle数据库并执行sql
1 Answers
Best Answer