Skip to Content
Author's profile photo Eduardo Rezende

Do you need to check the progress of your BACKUP/RESTORE?

If your backup (or restore) have been started by another adminitrator or by a job, you cannot use the GUI (or the Messages tab) to follow the progression.

In this case some dynamic management views can be used to track the backup/restore progress:

SELECT command,
s.text,
start_time,
percent_complete,
estimated_completion_time/1000 as "seconds to go",
dateadd(second,estimated_completion_time/1000, getdate()) as "estimated completion time"
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) s
WHERE r.command in ('RESTORE DATABASE', 'BACKUP DATABASE', 'RESTORE LOG', 'BACKUP LOG')

/wp-content/uploads/2013/10/bak1_294403.png

If you are not interested in the command used, the s.text and view dm_exec_sql_text can be removed:

SELECT command,
start_time,
percent_complete,
estimated_completion_time/1000 as "seconds to go",
dateadd(second,estimated_completion_time/1000, getdate()) as "estimated completion time"
FROM sys.dm_exec_requests r
WHERE r.command in ('RESTORE DATABASE', 'BACKUP DATABASE', 'RESTORE LOG', 'BACKUP LOG')

/wp-content/uploads/2013/10/bak2_294452.png

Of course, you can adapt this statement to select more (or less) information.

Hope you like this blog and any comments/suggestions are welcome!

Regards,

Eduardo Rezende

Assigned Tags

      11 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nicolas VANDER AUWERA
      Nicolas VANDER AUWERA

      Nice blog. It helped me this morning 😉

      Regards, Nicolas

      Author's profile photo Eduardo Rezende
      Eduardo Rezende
      Blog Post Author

      Glad it was helpful! 🙂

      Author's profile photo Former Member
      Former Member

      Nice one Eduardo.

      Regards,

      Nick Loy

      Author's profile photo Eduardo Rezende
      Eduardo Rezende
      Blog Post Author

      Thanks Nick!

      Author's profile photo S Sriram
      S Sriram

      Nice one

      Regards

      Ram

      Author's profile photo Eduardo Rezende
      Eduardo Rezende
      Blog Post Author

      Thanks Ram!

      Author's profile photo Gobinda Ram Sharma
      Gobinda Ram Sharma

      Nice blog. It helped me a lot....I was performing a full backup in shared location but did not issue STATS monitoring option in the backup command...

      Regards,

      GobindaRam Sharma

      Author's profile photo Eduardo Rezende
      Eduardo Rezende
      Blog Post Author

      Hi GobindaRam,

      Good to hear this blog was helpful for you! 🙂

      Regards,

      Eduardo

      Author's profile photo Former Member
      Former Member

      Hola Eduardo, how this could work in SP11? I am not able to find  DM_EXEC_REQUESTS

      SAP DBTech JDBC: [259]: invalid table name: Could not find table/view DM_EXEC_REQUESTS in schema SYS: line 6 col 10 (at pos 200)

      muito obrigado!

      Author's profile photo Eduardo Rezende
      Eduardo Rezende
      Blog Post Author

      Hola Joze Lopez,

      Which SQL Server version are you using?

      Regards,
      Eduardo

      Author's profile photo Eduardo Rezende
      Eduardo Rezende
      Blog Post Author

      Hola Joze Lopez,

      I just check this query on my SQL Server 2016 environment and I did not face any issue.
      Let me know if you need any help.

      Best regards,
      Eduardo