PL/SQL Developer connects to the local Oracle 11g 64-bit database and shortcut key settings

Source: Internet
Author: User
Tags exit in

PL/SQL Developer connects to the local Oracle 11g 64-bit database and shortcut key settings
1. log on to PL/SQL Developer

The installation steps of Oracle Database and PL/SQL Developer are omitted here. Note that the PL/SQL Developer software should not be installed in the Program Files (x86) Directory during installation, otherwise, PL/SQL Developer cannot be started.

 

The strange reason is that the TNS of the database cannot be selected? I first install the database, and then install PL/SQL Developer. When PL/SQL Developer is installed, Oracle Home and OCI Libaray are identified. What about it? First, log on to PL/SQL Developer in non-login mode and set Oracle Home and OCI Libaray.

Oracle Home does not automatically identify the Oracle Home Directory. Therefore, you can manually specify the Oracle Home path.

Click "OK" to exit PL/SQL Developer and log on again.

You still cannot select the database TNS and try to log on without a database to see what error is reported.

Finally, the key point of the problem is found. The installed PL/SQL delelease can only recognize 32 oci. dll. It seems that we want to install a 64-bit PL/SQL delelease, So we search for the PL/SQL delelease 64-bit version on the Internet. However, PL/SQL delelease does not distinguish between 64-bit and 32-bit. It seems that we can only start with oci. dll. According to the error message above, it seems that you only need to install a 32-bit version of Oracle Client.

2. Install oracle Clinet

First, go to the Oracle official website to download an Oracle 11g Client, but you need to apply for an Oracle account before downloading.

Current: http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

This is a green version of the Oracle Client, so you only need to decompress it. Decompress the downloaded Oracle clientfile instantclient-basic-win32-11.2.0.1.0.zip to drive C (note! Can not be 64-bit ). Create the NETWORK \ ADMIN directory under the C: \ instantclient_11_2 directory after decompression, create the tnsnames. ora file under the ADMIN directory, and add the database TNS.

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = chiclewu-PC) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

(Note: The tnsnames. ora file can also be copied from the NETWORK \ ADMIN directory of the Oracle database HOME directory. Check whether the HOST configuration is correct. If the HOST is a HOST name, remove the domain name after the HOST name)

3. Configure Oracle Home and OCI Libaray for PL/SQL Developer

Enter PL/SQL Developer in non-Logon mode, specify the Oracle Home path as the Oracle Client directory (C: \ instantclient_11_2), and the OCI Libaray path as the oci in the Oracle Client directory. dll (C: \ instantclient_11_2 \ oci. dll ).

Click "OK". Now the configuration is complete. The following is the time to wait for a miracle. Exit PL/SQL Developer.

4. Verify the Oracle Client

Open the new PL/SQL Developer and enter the user name and password. Under the database option, you can view the TNS You Just configured.

 

Wait for the miracle moment ...........

After a few seconds of waiting, the miracle moment has finally arrived. you can log on, you can log on ........

Check whether data can be queried.

Data Query is complete.

Shortcut Key settings:

1. SQL plus Window: File-> New-> Command Window. This is similar to the SQL plus client tool of oracle, but it is much easier to use than it.

2. Set the Keyword to Uppercase automatically: Tools-> Preferences-> Editor, and select Uppercase for Keyword case. In this way, when an SQL statement is entered in the window, the keywords are automatically capitalized, while the others are all lowercase. In this way, it is easier to read the Code and maintain a good coding style. Similarly, in Tools> Preferences> Code Assistant (Assistant) you can set the code prompt Delay Time, the prompt when entering a few characters, the database object in upper case, lower case, the first letter in upper case;

3. view the execution plan: select the SQL statement to be analyzed, click the Explain plan button on the toolbar (that is, the execution plan), or press F5 directly. This is mainly used to analyze the SQL statement execution efficiency, the structure of the analysis table, which provides an intuitive basis for SQL optimization;

4. automatic replacement: enter an SQL statement quickly, for example, enter s, Press space, and replace it with SELECT. For example, enter sf, Press space, and replace it with SELECT * FROM, it is very convenient and saves a lot of time to write repeated SQL statements.

Setting Method: menu Tools> Preferences> Editor> AutoReplace (automatic replacement)> Edit

1. Create a shortcuts.txt file and write the following content:
S = SELECT
Copy the code and save it to the installation path of PL/SQL Developer ~ /Under the PlugIns directory
2) Tools-> Preferences-> User Interface-> Editor-> autoreplace, select the enableoption, select the created shortcuts.txt in the browser file, and click Apply.
3) Restart PL/SQL Developer and enter s + space and SC + space in the SQL window for testing.
Note: The shortcuts.txt cannot be deleted, or the shortcut key cannot be used.

Some rules are defined as reference below
I = INSERT
U = UPDATE
S = SELECT
F = FROM
W = WHERE
O = ORDER
D = DELETE
Df = DELETE FROM
Sf = SELECT * FROM
SC = SELECT COUNT (*) FROM
Sfu = SELECT * FROM FOR UPDATE
Cor = CREATE OR REPLACE
P = PROCEDURE
Fn = FUNCTION
T = TIGGER
V = VIEW
Sso = SET serveroutput ON;

Set the shortcut key (setting method: menu Tools> Preferences> User Interface> key configuration)
New SQL window: ctrl + shift + s
New command window: ctrl + shift + c
New Test window: ctrl + shift + t
PL/SQL Developer beautify: ctrl + shift + f
Redo: ctrl + shift + z
Undo: ctrl + z
Clear: ctrl + d (use with caution and cannot be recovered. I disabled O (strong _ strong) O ~)
Select All: ctrl +
Indent: tab
Unindent: shift + tab
Uppercase: ctrl + shift + x
Lower case: ctrl + shift + y
Note: ctrl + h
Uncomment: ctrl + m
Search: ctrl + f
Display table structure: ctrl + hover the mouse over the table name
Template list: shift + alt + r
Window list: ctrl + w

5. Execute a single SQL statement: Press F8

6. TNS Names: Choose Help> Support Info> TNS Names to view tnsnames. ora of Oracle;

7. debug the Stored Procedure
When PL/SQL Developer is used to operate Oracle, some stored procedures are sometimes called or debugged;
Method for calling a stored procedure:
1) First, select Procedures in the Browser on the left of PL/SQL Developer to find the stored procedure to be called;
2) then, select the debugging stored procedure, right-click and select Test. in the displayed Test scr release pt window, for parameters defined as in, enter a Value for this parameter. Click Start debugger or press F9;
3) Click RUN or Ctrl + R.

Debugging shortcuts
Switch breakpoint: ctrl + B
Start: f9
Run: ctrl + r
Single Step: ctrl + n
Skip one step: ctrl + o
Exit in one step: ctrl + t
Run to exception: ctrl + y

8. template shortcut

9. My Objects is automatically selected by default after logon.

By default, after PLSQL Developer logs on, All objects will be selected in Brower. If the user you log on to is dba, it will take several seconds to expand the tables directory, after selecting My Objects, the response speed is calculated in milliseconds.

Setting method:
Tools menu-> Brower Filters. The order window of Brower Folders is opened, and "My Objects" is set as the default.
Tools menu-> In Brower Folders, move the directories (for example, Tables Views Seq Functions Procedures) You frequently clicked to the top and add colors to differentiate them, in this way, the average table searching time will be greatly shortened. Try again.

Priority, from left to right
Tables-> Tablespaces-> Procedures-> Users-> Roles

 

Basic Design of PL/SQL programs for Oracle databases

 

PL/SQL Developer Practical Skills

 

Use PL/Scope to analyze PL/SQL code

 

Use the date type in PL/SQL

 

How to compile and run PL/SQL code snippets from a Case Study

 

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.