1. We can debug using toad pl/sql developer tools. Debug option will be there in these tools. before debugging the package or anything enable the dbms_output option.
or
2. Using DBMS_DEBUG Package also we can debug the pl/sql code.
You can use variouse tools like Toad to debug PL/SQL package Other way is to implement your own debug technic like printing bms_output during the code execution (cons - you will get output only when package finished) You can create debug package with pragma autonomos_transaction to log all your steps. Also if you need to check/tune your package performance there is Oracle DBMS_PROFILER package. It was introduced in Oracle8i to allow developers to profile the run-time behaviour of PL/SQL code making it easier to identify performance bottlenecks which can then be investigated more closely.
The Best way to debug is by using an AUTONOMOUS TRANSACTION. Create a dummy table and insert into the table using the AT. This wont affect the main code but one could know which part of the code the execution has reached while the program is running itself.