Connecting PL/SQL to oracle database and plsqloracle Database

Source: Internet
Author: User

Connecting PL/SQL to oracle database and plsqloracle Database
Connecting PL/SQL to oracle database 1. Introduction

Use pl/SQL to connect to a remote oracle database without installing the oracle database.


2. steps:

A) install PL/SQL and the oracle client based on your operating system (it has nothing to do with the version of the oracle database ).

B) set the connection information for connecting to the remote oracle database, three methods (mainly in tnsnames. add the remote database connection information to the ora file. The following three methods are used to append the content at the end of the file based on the connection information of my own database, which is for reference only:

I. After the oracle client is installed, a dialog box is displayed. Do you want to set the tnsnames. ora file? Click "yes", add connection information, and append at the end of the file:

Ii. the directory installed on the Client is in the D: \ Program Files file. After installing the Client, find tnsnames in the address D: \ Program Files \ Instant Client \ network \ admin. open the ora file and append it at the end of the file:

Iii. You can also log on to PL/SQL (without an account) and click help --> Support Info --> TNS Names to append at the end:


3. Add content

Here we take my own connection information as an example -- remote database information:

<Url> jdbc: oracle: thin: @ 10.45.35.67: 1521: orcl67 </url>
<! -- Database account -->
<User> chy_user </user>
<! -- Database Password -->
<Passwd> chy_pwd </passwd>

We can see the database information from the above:

Instance name: orcl67

Machine IP Address: 10.45.35.67: 1521

Account number: chy_user

Password: chy_pwd

Append content:

orcl67 =  (DESCRIPTION =    (ADDRESS_LIST =      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.45.35.67)(PORT = 1521))    )    (CONNECT_DATA =      (SERVER = DEDICATED)      (SERVICE_NAME = orcl67)

Next, enter the user name and password and log on.


4. Summary

Things are simple, but you still don't know what to do.


How to connect to oracle database with pl SQL limit 10

Use PL/SQL Developer to connect to OracleX64:
• 1. Download the 32-bit Oracle InstantClient and expand it to a directory, such as C: \ instantclient-basic-nt-11.2.0.2.0;
• 2. Copy the system tnsnames. ora to this directory;
• 3. Set Oracle_Home and OCI Library in PLSQL Developer:
Tools configure Preferences configure Oracle connector Connection:
Oracle_Home: C :\ instantclient-basic-nt-11.2.0.2.0
OCI Library: C :\instantclient-basic-nt-11.2.0.2.0 \ oci. dll
• 4. Edit the following bat file in the PLSQL Developer directory, replace the shortcut, and start PLSQL Developer:
@ Echo off
Set path = C: \ instantclient-basic-nt-11.2.0.2.0
Set ORACLE_HOME = C: \ instantclient-basic-nt-11.2.0.2.0
Set TNS_ADMIN = C: \ instantclient-basic-nt-11.2.0.2.0
Set NLS_LANG = AMERICAN_AMERICA.ZHS16GBK
Start plsqldev.exe

How to configure pl/SQL to connect to the local oracle database?

-- Log on to ORACLE using the SYSTEM account and run the following command to create a tablespace and a user:
-- Create a tablespace and modify the space size as needed. Note that the absolute path must be set for the path.
Create tablespace ts1 DATAFILE 'C: \ oracle \ oradata \ ora \ ts1.dbf' SIZE 20 M;

-- Create a user
Create user test identified by test default tablespace ts1 temporary tablespace temp;
-- Grant Permissions
Grant connect to test;
Grant dba to test;
GRANT resource TO test;
Open pl/SQL and click "CREATE" and select "SQL test, then copy the above content and create it. Then you can find the icon with a small key on it and click it to enter the user name and password to log on.

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.