Home » SQL & PL/SQL » SQL & PL/SQL » execution time
execution time [message #628042] Wed, 19 November 2014 08:50 Go to next message
nisjess
Messages: 4
Registered: November 2014
Junior Member
Hi I m a newbie..
Can anybody tell how to record the execution time for every query in a SQL Script through a select statement?
Thanks
Re: execution time [message #628043 is a reply to message #628042] Wed, 19 November 2014 08:53 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum.

Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/ and read http://www.orafaq.com/forum/t/174502/

ALTER SESSION SET SQL_TRACE=TRUE;
execution time [message #628044 is a reply to message #628042] Wed, 19 November 2014 08:54 Go to previous messageGo to next message
nisjess
Messages: 4
Registered: November 2014
Junior Member
Hi I m a newbie..
Can anybody tell how to record the execution time for every query in a SQL Script through a select statement?
Thanks
Re: execution time [message #628046 is a reply to message #628044] Wed, 19 November 2014 09:10 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
What's the point in repeating yourself? Did you consider reading Blackswan's suggestion?

For single query you could do "set time on timing on" in SQL*Plus. In PL/SQL, you could nuse dbms_utility.get_time for each operation. And use dbms_output to display the time elapsed.

Another way is to query v$sql to get elapsed_time for the individual SQLs.
Re: execution time [message #628455 is a reply to message #628046] Tue, 25 November 2014 07:46 Go to previous messageGo to next message
nisjess
Messages: 4
Registered: November 2014
Junior Member
Well Thanks for the answer I tried both ..And now I need to number the SQL query from 0 and record the time for every statement!
Re: execution time [message #628457 is a reply to message #628455] Tue, 25 November 2014 08:10 Go to previous messageGo to next message
Andrey_R
Messages: 441
Registered: January 2012
Location: Israel
Senior Member
How about some examples, a proper explanation, some well formulated questions Confused ?
Re: execution time [message #628459 is a reply to message #628455] Tue, 25 November 2014 08:19 Go to previous message
Michel Cadot
Messages: 68643
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

And if you followed BlackSwan's suggestion you have them.

Previous Topic: Quering Access DB.Table
Next Topic: materialized view on prebuilt table - refresh
Goto Forum:
  


Current Time: Tue Apr 23 18:22:25 CDT 2024