Two methods to connect Oracle to Oracle using PL/SQL without installing the Oracle client

Source: Internet
Author: User


Method 1: As you 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 ....... the following method was accidentally discovered yesterday: you only need to download a software named Instant Client Package in Oracle. This software does not need to be installed and can be used as long as it is decompressed, very convenient, even if the system is reinstalled, it can still be used. Official: 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 an ADMIN folder under the folder, and then create tnsnames. ora file with the following content: oracledata = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = yourhostIp) (PORT = 1521 ))) (CONNECT_DATA = (SERVICE_NAME = yourSID) configure it according to 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. The last problem is that you need to set a character set so that the queried data will not be garbled and write a batch of pldev. put bat 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 Oracle client installation-free connection to Oracle using PL/SQL, he has long used another better green version of the Oracle client, and does not need to be too complex configuration. I compared the methods in my article. The client size is about 30 mb. 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 of Oracle client download (provided by the bus flying friendship): Oracle client we also talk about which is useful !!! Note: you only need to copy the data to any directory, but the default directory is "C: \ ora90 ". If you need to change the default settings, You need to modify the default "oracle_home" in the "Oracle9i. reg" file and change the relevant 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. 1. Open cmd and enter netca. 2. Select Local net service name configuration → next. 3. Select Add> next. 4. enter the name of the oracle service on the server you want to connect to in [service name] → next step. 5. select tcp> next. 6. Enter the ip address of the server you want to connect to in host name. The port number remains unchanged → next step. 7. Select "test"> "Next. (You can also choose not to test) ※1 if the test fails, click Change logon and enter a user name and password that will certainly be logged on. → OK, [connecting... the test is successful.] The test is successful. ※2 if the test fails, click [previous] to confirm the [service name] and [host name] you wrote, make sure that the oracle listening service on the server you want to connect to is enabled. 8. Enter the local service name you want to use in [net service name] → next step. ※Sqlplus user/passwd @ local service name ]. 9. Select "no"> "Next. 10. The word "net service configuration completed" appears → next step. 11. Click Finish to complete the service configuration. 12. After the above service configuration is complete, enter the following command in cmd to remotely log on to the oracle server: sqlplus user_name/password @ the local service name must be remembered, the local service name above is the service name you wrote in step 1. <! -- EndFragment -->
Author: crystal2012

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.