Oracle ODBC with Instant Client
Sometimes we don’t want to have full client installed just for an ODBC connection to Oracle Database, so I had a try with Oracle Instant Client.
Download & install required packages
- Instant Client Package – Basic
- Instant Client Package – ODBC You can download either Instant Client for Microsoft Windows (32-bit) or Instant Client for Microsoft Windows (64-bit) based on your preference.
After we have the packages, unzip them into a directory, all the files should be in same directory. and then run odbc_install.exe with admin privilege. Once you have the successfully installed message, the ODBC driver should appear in control panel – ODBC Data sources.
Configuration
- Configure TNSNAMES.ORA TNSNAMES file format would be
TNS_Name =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dlsun242)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)
-
Set Environment Variable Add a new System variable called TNS_ADMIN, and enter the path where your TNSNAMES.ORA resides as the value
-
Test the ODBC At this point, we should be able to see the TNS name in ODBC setup, and successfully connect to DB after enter username and password.