Debug.f for debugging PL/SQL application

About

It's a package designed to allow you to add logging or trace statements to a PL/SQL application.

Example

CREATE PROCEDURE p ( p_owner IN VARCHAR2, p_object_name IN VARCHAR2)
AS
    l_status NUMBER := 0 ;
BEGIN
    Debug.f ('Entering procedure, inputs "%s", "%s" )
    .... some code ....
    Debug.f ('Normal EXIT, status = %d', l_status );
end;

If the debug package where told to generate a trace file via a call to debug.init, you will have this :

12062002 213953(P.PROCEDURE  5) Enter procedure inputs "A", "B"
12062002 213955(P.PROCEDURE 56) Normal exit, status = 0

Where :

  • 12062002 is the date MMDDYYYY format
  • 213953 is the time HH24MISS format

How to install it

      CREATE USER utility identified BY utility;
      grant CREATE session, CREATE PROCEDURE, CREATE TABLE, CREATE TRIGGER TO utility;
      ALTER USER utility DEFAULT tablespace users quota unlimited ON users;
  • run install_debug in that schema
  • create a public synonym for debug

Reference

  • Bookmark "Debug.f for debugging PL/SQL application" at del.icio.us
  • Bookmark "Debug.f for debugging PL/SQL application" at Digg
  • Bookmark "Debug.f for debugging PL/SQL application" at Ask
  • Bookmark "Debug.f for debugging PL/SQL application" at Google
  • Bookmark "Debug.f for debugging PL/SQL application" at StumbleUpon
  • Bookmark "Debug.f for debugging PL/SQL application" at Technorati
  • Bookmark "Debug.f for debugging PL/SQL application" at Live Bookmarks
  • Bookmark "Debug.f for debugging PL/SQL application" at Yahoo! Myweb
  • Bookmark "Debug.f for debugging PL/SQL application" at Facebook
  • Bookmark "Debug.f for debugging PL/SQL application" at Yahoo! Bookmarks
  • Bookmark "Debug.f for debugging PL/SQL application" at Twitter
  • Bookmark "Debug.f for debugging PL/SQL application" at myAOL
 
database/oracle/debugf.txt · Last modified: 2009/03/16 13:29 by gerardnico