Hi all,
How to get Execution Plan for a SQL in SQL*Plus prompt?
Thanks,
6 3370
In the ...\oracle\product\10.2.0\db_1\RDBMS\ADMIN folder (or in other location depending on orcl version) u get a fie
UTLXPLAN.SQL
first run the script to create the plan table
then
SQL>SET AUTOTRACE ON
aftr that try with any qeury
it will show the execution plan of the query..
Hope it works fine for u
Thanks alot its working
In the ...\oracle\product\10.2.0\db_1\RDBMS\ADMIN folder (or in other location depending on orcl version) u get a fie
UTLXPLAN.SQL
first run the script to create the plan table
then
SQL>SET AUTOTRACE ON
aftr that try with any qeury
it will show the execution plan of the query..
Hope it works fine for u
You are always welcome.
Feel free to put your doubts/queries in the forum.
But first give a try from your side before posting in forum.
And if possible mention what/how u have tried to solve the problem .
Then it will be helpful for the Experts in the forum in understanding/solving your problem
Best of Luck..
In the ...\oracle\product\10.2.0\db_1\RDBMS\ADMIN folder (or in other location depending on orcl version) u get a fie
UTLXPLAN.SQL
first run the script to create the plan table
then
SQL>SET AUTOTRACE ON
aftr that try with any qeury
it will show the execution plan of the query..
Hope it works fine for u
Hi debasis,
Suppose I have a procedure which contains several select into statements. How can I see the explain plan for these individual select into statements when I execute the procedure? I don't seem to have proper rights to view the TRACE, but for individual sql statements, I find out the explain plan by seeing the plan_table, but for select statements executed inside a procedure, what should be my approach?
please follow these following steps.
1.start an user section.
2.connect to sys account.
3.run the following query -
SELECT SID,SERIAL#,STATUS,NVL(USERNAME,'ORACLE')AS USERNAME,OSUSER,MACHINE,PROGRAM,ROUND(LAST_CALL_ET/60,2) LAST_CALL,TO_CHAR(LOGON_TIME,'DD-MON-YY HH24:MI') AS LOGON_TIME FROM sys.V_$SESSION
-
4.it returns SID AND SERIAL# of the first user.
5.then run this -
exec dbms_system.set_sql_trace_in_session(sid,serial#,true);
-
6.now run the package containing some select into statments.
7.then run this -
exec dbms_system.set_sql_trace_in_session(sid,serial#,false);
-
8.it creates a trace file(.trc) in UDUMP folder(location deponds on the version of oracle you are using.)
9.Then use the utility tool TKPROF to generate the report.
please follow these following steps.
1.start an user section.
2.connect to sys account.
3.run the following query -
SELECT SID,SERIAL#,STATUS,NVL(USERNAME,'ORACLE')AS USERNAME,OSUSER,MACHINE,PROGRAM,ROUND(LAST_CALL_ET/60,2) LAST_CALL,TO_CHAR(LOGON_TIME,'DD-MON-YY HH24:MI') AS LOGON_TIME FROM sys.V_$SESSION
-
4.it returns SID AND SERIAL# of the first user.
5.then run this -
exec dbms_system.set_sql_trace_in_session(sid,serial#,true);
-
6.now run the package containing some select into statments.
7.then run this -
exec dbms_system.set_sql_trace_in_session(sid,serial#,false);
-
8.it creates a trace file(.trc) in UDUMP folder(location deponds on the version of oracle you are using.)
9.Then use the utility tool TKPROF to generate the report.
I don't have these privileges, actually. That's what I meant by saying "I don't seem to have proper rights to view the TRACE". Are there any other way-outs? For example, in Sybase you can do so, by pasting a pl/sql block and then running the explain plan for the whole block
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Vinny |
last post by:
Can anyone help me with this strange problem please?
I have a stored procedure, with a parameter defined as a
uniqueidentifier. The procedure does a select with a number of joins,
and filters...
|
by: Will Atkinson |
last post by:
Hi All,
I'm a relative newbie to SQL Server, so please forgive me if this is a
daft question...
When I set "Show Execution Plan" on in Query Analyzer, and execute a
(fairly complex) sproc, I...
|
by: Marie |
last post by:
Hi,
I´m trying to perform Fourier Transforms on contiuously incoming
images from a camera.
I have sofar been using the Basic Interface for planning and execution
for every image. Later I have...
|
by: Jenny Zhang |
last post by:
Hi,
I am running OSDL-DBT3 test against PostgreSQL. I found performance
difference between the runs even though the data and queries are the
same. I tried to study this problem by getting...
|
by: Jenny Zhang |
last post by:
The osdl-dbt3 test starts with building and vacuuming the database.
The execution plans were taken after the vacuuming.
I did two tests with the same database parameters:
1. run two osdl-dbt3...
|
by: Ina Schmitz |
last post by:
Hi NG,
does IBM Universal Database 8.2 make any difference between actual and
estimated execution plans like in SQL Server ("set showplan_all on" for
estimated execution plan and "set statistics...
|
by: TheRealPawn |
last post by:
I'm trying to get the execution plan for a single stored procedure
from Profiler. Now, I've isolated the procedure but I get all
execution plans. Any ideas on how to connect the SPIDs so that I...
|
by: Ronald S. Cook |
last post by:
I've always been taught that stored procedures are better than writing SQL
in client code for a number of reasons:
- runs faster as is compiled and lives on the database server
- is the more...
|
by: sqlgirl |
last post by:
Hi,
We are trying to solve a real puzzle. We have a stored procedure that
exhibits *drastically* different execution times depending on how its
executed.
When run from QA, it can take as...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |