Using timing in SQL*Plus

Using timing feature on SQL*Plus one can monitor elapsed time.

Example:
— start timer with the name monitor_timing, name is optional
SQL> timing start monitor_timing

SQL> select sysdate from dual;

SYSDATE
———
11-APR-10

— display time elapsed for current timer
SQL> timing show
timing for: monitor_timing
Elapsed: 00:00:21.35

SQL> select count(1) FROM dba_objects;

COUNT(1)
———-
9728

— show elapsed time
SQL> timing show
timing for: monitor_timing
Elapsed: 00:00:46.16

— stop timer and it clears the current timer
SQL> timing stop
timing for: monitor_timing
Elapsed: 00:00:54.86

— clears all timers and prints the elapsed time of all the timers
SQL> clear timing

Note: One can start more that one timer at the same time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s