sql trace for debugging?

Posted on 2011-09-06
Last Modified: 2012-05-12
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.
Question by:subratoc
LVL 76

Accepted Solution

slightwv (䄆 Netminder) earned 400 total points
ID: 36492800
I typically add my own debug statements for pl/sql code.

I've never used this but check out: DBMS_DEBUG

Assisted Solution

sivaprakasam earned 50 total points
ID: 36499608
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 ...
LVL 15

Assisted Solution

by:Devinder Singh Virdi
Devinder Singh Virdi earned 50 total points
ID: 36503158
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.

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question