How to Install Oracle Instant Client in Windows

Posted on Updated on

ICOracle Instant Client is a collection of free, light-weight, and easy to install Oracle Database tools, libraries and SDKs which can be used for building and connecting applications to an Oracle Database instance. It enables applications to connect to a local or remote Oracle Database, while providing the necessary network connectivity, as well as basic and high end data features. You can get more details from here.

Suppose you need to access data in a Oracle Database from a .Net application. For any software which requires to access a database, it is required to use an API, which connects the application to the database and facilitate the insert, update and delete functions on data.

There are three main types of APIs that can be used to connect to various kind of databases.

  • JDBC – API developed by Oracle to access the relational and non-relational database
  • ODBC – API developed by Microsoft to access relational databases
  • OLEDB – API developed by Microsoft to access both relational and non-relational databases

You can get an idea about relational and non-relational databases from here.

If it is a Java application, you can use the JDBC (Java Database Connectivity) driver. Since, we are looking at a .Net application, we must use either ODBC (Open Database Connectivity) or OLEDB (Object Linking and Embedding Database). As we are dealing with Oracle database, which is a relational database, let’s focus on ODBC.

The .Net Framework data providers can be used to execute commands, and retrieve results. The .NET Framework Data Provider for ODBC can be used for data sources exposed using ODBC. It supports several drivers as;

  • SQL Server
  • Microsoft ODBC for Oracle
  • Microsoft Access Driver (*.mdb)

Since, our target is a Oracle Database, we need below components along with a up and running Oracle database server (local/remote).

  • The ODBC Driver for Oracle
  • Oracle Client Software

When installing the Oracle Instant Client, we are automatically installing the ODBC driver for Oracle as well. Therefore, below steps would install everything required.

Steps:

  1. The very first thing you need to do is, find the Oracle database server version. In this case, let’s assume the version is 11g.
  2. Download the Oracle Instant Client (32 bit/ 64 bit)
    • Navigate to Instant Client Downloads for Microsoft Windows. Be specific about the bit size.
    • Accept the license agreement
    • Download below packages of the selected client version
      • Basic Package All files required to run OCI, OCCI, and JDBC-OCI applications
      • ODBC Package – Additional libraries for enabling ODBC applicationsInstant Client Download Page
  3. Unzip files from both packages into a single folder (C:\Oracle\instantclient_11_2)
  4. Configure System Environment Variables
    • Copy the folder path of Oracle Instant Client content (C:\Oracle\instantclient_11_2)
    • Right click My Computer icon
    • Select Properties6
    • Click on Advanced system settings4
    • Click Environment Variables button5
    • In the Environment Variables window, configure system variables as follow.7
    • Append the above folder path to System PATH variable. 
      • PATH = %PATH%;C:\Oracle\instantclient_11_2     (Under the Edit option,  add a ‘;’ and paste the path to the end of the string)
    • Create a new System variable named TNS_ADMIN and add the client folder path.
      • TNS_ADMIN = C:\Oracle\instantclient_11_2
  5.  Install Oracle Instant Client
    • Open the Oracle Instant Client folder (C:\Oracle\instantclient_11_2)
    • Right click odbc_install.exeInstant Client Folder
    • Select ‘Run as administrator’Run as administrator
    • Provide administrator credentials (you can see a command prompt appear and disappear within few seconds)

Well, this is pretty much about installing the Oracle Instant Client. But, based on your requirement you may have to create a tnsnames.ora file and a DSN (Data Source Name) to test the connection. Therefore, next article will be on ‘Creating a tnsnames.ora file’.

Hope, someone found this useful…:)

Leave a comment