Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: measuring the sql time to execute
Larry,
This is a script I like to run from sql*plus. Mind you, the count(*) operation might add a few hundredths of a second.
Jay!!!
DECLARE
time_before BINARY_INTEGER;
time_after BINARY_INTEGER;
foo INTEGER;
BEGIN
time_before := DBMS_UTILITY.GET_TIME;
SELECT count(*)
INTO foo FROM ( [Your select statement here] );
time_after := DBMS_UTILITY.GET_TIME;
DBMS_OUTPUT.PUT_LINE (
(time_after - time_before) / 100 || ' seconds');
END;
/
Larry Pettit wrote:
> Is there a way to run sql commands and record the time it took to execute.
> I couldn't find a way in either sql *plus or sql worksheet?
Received on Tue Aug 24 1999 - 13:32:45 CDT