PL/SQL Dev debug Oracle stored procedures, triggers, and functions

Source: Internet
Author: User


The following describes how to debug a function. Other debugging operations are the same.
1. Generally, there are two places to debug the program in pl/SQL Dev: 1). New-> test window: www.2cto.com

2) Right-click the program to be debugged and choose test.

2. debugging process 1). Enter the testing window through the debugging position, for example:

Click position 1 (or press F9) to enter the debugger. Position 2 shows the input and output parameters declared by the program. If the parameter is input, enter the corresponding input values here, the output parameters are displayed after debugging. 2) Press F9 to enter the start modulation ,:

Among them: 1 ---- interrupt debugging, 2 ---- single-step debugging. The simple point is to execute the program step by step. The green arrow indicates that all programs have been run. If there is a breakpoint setting, you can also jump to the next breakpoint. 3) Click single-step debugging to enter the function,

Here, you can try single-step debugging and run the program step by step 4 ). set the breakpoint. www.2cto.com left-click the border on the far left of the text area. If a line number is displayed, that is, the position of the line number,

Click the Green Arrow to directly run to the Set breakpoint. 5) Monitor the variables,

The position 1 is the monitoring window. This window displays the variables you want to monitor. You can copy the variables you want to monitor to this window, you can also right-click the variable and choose add variable to monitor (Location 2 ). Continue the single-step execution. You can see the changes in the value of the monitoring variable (location 3. 3. Permission issues (ORA-0131) 1) When debugging a program, the error is ORA-0131: Insufficient privileges,

The reason is that the user permission is insufficient because the debug connect session system permission is missing. 2) solution: log on to the database as a SYS user and perform the authorization operation: 1 SQL> grant DEBUG CONNECT SESSION to user_name; note: 1. some netizens pointed out that the debug any procedure permission should also be granted. After testing, this permission does not need to be granted! 2. you can view the permission information from the session_privs table in the data dictionary (You need to log on with user_name): 1 SQL> conn scott/tiger; 2 SQL> select * from session_privs; 3 PRIVILEGE limit 4 limit 5 create session 6 unlimited tablespace 7 create table 8 create cluster 9 CREATE SEQUENCE10 CREATE PROCEDURE11 CREATE TRIGGER12 CREATE TYPE13 CREATE OPERATOR14 CREATE INDEXTYPE15 debug connect SESSION16 debug any PROCEDURE17 12 rows selected author snowmice

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.