Configure Oracle client to connect to the database

Source: Internet
Author: User

1. Download

SlaveHttp://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.htmlDownload

Instant Client package-Basic Package (Note: All files required to run OCI, occi, and JDBC-OCI applications) downloaded here is version 11.1.0.7

2. Save the Oracle client package locally:

Create a folder, such as oracle_client, and compress the downloaded file to this folder. (directory: D: \ oracle_client \ instantclient_10_2)

3. In the current directory, create two new files, sqlnet. ora and tnsnames. ora, and then manually configure sqlnet. ora and tnsnames. ora.

For example:

Content of the sqlnet. ora file:

Sqlnet. authentication_services = (CNT)

Names. directory_path = (tnsnames, ezconnect)

 

Tnsnames. ora file content (italic indicates the content to be replaced ):

Orcl =

(Description =

(Address_list =

(Address = (Protocol = TCP) (host =192.168.1.103) (Port = 1521 ))

)

(CONNECT_DATA =

(SERVICE_NAME =Orcl)

)

)

 

4. Configure Environment Variables

Variable name: tns_admin

Variable value:D: \ oracle_client\ Instantclient_10_2

Otherwise: ORA-12154: TNS: cocould not resolve the connect identifier specified Error

 
Solve Chinese garbled characters
Add the following to the environment variable:

Variable name: nls_lang

Variable value: american_america.zhs16gbk

 

If Oracle is installed and uninstalled, the key value of nls_lang = Na is left. Enter Regedit to open the Registry HKEY_LOCAL_MACHINE/software/oracle. Locate nls_lang = Na on the right and delete it.

Otherwise the ORA-12705: cannot access NLS data files or invalid error is reported.

 

5. Install PL/SQL software (Procedure omitted)

6. Configure Oracle connection parameters for PL/SQL:

Select the connection in the tools/preferences (too/preference/) of PL/SQL, and set the Oracle main directory name (installation directory) and OCI library on the right.

Oracle main directory name: D: \ oracle_client \ instantclient_10_2

OCI Library: D: \ oracle_client \ instantclient_10_2 \ OCI. dll

7. the PL/SQL test is successful.

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.