Sunday, October 14, 2007

Oracle custom debug log package

When creating custom code which will run in a Oracle Database you like to include some debug information which you can use during development and which can be used during a debug session when you code is in production. When I write PL/SQL code I always try to include some debug steps which insert data into a table. Now I have developed a very simple procedure which you can call from your code. You can call this function by invoking the following code:

xx_rdbms_debug.calllog('debug information');

Currently this is all the package / procedure will do at version 1.0. However as I am intending to make this my default debug package I will include in upcoming versions more functionality which enables you for example to turn on or turn off logging and some other tracefile functionality.

However, at the moment of version 1.0 you can simply call the function and view the results in the xx_rdbms_debug_log table.

To enable you to use this package you have to create the table and compile the package spec and body file in your database. You can download them here:

Download table creation script.
Download SPC file.
Download BDY file.

No comments: