How can i see the time of execution of a sql statement?

Showing Answers 1 - 7 of 7 Answers

celso j.alos

  • Dec 21st, 2006
 

use set timing on in sqlplus

  Was this answer useful?  Yes

sharmasl

  • Mar 18th, 2009
 

First execute "Set Timing on" Cammand on SQL Prompt and after that 

SQL> SET TIMING ON

Execute the SQL Cammand on SQL Prompt

Select * from Emp;

You will get the time displayed.  Like This-

SQL> SELECT * FROM EMP;

     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7369 SMITH      CLERK           7902 18-JAN-81       1100                    20
      7499 ALLEN      SALESMAN        7698 20-FEB-81       1700        300         30
      7521 WARD       SALESMAN        7698 22-FEB-81       1350        500         30
      7566 JONES      MANAGER         7839 02-APR-81       3075                    20
      7654 MARTIN     SALESMAN        7698 28-SEP-81       1850       1400         30
      7698 BLAKE      MANAGER         7839 01-MAY-81       2950                    30
      7782 CLARK      MANAGER         7839 09-JUN-81       5000                    10
      7788 SCOTT      ANALYST         7566 19-APR-87       3200                    20
      7839 KING       PRESIDENT            17-NOV-81          0                    10
      7844 TURNER     SALESMAN        7698 08-SEP-81       1600          0         30
      7876 ADAMS      CLERK           7788 23-MAY-87       1200                    20
      7900 JAMES      CLERK           7698 03-DEC-81       1050                    30
      7902 FORD       ANALYST         7566 03-DEC-81       3100                    20
      7934 MILLER     CLERK           7782 23-JAN-82          0                    10

14 rows selected.

Elapsed: 00:00:00.04

  Was this answer useful?  Yes

we can find the time of execution of a sql statement using dbms_utility.get_time package


eg:declare
v1 integer;
v2 number;
begin
v1:=dbms_utility.get_time;
dbms_output.put_line(v1);
select count(*) into v2 from employee;
v1:=dbms_utility.get_time;
dbms_output.put_line(v1);
end;
/

  Was this answer useful?  Yes

RAVI KUMAR BURRI

  • Jan 19th, 2020
 

SET AUTOTRACE ON EXPLAIN

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions