August 4, 2011 at 1:59 am
Hi All,
I need query to find how long(time duration) the last restore operation of a database.
Thanks in Advance.
August 4, 2011 at 2:46 am
praveen.gln1 (8/4/2011)
Hi All,I need query to find how long(time duration) the last restore operation of a database.
Thanks in Advance.
Nope it's hard to find restoration time from query.
The possible ways are,
you can see the time duration while restoring the DB
or
If its scheduled in job you can view it.
Muthukkumaran Kaliyamoorthy
https://www.sqlserverblogforum.com/
August 4, 2011 at 3:16 am
What is db size?
M&M
August 4, 2011 at 5:02 am
Its almost 700 Gigs
August 4, 2011 at 8:57 am
praveen.gln1 (8/4/2011)
Its almost 700 Gigs
Depending on your storage setup/speed/server ect.. could take 2-4 hrs
My restores from a network device roughly take 15 hrs (2.6TB), now if its locally on the SAN it takes 8hrs 39 mins 21 secs
if you do a dry run of the restore then run this script it will give you an estimate
SELECT command,
s.text,
start_time,
percent_complete,
CAST(((DATEDIFF(s,start_time,GetDate()))/3600) as varchar) + ' hour(s), '
+ CAST((DATEDIFF(s,start_time,GetDate())%3600)/60 as varchar) + 'min, '
+ CAST((DATEDIFF(s,start_time,GetDate())%60) as varchar) + ' sec' as running_time,
CAST((estimated_completion_time/3600000) as varchar) + ' hour(s), '
+ CAST((estimated_completion_time %3600000)/60000 as varchar) + 'min, '
+ CAST((estimated_completion_time %60000)/1000 as varchar) + ' sec' as est_time_to_go,
dateadd(second,estimated_completion_time/1000, getdate()) as est_completion_time
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) s
WHERE r.command in ('RESTORE DATABASE', 'BACKUP DATABASE', 'RESTORE LOG', 'BACKUP LOG')
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply