Hi All,
As per my business requirement, i have close to 100s of queries to execute in a single shot in my DB.
After execution i want to know the time taken for each and every query.
So i followed the below approach. But its time consuming, in which i have to mark the START_TIME and END_TIME in before and after for all of the 100 queries.
Let me know if there is any other better approach to do.
SELECT to_char(sysdate,'DDMMYY HH24:MI:SS')START_TIME FROM DUAL;
SELECTÂ 'SCRIPT1' "SCRIPT",COUNT(1) CNT FROM EMPLOYEES;
SELECT to_char(sysdate,'DDMMYY HH24:MI:SS')END_TIME FROM DUAL;
SELECT to_char(sysdate,'DDMMYY HH24:MI:SS')START_TIME FROM DUAL;
SELECTÂ 'SCRIPT2' "SCRIPT",COUNT(1) CNT FROM DEPARTMENTS;
SELECT to_char(sysdate,'DDMMYY HH24:MI:SS')END_TIME FROM DUAL;
I wanted to frame a report some like this with start time and end time. A query with the below structure will help a lot.
Script No# | Count(1) cnt | Start Time | End Time | Elapsed Time |
---|
Script1 | 55 | 021219 05:23:34 | 021219 05:23:38 | 4 Seconds |
Script2 | 0 | 021219 05:23:39 | 021219 05:23:39 | 0 Second |
Script3 | 150 | 021219 05:23:40 | 021219 05:24:00 | 20 Seconds |
Regards,
Lazar
021219 05:23:34