Solved

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

Posted on 2006-06-13
6
283 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now