donderdag 2 december 2010

SQL Developer Debugging

Very Handy.

Debugging procedures in SQL Developer:

PRIVILEGES
grant privileges for debug
- Execute and Debug (for the required procedure
- DEBUG CONNECT SESSION

( DEBUG ANY PROCEDURE gives you rights to debug any procedure you may execute and has been compiled for debug)


DEBUG
- Preparing code for debugging. Set breakpoints and Compile for debug (code has green bug)
- After debugging, compile code again. This removes compiler directives. Otherwise it could harm you performance of the PL-SQL procedure

- Code that is compiled for debug can now be debugged. DEBUG button.
sqldeveloper sets sessions to debug session.


REMOTE DEBUG
Sometimes a client application (sqlplus) calls a PLSQL procedure. A problem can appear when a procedure is called, so you need to debug in place. This is called REMOTE DEBUGGING


in SQL Developer select connection and select REMOTE DEBUG. It wil open a listener that waits for connection from the db server
Now we are ready for debugging
- On the client application we run EXEC DBMS_DEBUG.CONNECT('ipnr',4000) and then run the plsql procedure
Control is now passed back to SQLDeveloper and we can debug.

Geen opmerkingen:

Een reactie posten