Access remote Oracle database with Powershell

Question:

I need to be able to connect to an Windows 7 based Oracle server (32 bit, Oracle XE) which is on my network. The machine I need to connect from is running Windows 7 64 bit, with Powershell installed on both machines.

I have installed the Oracle 32 bit client on my 64 bit machine and have SQL Developer installed on both machines. I want to create a script that connects the the Oracle database and runs a simple SELECT query. I can’t get it to connect though.

I have tried using ODAC (I think I have to install Visual Studio to use this as the install fails). I hear that OleBD might be a lot easier. I would like to do it with TNS is possible. Can anyone offer me any guidance here? I have a book on Powershell and Oracle and I am still confused, I can’t get past the first stage.

Any help would be greatly appreciated.

Answer:

Here is a small example of what I was using in 2015.

—– Edited in fall 2017 —–

For a while now Oracle edited a full managed DLL for .NET which is available through Nugets :

Source:

Access remote Oracle database with Powershell by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply