Solved

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

Posted on 2006-06-13
6
302 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
A short article about a problem I had getting the GPS LocationListener working.
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

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