Thursday, July 26, 2018

Query to check running backups and restores - SQL Server

How to check running backups and restores - SQL Server

Run the below script to check running backups and

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')

No comments:

Post a Comment

Query to find last Full differential and log backups of all databases - SQL Server

Query to find last Full differential and log backups of all databases - SQL Server Run below query to find last Full differential and log...