March 28, 2011 at 11:56 am
We are restoring large database with replace option. How to check it's progress, like with some sys.table or so?
March 28, 2011 at 12:02 pm
This should help
selectst.text,
command,
db_name(database_id),
start_time,
DATEADD(ms,estimated_completion_time,
GETDATE()) AS EstimatedEndTime,
percent_complete,
((estimated_completion_time / 1000) / 60) as EstCominMins,
((total_elapsed_time / 1000) / 60) as ElapsedMins,
reads,
writes
from sys.dm_exec_requests er
CROSS APPLY sys.dm_exec_sql_text(er.sql_handle) as st
where command like 'Backup%' or command like 'restore%'
order by command
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
March 28, 2011 at 12:21 pm
That's amazing! Thanks a lot, Perry. Actually I can use it not only for backups or restores, but for anything else.
March 28, 2011 at 12:27 pm
SQL Guy 1 (3/28/2011)
That's amazing! Thanks a lot, Perry. Actually I can use it not only for backups or restores, but for anything else.
You're welcome
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
March 28, 2011 at 1:15 pm
If you are restoring through a script then you can also use the option... WITH STATS = 5 or any other number....
March 29, 2011 at 5:00 am
you could do, but the script above supplies a lot more detail
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs" 😉
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply