Oracle odbc driver installation (oracle client not installed)

Source: Internet
Author: User

Recently, a project was created to access the oracle database through VC odbc. It can run normally on my computer and cannot run on other computers because the oracle odbc driver is not available and the oracle Data source cannot be configured. Most of the blog posts on the Internet are solved by installing the oracle client. I think it is a small program. There is no need to install the client. Refer to the blog on the Internet and visit the oracle website. So this article is available.

1. Download the odbc driver

You need to download two things.

Instantclient-basiclite-nt-12.1.0.1.0.zip
Instantclient-odbc-nt-12.1.0.1.0.zip

Web: http://www.oracle.com/technetwork/cn/topics/winsoft-095945-zhs.html

As time passes, the version number will be updated and the URL will also change. Therefore, you can search for the keyword "Baidu oracle instantclient basiclite" and find it on the official oracle website for download. During download, you must agree to the agreement and be an oracle registered user. user registration is free of charge.

2. decompress the two files to the same folder.
A. Extract the two files respectively.
B. After decompression, the two folders contain the instantclient_12_1 directory. Copy the content in the instantclient_12_1 directory of odbc to instantclient_12_1 of basicclient.
C. Copy the instantclient_12_1 directory under basicclient to D: \ Program Files \ instantclient_12_1


3. Copy the NETWORK directory on the computer where the oracle database is located to the instantclient_12_1 directory. The network on the computer where my oracle server is located is in D: \ oraclexe \ app \ oracle \ product \ 11.2.0 \ server.

4. Modify the NETWORK \ ADMIN \ tnsnames. ora file and replace the host name with the IP address. In the following example, 10.17.176.138 is the host name on the computer where the oracle database is located. The host name may not be correctly connected, so it is changed to an IP address.

XE =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 10.17.176.138) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)

5. Add the environment variable TNS_ADMIN. The variable value points to the ADMIN directory. My configuration is D: \ Program Files \ instantclient_12_1 \ NETWORK \ ADMIN.

6. Install odbc_install.exe in the "instantclient_12_1" directory. Note: The "DOC" box appears during installation, and you may not be able to determine whether the installation is correct. In fact, you can run cmd to enter the instantclient_12_1 directory and install it manually. \ odbc_install.exe.

8. Configure and test the data source
In order not to affect the test, first shut down the firewall of the computer where the oracle database is located, or allow exceptions to TCP port 1521. Configure the client computer, control panel-> Data Source-> User DSN-> Add select Oracle in instantclient_12_1, select database Name in TNS Service Name, my Name is XE, click Test Connection, if the prompt is successful, it will be OK.

9. Prevent garbled characters
On the computer where the database is installed (my oracle is installed on the window), check the NLS_LANG value under HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/KEY_XXX, where XXX is ..., I cannot tell it clearly. It should be the database name.
Add the environment variable NLS_LANG to the client computer. The value is the obtained NLS_LANG value. My server's NLS_LANG is SIMPLIFIED CHINESE_CHINA.ZHS16GBK


Zookeeper

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.