LiCongMingDeShujuku / Find-When-Backup-Or-Restore-Completes

查询备份或恢复完成时的时间

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLEVER DATA GIT REPO

查询备份或恢复完成时的时间

Find When Backup Or Restore Completes

发布-日期: 2014年4月19日 (评论)

#

Contents

中文

你可以使用此快速脚本查找备份或还原完成的时间。 它将帮你估计剩下的小时数或分钟数。

English

You can use this quick little script to find when a Backup or Restore completes. It will estimate how many hours, or minutes you have left.


Logic

use master;
set nocount on
select
'database' = db_name(database_id)
, 'started on' = convert(char, start_time, 9)
, 'hours left' = convert(numeric(10,2), estimated_completion_time/1000.0/60.0/60.0)
, 'minutes left' = convert(numeric(10,2), estimated_completion_time/1000.0/60.0) 
, status
, command
, percent_complete
, reads
, writes
from sys.dm_exec_requests where command in ( 'backup database', 'restore database' ); 
go

WorksEveryTime

Build-Info

Build Quality Build History
Build-Status
Coverage
Nuget
Build history

Author

  • 李聪明的数据库 Lee's Clever Data
  • Mike的数据库宝典 Mikes Database Collection
  • 李聪明的数据库 "Lee Songming"

Gist Twitter Wordpress


License

LicenseCCSA

Lee Songming

About

查询备份或恢复完成时的时间