sql trace for debugging?

Has anybody ever used sql trace for debugging?
For example if I run a PL/SQL block and get a "no data found" error then
can I run the same pl/sql block with trace on this time to find which statement
the error is occuring at?
Thanks in advance.
Who is Participating?

Improve company productivity with a Business Account.Sign Up

slightwv (䄆 Netminder)Connect With a Mentor Commented:
I typically add my own debug statements for pl/sql code.

I've never used this but check out: DBMS_DEBUG
sivaprakasamConnect With a Mentor Commented:
I dont think so ... TKprof does show the parsing errors  but not the other exceptions. It's easy to handle the exceptions inside the pl/sql block ...
Devinder Singh VirdiConnect With a Mentor Lead Oracle DBA TeamCommented:
For debug use
set serveroutput on

and in your procedure use the following where needed.

Tracing is mainly used for other problems such as procedure runs slow and you  want to know where oracle has spend the time, execution plan etc. however you can take littlebit of idea that how many times particular query got executed, whether particular query ran or not (if not run then query will not be there).
But I would say, you can put your own comments for output to see where the problem is.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.