This discussion is archived
3 Replies Latest reply: Nov 28, 2012 6:12 AM by Jeff Smith SQLDev PM RSS

How to Debug Procedure

scottjhn Newbie
Currently Being Moderated
Oracle 11g R2.
OS:SUSE Linux 11.
SQL Developer 3.2.09.

I want to step over the procedure's codes, line by line, when the procedure is triggered by the front end.

For example:

JAVA: call = conn.prepareCall("? = call pkg_test.f_test(?, ?)}");

ORACLE: f_test

BEGIN
line1
line2
line3
...
...

END;

I did placed a break point on line one, but it never stopped there at runtime. I want it to stop at line1 then I can click on a step over icon to step over line by line at the runtime. How to do it?
  • 1. Re: How to Debug Procedure
    Marwim Expert
    Currently Being Moderated
    Hello,

    learned something new today
    http://sueharper.blogspot.de/2006/07/remote-debugging-with-sql-developer_13.html

    Regards
    Marcus

    Edited by: Marwim on 28.11.2012 17:39
    Removed first answer
  • 2. Re: How to Debug Procedure
    Jim Smith Expert
    Currently Being Moderated
    Look at the remote debugging section in the online help. (Although I don't think the help section makes it very clear.)

    Essentially you need to set up SQL Developer debugger to listen and then in the remote code you have to connect to the debugger using dbbms_debug_jdwp.connect_tcp('your sql developer workstation','debugger port'.

    If you can't modify the remote code to include a call to dbms_debug_jdwp, then I'm afraid there is nothing you can do.

    Edit to add:

    Also make sure you have compiled for debug and that your breakpoint is on an executable line (i.e. not a declaration)

    Edited by: Jim Smith on Nov 28, 2012 12:24 PM
  • 3. Re: How to Debug Procedure
    Jeff Smith SQLDev PM ACE Moderator
    Currently Being Moderated
    No need to modify the remote code, you can alternatively set an OS environment variable to accomplish the same

    ORA_DEBUG_JDWP=host=mypc:port= 1234

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points