While database restore is in progress or database is in restoring mode, you can check the estimated restore percentage complete , estimated completion time, start time with below DMV.
SELECT sp.name ,
percent_complete AS 'PERCENTAGE COMPLETE',
DATEADD(second, estimated_completion_time / 1000, GETDATE()) AS 'Est Completion Time' ,
GETDATE() AS 'Current Time' ,
DATEDIFF(minute, start_time, GETDATE()) AS running ,
estimated_completion_time / 1000 / 60 AS 'Completion Time' ,
start_time ,
command
FROM sys.dm_exec_requests req
INNER JOIN sys.sysdatabases sp ON sp.dbid = req.database_id
WHERE req.command LIKE '%RESTORE%'
Thanks Patel. This works like majic
ReplyDeleteGreat.
Delete