Agent Jobs

Find When Backup Or Restore Completes

You can use this quick little script to find when a Backup or Restore completes. It will estimate how many hours, or minutes you have left.

use master;
set nocount on
select
'database' = db_name(database_id)
, 'started on' = convert(char, start_time, 9)
, 'hours left' = convert(numeric(10,2), estimated_completion_time/1000.0/60.0/60.0)
, 'minutes left' = convert(numeric(10,2), estimated_completion_time/1000.0/60.0) 
, status
, command
, percent_complete
, reads
, writes
from sys.dm_exec_requests where command in ( 'backup database', 'restore database' ); 
go
Advertisements

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