‎2008 Feb 17 5:32 PM
I am using an Open SQL statement to query the Oracle database that supports
our R3 system. The query runs very slow, and I would be interested in seeing
the actual query that is executed on the database ( the one that the database
utility creates).
Is there a way of doing this?
‎2008 Feb 17 7:18 PM
Sure.
Go to ST05.
There you can either do the following:
ACTIVATE the trace;
RUN your report'
DEACTIVATE the trace;
then DISPLAY trace....
Other option that is easier:
Click on ENTER SQL STATEMENT.
There you can cut and paste the statement as shown on SM50 (while running your report, you should go to SM50 and see the workprocess you are using, It should show something like SEQUENTIAL READ... etc). Double click on the work process and you should have a screen with more details, there you will see the SQL statement (the arguments are different than in code).
Copy it all and past on the ENTER SQL STATEMENT.
Run and you will get a result showing which indexes used, etc.
Leonardo De Araujo
‎2008 Feb 17 7:14 PM
‎2008 Feb 17 7:18 PM
Sure.
Go to ST05.
There you can either do the following:
ACTIVATE the trace;
RUN your report'
DEACTIVATE the trace;
then DISPLAY trace....
Other option that is easier:
Click on ENTER SQL STATEMENT.
There you can cut and paste the statement as shown on SM50 (while running your report, you should go to SM50 and see the workprocess you are using, It should show something like SEQUENTIAL READ... etc). Double click on the work process and you should have a screen with more details, there you will see the SQL statement (the arguments are different than in code).
Copy it all and past on the ENTER SQL STATEMENT.
Run and you will get a result showing which indexes used, etc.
Leonardo De Araujo
‎2008 Mar 13 9:06 AM
You can use also ST04 for that. It shows the ORACLE database sessions (If you don't know the Oaracle session that belongs to the work process you have the "Client PID" column in ST04 wich is the "PID" in the SM50 monitor.
Open ST04:
Look for Status ACTIVE .
Under SQL Statement you see the plain statement text
doubleclick the line
You get the statement dialog
Click Execution plan button (the tool button)
You get the execution plan where you can click the tables or indexes for further information