A very good instruction on the programmatic interface to Orace’s PL/SQL debug facilities. If you do not happen to have a GUI PL/SQL debugger – such as in JDeveloper or PL/SQL Developer or TOAD – or you are planning on building your own, you will find this article most useful: Debugging PL/SQL with DBMS_DEBUG. It takes you on a step by step development of a package that provides an easy interface, based on DBMS_DEBUG, for doing debugging. Note: this allows for example to run PL/SQL in one SQL*PLus session while debugging in a second SQL*Plus session.
How to debug stored procedure in pl/sql.