Query to Find time remaining to complete database backup or restore in SQL 2005 | SansSQL

Tuesday, November 18, 2008

Query to Find time remaining to complete database backup or restore in SQL 2005

USE master

          Start_Time ,
          b.Name AS DatabaseName, --Sometimes this will be "Main" as the database will not be accesiable.
          DATEADD(ms,estimated_completion_time,GETDATE()) AS RemainTime,
          (estimated_completion_time/1000/60) AS MinutesToFinish
FROM sys.dm_exec_requests a
          INNER JOIN sys.databases b
          ON a.database_id = b.database_id
          Command like '%Restore%'
          OR Command like '%Backup%'
          AND Estimated_Completion_Time > 0


prasad yangamuni said...

Hey This script is beautiful.. i tried alot to findout this script.. but finally i got here..

Great work sandesh.. really appreciate it..

Anonymous said...

Awsome. It works perfectl


Anonymous said...

Perfect !!!

Krishna TPudi said...

Query to Find time remaining to complete Rebuild Index for entire DB.

Krishna TPudi said...

Hi, we can rewrite the command for Checking Backup and Restore estimated time.
select percent_complete ,estimated_completion_time/60000 RemMin,* from sys.dm_exec_requests where command ='backup database'

Unknown said...

Nice Article !

Really this will help to people of SQL Server Community.
I have also prepared small note on this, find estimated finish time of the restore SQL Server database.


jonathan said...

Nice blog... This blog clearly shows the important of automatic backup of SQL server database. This help to secure data. Thanks for sharing

Data Science Programs said...

I was very happy to find this site. I really enjoyed reading this article today and think it might be one of the best articles I have read so far. I wanted to thank you for this excellent reading !! I really enjoy every part and have bookmarked you to see the new things you post. Well done for this excellent article. Please keep this work of the same quality.
Data Science Course in Bangalore

Nicole said...

http://www.offshorededi.com offers high quality DMCA Ignored Hosting. We make offshore hosting simple for you to use with reliable servers and one-click installers.

Huongkvb said...

Mua vé tại Aivivu, tham khảo

vé máy bay đi Mỹ giá bao nhiêu

lịch bay từ mỹ về việt nam hôm nay

chuyến bay thương mại từ canada về việt nam

từ nhật bản về việt nam bao nhiêu tiếng

giá vé máy bay hàn quốc về việt nam

Vé máy bay từ Đài Loan về VN

danh sách khách sạn cách ly tại hà nội

chi phí vé máy bay cho chuyên gia nước ngoài

OffshoreServers said...

Amazingly helpful which you have shared here. I am impressed by the details and also it is a significant article for us. Continue imparting this sort of info, Thank you.dmca ignored streaming server

Webcare360 said...

I liked your work and, as a result, the manner you presented this content about 10gbps Streaming Servers.It is a valuable paper for us. Thank you for sharing this blog with us.

MartenJames said...

I got best ideas to complete my university project. Our Click Here Exterior Painting Services in Johns Creek GA can provide you best solutions to complete your home.

Post a Comment