Q
Problem solve Get help with specific problems with your technologies, process and projects.

Finding SQL queries used in JSP and EJB

How I can find the SQL queries used in our JSP and EJB to retrieve data from the Oracle 8i Database?

One of the easiest ways to find the SQL statements is to turn on SQL tracing. This can be done with the following statement:

ALTER SESSION SET sql_trace=TRUE;
You can have your JSP code issue this statement. Or, you can write an AFTER LOGON trigger to issue it for you.

With this turned on, you will generate many trace files in the directory specified with the USER_DUMP_DEST parameter. These trace files contain your SQL statements.

Another method is to look in V$SQL for SQL statements. But all SQL statements currently in the Shared Pool will be there, no matter who issued them. You'll have to join V$SQL to V$SESSION to determine who issued the queries. Keep in mind that this may not find all queries issued by your application code since some SQL statements may be aged out of the Shared Pool.

For More Information


Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close