Method 1:
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)
the configuration is 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 then enter the account and password.
Method 2:
A few days ago, I sent an article about using PL/SQL to connect to Oracle without installing the Oracle client. He told me that he had already used another better green version of Oracle client, and no complicated configurations are required.
I compared myArticleThe client is relatively large, about 30 m. The settings are complex, but they should be stable. The bag provided by the bus flying is a little more than 3 m. It should be made by a senior man after being extracted for 10 m.
Green version Oracle client download (provided by bus flying friendship): Oracle client
Let's talk about which one is useful !!!
Note:
During use, you only need to copy to any directory, but the default directory is "C: \ ora90 ".
To change the default settings, modify the default "ORACLE_HOME" in the file "Oracle9i. Reg"
Change the related paths to the actual oracle path.
This green installation method is also suitable when the operating system is re-installed. If your Oracle is installed on a non-system disk, you can use the obsolete installation directory and use the modified "Oracle9i. reg. Very convenient. I have already tried it.