How To Use SQL*Plus Built-in Timers

Q

How To Use SQL*Plus Built-in Timers? - Oracle DBA FAQ - Introduction to Command-Line SQL*Plus Client Tool

✍: FYIcenter.com

A

If you don't have a stopwatch/timer and want to measure elapsed periods of time, you can SQL*Plus Built-in Timers with the following commands:

  • TIMING - Displays number of timers.
  • TIMING START [name] - Starts a new timer with or without a name.
  • TIMING SHOW [name] - Shows the current time of the named or not-named timer.
  • TIMING STOP [name] - Stops the named or not-named timer.

The following tutorial exercise shows you a good example of using SQL*Plus built-in timers:

SQL> TIMING START timer_1

(some seconds later)
SQL> TIMING START timer_2

(some seconds later)
SQL> TIMING START timer_3

(some seconds later)
SQL> TIMING SHOW timer_1
timing for: timer_2
Elapsed: 00:00:19.43

(some seconds later)
SQL> TIMING STOP timer_2
timing for: timer_2
Elapsed: 00:00:36.32

SQL> TIMING
2 timing elements in use

2007-04-29, 4525👍, 0💬