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

Source: Internet
Author: User

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

Want to connect to the Oracle database? Install the client. OH ~ NO !, A few hundred megabytes are missing. Now you only need to download a software named Instant Client Package from Oracle. You only need to decompress the Package and use it, and the size is more than 30 MB, which is very convenient, even if the system is reinstalled, it can still be used.

1. Take 11.2.0.3.0 version as an example, download Basic software package (to support Chinese can only download Basic software package),: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

2. decompress the downloaded package to D: \ instantclient_10_2 \ or any directory. The path below prevails;

3. Set environment variables:

NLS_lANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK

TNS_ADMIN= D:\instantclient_10_2\

Path=D:\instantclient_10_2\;%Path%

Note:

  • NLS_LANG: Chinese characters may be garbled during database access. The setting of NLS_lANG is very important. If it is not configured, the following warning will pop up during PL/SQL login:
  • TNS_ADMIN: If not set, tnsnames. ora is addressed to the NETWORK \ ADMIN directory under the Instant Client Directory by default. If the file Oracle is not found, an ORA-12154 error is reported, as shown in:
  • Path: This has been tried, and it has no effect if it is not set;

4. Compile tnsnames. ora according to the following content and save it to the installation directory: D: \ instantclient_10_2:

ORCL =  (DESCRIPTION =    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.110)(PORT = 1555))    (CONNECT_DATA =      (SERVER = DEDICATED)      (SERVICE_NAME = ORCL)    )  )

You can configure the preceding settings based on your actual situation.

5. Open PL/SQL and set OCI Library and Oracle_home in perference. My settings are OCI Library = D: \ instantclient_10_2 \ oci. dll, Oracle_home = D: \ instantclient_10_2. re-open PL/SQL to log on. Congratulations!

 

-------------------------------------- Split line --------------------------------------

Rlwrap

SQLPLUS spool to dynamic Log File Name

Oracle SQLPLUS prompt settings

Accelerate SQL return by setting SQLPLUS ARRAYSIZE (row prefetch)

PL/SQL Developer Practical Skills

-------------------------------------- Split line --------------------------------------

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.