Automations

How Long Has Backup Been Running

Here’s how to find out how long your backup has been running.

use master;
set nocount on

select
'database' = db_name(database_id)
, 'command' = command
, 'percent done' = convert(numeric(6,2), sder.percent_complete)
, 'time spent in min' = convert(numeric(10,2), sder.total_elapsed_time /1000.0/60.0)
, 'time spent in hrs' = left(convert(numeric(10,2), sder.total_elapsed_time /1000.0/60.0)/60, 3)
, 'hours remaining' = convert(numeric(10,2), sder.estimated_completion_time /1000.0/60.0/60.0)
, 'minutes remaining' = convert(numeric(10,2), sder.estimated_completion_time /1000.0/60.0) from
sys.dm_exec_requests sder
where command = 'backup database'
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