Home » Other » Client Tools » help with installation of Oracle client (Oracle client 12c)
help with installation of Oracle client [message #678816] Wed, 15 January 2020 15:17 Go to next message
dtran
Messages: 5
Registered: January 2020
Junior Member
Hello,

I am new to Oracle forum, and I would like to seek you help and expertise on how to install an Oracle client 12c on the Microsoft Server 2016. I would like to ask if I need to choose a Oracle Client (X64) or Oracle Client (32 bits) . The reason that I am asking that I run a Power Shell script and it is in the WOW6432Node so I guess that mine script is 32 bits and I may need to download an Oracle client (32 bits). Please help to correct mine assumption.

Also , I would be greatly appreciated if you could give some instruction regarding the download of Oracle client for Window Server 2016.

Thanks!

Re: help with installation of Oracle client [message #678817 is a reply to message #678816] Thu, 16 January 2020 01:45 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Welcome to the forum. Please read the OraFAQ Forum Guide and How to use code tags and make your code easier to read

Download your software from hhere,
https://www.oracle.com/database/technologies/oracle19c-windows-downloads.html

I don't understand your comment about Powershell. What does that have to do with Oracle?
Re: help with installation of Oracle client [message #678828 is a reply to message #678816] Thu, 16 January 2020 13:41 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
What is the problem that you are facing? Is it just a general query about how to install Oracle client in Windows OS? Or, are you facing issues while connecting to Oracle database server through Power Shell?

Also, it's good to know whether your Oracle database resides in on-premise server or cloud like Azure etc.? If yes, then cloud shell on Azure is very efficient compared to client side setup. So please provide more details as requested. John has already provided the link to download the software.

[Updated on: Thu, 16 January 2020 13:43]

Report message to a moderator

Re: help with installation of Oracle client [message #678898 is a reply to message #678828] Tue, 21 January 2020 10:03 Go to previous messageGo to next message
Minh.Tran@emoryhealthcare
Messages: 5
Registered: January 2020
Junior Member
Hi Lalit,
Thank you so much for the reply. I am glad that you ask if I was trying to connect to oracle database through power shell.
The answer is Yes. I have set up the Oracle client TNSnames.ora in my Oracle_Home directory in Window.
Since I am new to Window and Power Shell, I apologize for asking few simple and stupid question regarding to power shell.

I have a very simple Power Shell script such as

$domain = "TST"
$swtsloc = "myid"
$password = "mypassword"
$adOpenStatic = 3
$adLockOptimistic = 3
$objConnection = New-Object -comobject ADODB.Connection
$objRecordset = New-Object -comobject ADODB.Recordset
$objRecordset.CursorType = 2
$objRecordset.CursorLocation = 3

$sql = "select * from wts.locations where lower(clientname) = lower('$sWtsLoc')"

Try
{
    $objConnection.Open("Provider=MSDAORA;Data Source=$($domain)1;User Id = ehcjob;Password =$password")
}
catch
{
    HandleError "Could Not open Database. Ensure tnsnames.ora and sqlnet.ora are located in C:\Oracle\Client\NETWORK\ADMIN and that their configuration is up to date."
    $error_occurred = $true
}
1. May I ask if I need to set up ODBC connection or driver on Window as I was reading on the internet about Window ODBC ? I suspect that I do not need to because I already installed Oracle Client 32 bits on Window, and
I have my tnsnames.ora which will facilitate the connection to Oracle; So I do not need to install Window ODBC. Please help to correct my assumption if it is wrong.

2. May I ask a question regarding the ADODB.Connection ? Do I need to import a package or anything related to the connection object ADO since I am using ADODB.Connection in my above simple Power Shell script ?
I guess that it is NO since I already have the Microsoft Frame Work 3.4 in my window; therefore, I do not need to import any additional package. Please help to correct my assumption.

3. Do I need to set up an environment variable that refer to the location of my tnsnames.ora so that I would use it to call the tnsnames.ora in my script? Right now, I don't call the tnsnames.ora in my script because I assume that window should have known where my tnsnames.ora is. Please also help to correct my assumption if it is not correct.

4. My simple tnsname.ora that I got from the internet , and I already modified it is as follow:

TST=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = TST.com)
(PROTOCOL = TCP)
(HOST = TST.com)
(PORT = 1521)
)
(CONNECT_DATA =
(SID = TST)
)
)

)


Thank you so much for all of the helps.

Regards,
Tom



[Updated on: Thu, 23 January 2020 11:13] by Moderator

Report message to a moderator

Re: help with installation of Oracle client [message #678951 is a reply to message #678898] Thu, 23 January 2020 11:37 Go to previous message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Minh.Tran@emoryhealthcare wrote on Tue, 21 January 2020 21:33
I already have the Microsoft Frame Work 3.4
As you mentioned you have .NET framework, you could use the System.Data.OracleClient class and your data_source would be the alias you used in your tnsnames entry. I mostly use Python these days, so I could quickly relate to the Power Shell code where similarly you create a connection object of type System.Data.OracleClient.OracleConnection, open a new session, and execute the SQL command. Alternatively, I have seen code where connection object is created using following class:

$connection = New-Object Oracle.ManagedDataAccess.Client.OracleConnection(User, Password, Data source)
Whether you need to use 32-bit or 64-bit version of Oracle client solely depends on your Windows OS.

Oracle client will install all the required ODBC drivers to connect to the database. You might have to look at your environment variables for client to know where ORACLE_HOME is, so your tnsnames and sqlnet locations are known. Data source in the connection uses the alias you provide in your tnsnames conn string.

[Updated on: Thu, 23 January 2020 11:43]

Report message to a moderator

Previous Topic: How to call external program from SQL*Plus and catch its output into anonymous PL/SQL block
Next Topic: Views not visible in the object browser (PL/SQL Developer) although accessible with a query
Goto Forum:
  


Current Time: Thu Mar 28 05:57:55 CDT 2024