How to connect PLSQL to Oracle

Source: Internet
Author: User

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?

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, create an admin folder under the folder, and create a tnsnames. ora file in the Admin directory. The content is as follows:
Orcl =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = 192.168.1.1) (Port = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl )
)
)
For example:
Lilo =
Extproc_connection_data =
According to your actual configuration, F: \ oracleclient is actually the path of the downloaded package.
Set nls_lang = simplified chinese_china.zhs16gbk
Plsqldev.exe
This character set refers to the server-side character set.
--
Set nls_lang = simplified chinese_china.zhs16cgb231280
Set nls_lang = simplified chinese_china.zhs16gbk
Set nls_lang = simplified chinese_china.utf8


# Tnsnames. ora network configuration file: C: \ oracle \ ora90 \ Network \ admin \ tnsnames. ora

# Generated by Oracle configuration tools.


(Description =

(Address_list =

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

)

(CONNECT_DATA =

(SERVICE_NAME = sname)

)

)


(Description =

(Address_list =

(Address = (Protocol = IPC) (Key = extproc0 ))

)

(CONNECT_DATA =

(SID = plsextproc)

(Presentation = Ro)

)

)

 

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 = F: \ oracleclient \ OCI. dll, ORACLE_HOME = F: \ oracleclient.

The configuration is basically complete, and a bat batch is done to solve the character set garbled:

Write a batch of PLSQL. BAT and place it in the installation directory of plsqldeveloper. The content is as follows:

Permanent character set:

Set nls_lang = simplified chinese_china.zhs16cgb231280

Set nls_lang = simplified chinese_china.zhs16gbk
Set nls_lang = simplified chinese_china.utf8

Note:

Instantclient-basic-win32-11.1.0.6.0.zip-this is a version that supports Oracle 9i and above (excluding Oracle9i)

Instantclient-basic-win32-10.2.0.1.zip-This supports Oracle8i and Oracle9i.

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.