Forum Discussion
Zahidhussain
Sep 11, 2020Copper Contributor
Database Restoring Status
Hi All, We are using Microsoft SQL Server 2016 (SP2) (KB4052908) - 13.0.5026.0 (X64) in our environment DB01 as a Primary and DB02 as a restoring mode Recently I have checked both DB mdf files an...
Mkelsawy
Oct 11, 2020Copper Contributor
hi, Zahidhussain your Question, not clear enough could you please explain more to able to help you.
As I understood from above:-
That you need to check the restoring progress for your database so I suggest using below Query that will help you to know
Note:-
the user who runs below should have sysadmin privilege or VIEW SERVER STATE permission
Use master
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 ('RESTORE DATABASE')
Thanks,