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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 77

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 …

726 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