SQL Server – Monitor Backup and Restore activity

This is a cool script to monitor backup and restore activity.

 

SELECT​​ session_id​​ as​​ SPID,​​ command,​​ a.text​​ AS​​ Query,​​ start_time,​​ percent_complete,​​ 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)​​ a​​ 

WHERE​​ r.command​​ in​​ ('BACKUP DATABASE','RESTORE DATABASE')

 

 

 

Knowledge worth sharing...Share on linkedin
Linkedin
Share on facebook
Facebook
Share on google
Google
Share on twitter
Twitter
Bookmark the permalink.

Leave a Reply

Leave a Reply

Your email address will not be published. Required fields are marked *