# Connecting to Oracle Database through ODBC from Windows with Oracle Instant Client

**URL:** <https://community.exploratory.io/t/connecting-to-oracle-database-through-odbc-from-windows-with-oracle-instant-client/499>\
**Category:** Uncategorized\
**Created:** [April 10, 2017, 9:15am UTC](https://community.exploratory.io/t/connecting-to-oracle-database-through-odbc-from-windows-with-oracle-instant-client/499 "2017-04-10T09:15:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hideaki\_Hayashi](https://community.exploratory.io/user_avatar/community.exploratory.io/hideaki_hayashi/32/10_2.png) [@Hideaki\_Hayashi](https://community.exploratory.io/u/Hideaki_Hayashi)\
**Post date:** [April 10, 2017, 9:15am UTC](https://community.exploratory.io/t/connecting-to-oracle-database-through-odbc-from-windows-with-oracle-instant-client/499/1 "2017-04-10T09:15:07Z")

</div>

Here is how I was able to connect to Oracle Database through ODBC with Oracle’s Instant Client on Windows.

As a prerequisite, download and install “Visual C++ Runtime for Visual Studio 2013”, if you have never done that on your windows.  
[https://www.microsoft.com/en-us/download/details.aspx?id=40784](https://www.microsoft.com/en-us/download/details.aspx?id=40784)

Then, you need to download following 2 packages from following Oracle Technology Network page. (Registration is required.)

OTN page: [Instant Client for Microsoft Windows (x64) 64-bit](http://www.oracle.com/technetwork/topics/winx64soft-089540.html)

Packages to download:

- Instant Client Package (Basic)
- Instant Client Package (ODBC)

Then unzip those packages into one same folder.  
I created a folder named C:/Oracle/oracle\_odbc, which looks like following.

 ![](https://community.exploratory.io/uploads/default/original/1X/08e713a75f0365f50a0dc16b050e9a4253ed336b.png)

Then we need to set up 2 environment variables which points this directory.  
To set environment variable, type “environment” into your Windows’s search box, and you should see something like this result.

 ![](https://community.exploratory.io/uploads/default/original/1X/630e2f15eba6972ed473cfea53fcc9784e474dd3.png)

Click “Edit the system environment variables” and this dialog will open up.

 ![](https://community.exploratory.io/uploads/default/original/1X/4c5ad86c171eff2d8f85cfda64b402ea8aded6b2.png)

Click “Environment Variables…” button.

 ![](https://community.exploratory.io/uploads/default/original/1X/de401c188e06b2ae81a9265f9e25192d4deabcfa.png)

Let’s first set PATH environment variable. It is in the upper pane. By selecting PATH and clicking “Edit…” button,  
you will see following form.

 ![](https://community.exploratory.io/uploads/default/original/1X/d9d250588ff0dfea83c5e74670e5864af16d0755.png)

I added the path of the directory I created above here. Click OK.

Then, let’s set TNS\_ADMIN environment variable. Click New button on the lower pain.

 ![](https://community.exploratory.io/uploads/default/original/1X/5093b818e44caef68e7bf396ae10bd9bb432c6f9.png)

In the dialog that opened up, type in TNS\_ADMIN as variable name, and the path of directory you created as variable value. Click OK.

Then, go back to the directory we created, and run a exe file named “odbc\_install” as administrator by right-clicking  
it and selecting “Run as administrator” like following.

 ![](https://community.exploratory.io/uploads/default/original/1X/1565dc91408447e6b4e9e32a16c1b4fc89bb9c01.png)

Then, create a text file named “tnsnames.ora” in the same directory, which looks like following.

```auto
TEST_ORACLE =
 (DESCRIPTION =
   (ADDRESS_LIST =
     (ADDRESS =
       (PROTOCOL = TCP)
       (HOST = exploratory.cnxxxxxx.us-east-1.rds.amazonaws.com)
       (PORT = 1521)
      )
    )
    (CONNECT_DATA =
     (SID = ORCL)
    )
  )

```

Replace HOST, PORT, SID (name of database) in the above, with the value for your database.

Now, type in “odbc” to Windows’s search box and find ODBC Data Sources (64-bit).

 ![](https://community.exploratory.io/uploads/default/original/1X/290fabd4cb8d2c1d2a584795f81cd5f809cee45b.png)  
Click it to open the following dialog.

 ![](https://community.exploratory.io/uploads/default/original/1X/ff2c7b025e8856af1d95cfe0cea972145795df0a.png)

In the Drivers tab, you should see an entry with the driver you just installed.  
Go to User DSN tab, and click Add.

 ![](https://community.exploratory.io/uploads/default/original/1X/27782126add41134e706024db3f1d56c87fb6cb8.png)

Pick your Oracle driver, and click Finish.

 ![](https://community.exploratory.io/uploads/default/original/1X/5db6f6cc37e74efd603f4c95414a2146add88ed3.png)

Fill the form like above. Data Source Name (DSN) is the name you will need to point from Exploratory later to connect to this databsase.  
TNS Service Name is the name you specified in the tnsnames.ora file you created.  
User ID is your database user ID.  
At this point, you can test this connection by clicking the Test Connection button.  
When it’s successful, click OK to save the new DSN.

Then set this DSN to Exploratory, so that Exploratory can connect to this database, by following the instruction below.

> **[ODBC | Exploratory](https://docs.exploratory.io/data_import/database-data/odbc)**
