Use PL/SQL to connect to Oracle without installing the Oracle client

Source: Internet
Author: User

Original article: http://www.bootad.cn/post/185.html

 

As we all know, to connect to Oracle using PL/SQL, you need to install the Oracle client software. Have you ever wondered whether to directly connect to Oracle without installing the Oracle client?

In fact, I always wanted to do this, because this client is so annoying !!! Not only will JDK be installed, but it will also put itself at the beginning of the environment variable, which will cause a lot of trouble.

In fact, I have asked many people before, but they all said that the Oracle client must be installed... until yesterday, the following methods were accidentally discovered:

You only need to download a software named Instant Client package in Oracle. This software does not need to be installed. You only need to decompress the package and can use it easily, even if the system is reinstalled, it can still be used.

: Http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/winsoft.html

Download the Instant Client package-Basic Package. Decompress the package to any directory, create a network folder under the directory, and create the admin folder under the folder, and then create the tnsnames. ora file. The content is as follows:

Oracledata =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = yourhostip) (Port = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = yoursid)
)
)
Here, you can configure it based on your actual situation. Then open PL/SQL and set OCI library and ORACLE_HOME in perference. My settings are OCI library = c: \ oracleclient \ OCI. dll, ORACLE_HOME = c: \ oracleclient.

According to your actual configuration, it is actually the path of the downloaded package. Another problem is that you need to set a character set so that the queried data will not be garbled. Write a batch of pldev. BAT and put it in the PL installation directory. The content is as follows:

Set nls_lang = simplified chinese_china.zhs16gbk
Plsqldev.exe

This character set refers to the server-side character set. Please configure it according to the actual situation.

Finally, you only need to double-click the batch processing and enter the account and password !! Try it !!! My experiment succeeded !!!

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.