One of the often-used scripts that DBAs keep on hand must be the one that shows how far a session has advanced. The statement below is quite helpful when seeking to estimate the percentage of backup or restore processes that have been finished.
SELECT Session_Id,
Reads, Writes,
Cpu_Time,
Logical_Reads,
Total_Elapsed_Time,
Blocking_Session_Id,
Percent_Complete,
Command,
(SELECT text FROM sys.dm_exec_sql_text(sql_handle)) AS Text
FROM sys.dm_exec_requests
WHERE session_id = <SessionID>
As stated above, this command will let you know the percentage of completion of the session whether it is a backup process or restoration.
One comment