Link to home
Create AccountLog in
Avatar of nQuote
nQuoteFlag for United States of America

asked on

Finding out how long a query will take

Is there any way to do that in Oracle? In TOAD? Any way to get ballpark numbers?
Avatar of DataCruncher
DataCruncher
Flag of Canada image

As mentioned at the following URL: http://www.dba-oracle.com/t_measure_sql_response_time.htm

you can do that from SQL*PLUS:

SQL> set timing on;
SQL> select stuff from mytab;
Also, from PL/SQL I guess you could do something like:

DECLARE
  TIMESTART TIMESTAMP;
  TIMESTOP TIMESTAMP;
BEGIN
  TIMESTART := systimestamp;

  -- Process things here
  
  TIMESTOP := systimestamp;
  DBMS_OUTPUT.PUT_LINE('Time elapsed : ' || (TIMESTOP - TIMESTART));
END;
/

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of nQuote

ASKER

Yes, sdstuber, that's what I was looking for. I guess there isn't a way. Thanks anyway.
Avatar of nQuote

ASKER

I've requested that this question be closed as follows:

Accepted answer: 0 points for soccerplayer's comment http:/Q_27426391.html#37066894

for the following reason:

There is really no solution to this
Avatar of Sean Stuber
Sean Stuber

"you can't do that"  is an acceptable answer.   https://www.experts-exchange.com/help.jsp#hs=29&hi=405


and, unfortunately, that is the answer as posted in  http:#37066282
All,

In this instance, sdstuber's comment indicating this is not possible appears to be a valid solution. While I understand it may be frustrating to hear, "you can't do that" is still a technical answer to a question which has required the Experts to draw on their knowledge, so it is worthy of points.

I am starting the close process.

ModernMatt
Experts Exchange Moderator
Avatar of nQuote

ASKER

Accepted