Configuring PL/SQL Developer to connect to an Oracle database

Source: Internet
Author: User

Get ready:

    • PL/SQL Developer: I'm using plsqldev1005 (32-bit)
    • Win32_11gr2_client: Remember that it must be 32-bit, because PL/SQL developer only recognize 32-bit

After the installation is successful, you need to configure the environment variables:

Tns_admin environment variable, similar to: C:\app\Lzj\product\11.2.0\client_1\network\admin. This variable is actually the basis for PL/SQL developer looking for Tnsnames.ora. With this environment variable, PL/SQL Developer startup will automatically discover the connection configuration.

Nls_lang environment variable, the value is: Simplified Chinese_china. ZHS16GBK. This value is consistent with the Oracle server configuration, and the Oracle server defaults to: Simplified Chinese_china. ZHS16GBK.

Path environment variable that will be the home directory of the Oracle client. Similar to: C:\app\Lzj\product\11.2.0\client_1, enter the end of path.

1. Configuring PL/SQL Developer

At startup, the login option is canceled to enter the main interface.

Select the menu: Tools/Preferences/connections, see below screen.

Main settings: Oracle home directory name, OCI Library

Oracle Home Directory Name: is the home directory of the installed Oracle client. Similar to: C:\app\Lzj\product\11.2.0\client_1, I'm here to customize the directory when I install the client

OCI Library: Oracle client's home directory under the Ock.dll file. Similar to: C:\app\Lzj\product\11.2.0\client_1\oci.dll

Here, there is a problem, you clearly set up, but the next time you start, found that the two configurations are gone.

What I don't understand is that after the Oracle client installation succeeds, two configurations are not automatically discovered. After all, not manual filling is automatic discovery.

You need to configure three environment variables, if configured, without configuration:

Tns_admin environment variable, similar to: C:\app\Lzj\product\11.2.0\client_1\network\admin. This variable is actually the basis for PL/SQL developer looking for Tnsnames.ora. With this environment variable, PL/SQL Developer startup will automatically discover the connection configuration.

Nls_lang environment variable, the value is: Simplified Chinese_china. ZHS16GBK. This value is consistent with the Oracle server configuration, and the Oracle server defaults to: Simplified Chinese_china. ZHS16GBK.

Path environment variable that will be the home directory of the Oracle client. Similar to: C:\app\Lzj\product\11.2.0\client_1, enter the end of path.

Also be aware that:

After the Oracle client installation succeeds, the value in the registry table.

Hkey_local_machine\software\oracle\key_oraclient11g_home1, Bottom oracle_home, value: E:\instantclient_11_2\. This is my custom quota system for connecting to the Oracle client path. If the Oracle client is installed by default, it is similar to: C:\app\Lzj\product\11.2.0\client_1. This is the Oracle client home directory. There may be no key_oraclient11g_home1, this is the Oracle database installed on this machine, and if not, only the Oracle Client is installed.

2. Edit the Tnsnames.ora file

Here to illustrate is the location of the Tnsnames.ora, Online said inconsistent. Mainly depends on the tns_admin environment variable. Here I configure: E:\instantclient_11_2\network\admin.

In the same path where the Tnsnames.ora file is located, you also need to: Listener.ora, Sqlnet.ora files.

I have listed the three files automatically generated by Oracle server in the following sections:

Listener.ora

# Listener.ora Network Configuration file:e:\instantclient_11_2\network\admin\listener.ora# Generated by Oracle Configuration tools. LISTENER =  (description_list = (    DESCRIPTION = (      address = (PROTOCOL = IPC) (KEY = EXTPROC1521))      (address = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521))))  Adr_base_listener = E:\app

Sqlnet.ora

# Sqlnet.ora Network Configuration file:e:\instantclient_11_2\network\admin\sqlnet.ora# Generated by Oracle Configuration tools. Sqlnet. Authentication_services= (NTS) NAMES. Directory_path= (TNSNames, Ezconnect)

Tnsnames.ora

# Tnsnames.ora Network Configuration file:e:\instantclient_11_2\network\admin\tnsnames.ora# Generated by Oracle Configuration tools. LISTENER_ORCL = (  address = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) ORCL =  (DESCRIPTION = (    address = (P Rotocol = TCP) (HOST = localhost) (PORT = 1521))    (Connect_data =      (SERVER = dedicated)      (service_name = ORCL) 
   
    )  )  
   

You can add your own configuration at the end of the Tnsnames.ora file

XXXXX = (DESCRIPTION = (    ADDRESS = (PROTOCOL = TCP) (HOST =xxxxx) (PORT = 1521))    (Connect_data =    (SID = ORCL) 
    (SERVER = dedicated)    )  )

Here is a misunderstanding is if your connection name (that is the first line above the xxxxx), the front can not have any characters, space is not.

Otherwise PL/SQL developer Log on: Ora-12154:tns: Unable to resolve the specified connection identifier

Configuring PL/SQL Developer to connect to an Oracle database

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.