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
Solved

Oracle Forms 6.0 - How to see sql statements that Oracle sends on behalf of user

Posted on 2006-06-13
6
307 Views
Last Modified: 2010-04-17
Hi Experts,
How can I see the sql statement that Oracle forms automatically sends when the user is entering data. Is there any trigger or a built-in I can use?
If I can see those sql statements, it will help me find a problem where I believe Oracle is sending a malformed sql statement to the database.
0
Comment
Question by:uzairp
  • 3
  • 2
6 Comments
 
LVL 6

Accepted Solution

by:
JJSmith earned 250 total points
ID: 16899093

Get someone (DBA) to trace at the database end.

Use a join on v$sql and v$session

for example:

select SQL_TEXT from v$sql where HASH_VALUE in ( select SQL_HASH_VALUE from v$session );

this will return the last query executed for each current session; you can add more predicate is you want to filter by a particular scema/username for example:

DESC V$SQL
DESC V$SESSION


Cheers
JJ

0
 
LVL 3

Expert Comment

by:hardikbeit
ID: 16901693
U can also trace the queries by

select s.username,l.sql_text
from dba_users s, v$sql l
where s.user_id = l.parsing_user_id

this will give user name/sql query.. U can also add some more filters like owner/time..
0
 

Author Comment

by:uzairp
ID: 16903733
I tried both of the sql but I get so many rows returned. Could I possibly limit the output to last few rows?

Also do you know if there is any way to see the outgoing sql from the Form before it goes to the server? Thanks
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 6

Expert Comment

by:JJSmith
ID: 16906957


To reduce the number of rows simply add more 'filter' conditions: like a guess at the code:-

AND  UPPER(SQL_TEXT) LIKE '%FROM TABX%'


To monitor outgoing statements from your form to server is starting to get a bit 'networky' - please browse:

http://www.slac.stanford.edu/xorg/nmtf/nmtf-tools.html

you might find information on monitoring your forms client connection.

Cheers
JJ
0
 
LVL 3

Expert Comment

by:hardikbeit
ID: 16908790
Hi,
One more tool available like 'SQL Monitor' which gives SQL running by Form 6. I used this tool so many times and it is powerful tool to find out background queries which run through Oracle Forms.
0
 
LVL 6

Expert Comment

by:JJSmith
ID: 16909431

You can try SQL Monitor for free:


http://www.toadsoft.com/downld.html


Cheers
JJ
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
This is about my first experience with programming Arduino.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

861 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