Oracle Developer Tools for Visual Studio .NET
10g Release 2 (

PL/SQL Debugging Setup

In order to debug a PL/SQL program in an Oracle Database, you must first do the following:

This section includes the following topics:

Requirements and Debug Privileges for Databases

Databases must meet the following requirements:

  • The database must be an Oracle database release 9.2 or later.

  • The debug privileges are set appropriately for the specific database release, as follows:

    • Requirements for Oracle Database 10g Release 1 (10.1) and later:

      • The connected user must have the DEBUG CONNECT SESSION privilege to connect to a debugger, for example, GRANT DEBUG CONNECT SESSION TO HR.

      • The connected user must have the DEBUG ANY PROCEDURE privilege to debug any PL/SQL program or have DEBUG and EXECUTE privileges on the PL/SQL program being debugged, for example, GRANT DEBUG ANY PROCEDURE TO HR.

    • Requirements for Oracle9i Release 2 (9.2):

      • The connected user must have the DEBUG ANY PROCEDURE privilege.

    See Also

    Oracle Database Application Developer's Guide - Fundamentals, Chapter 7, Debugging Stored Procedures

How to Compile a PL/SQL Program for Debugging

You can compile a PL/SQL program so that it does or does not provide debug information in the results. Oracle PL/SQL Debugger cannot debug programs without this debug information.

Compiling a PL/SQL Program with Debug Information

There are two compile commands: Compile and Compile Debug. Both commands compile the PL/SQL program in the database, except that the Compile Debug command provides debug information in its compilation.


If the Compile Debug command is executed, but the user does not have the proper debug privileges, then compile will fail and the program cannot be debugged.

To compile a PL/SQL program, do one of the following:

  • From the Oracle Explorer, expand the node that contains the program being compiled, right-click on that program, and from the menu, select Compile or Compile Debug.

  • From a program source window, right-click, and from the menu, select Compile or Compile Debug.


Oracle Developer Tools only compiles the top-level PL/SQL program.


You cannot compile during debugging. Some menus are disabled (greyed out) to reflects this.

See Also

About Oracle Explorer

Viewing Compile Debug Property Information

There are several way that you can view property information for the Compile Debug option to verify whether a program has been compiled with or without debug information. This is typically needed when debugging has been completed, and it is necessary to recompile normally any unit that was previously compiled with debug information.

Oracle Explorer uses distinct debug icons to indicate at a glance whether or not the program is compiled with debug information.

For example, to view the icons, expand the Procedures node from the Oracle Explorer. The icons appear before the names of the node. Any program unit that been compiled for debug is identified by a distinct icon.

To view the Compile Debug Option property, expand the Procedures node from the Oracle Explorer, right-click on the PL/SQL program, and from the menu, select Properties. The Properties list appears.