SQL Server 2016 查看数据库恢复进度

找到恢复进程PID

exec sp_who2

查询恢复进度

SELECT 
session_id, request_id, start_time, status, command, sql_handle
, database_id, user_id 
, blocking_session_id
, wait_type, wait_time, last_wait_type, wait_resource, open_transaction_count, open_resultset_count, transaction_id
, percent_complete, estimated_completion_time, cpu_time, total_elapsed_time, scheduler_id
, reads, writes, logical_reads
FROM sys.dm_exec_requests WHERE session_id=54

--或者:

SELECT 
session_id,  start_time, status, command
, percent_complete, estimated_completion_time*0.00000024 as '预计剩余小时', total_elapsed_time*0.00000024  as '总运行时间(H)'  
, reads, writes, logical_reads
FROM sys.dm_exec_requests WHERE session_id=54
点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注