I am restoring database now and get it hang on 100% but still going (doing redo phase). I am thinking how to estimate time of completion for this phase. But because SQL have no build-in way to do it, I suppose is it possible to count all modified by commited transactions pages from transaction log, multiple it by 8 to get exact space needed to be modified during the redo phase in data file, and estimate completion time by dividing it on your disk subsystem throughtput?
SQL Server – Estimating REDO Phase Time During Restore
restoresql-server-2008-r2
Related Question
- Sql-server – how to restore
- SQL Server Error 3202 During Restore – Troubleshooting Guide
- Sql-server – Is it possible to estimate the restore progress in SQL Server 2014 from pages read/written
- SQL Server – How to Restore Database with a FileTable
- Sql-server – Extracted data WAY bigger than deficit left from deleted rows
- Sql-server – Transaction deadlock during restore
- Sql-server – Point in time Restore failed – Error 3456 ‘Could not redo log record’
Best Answer
If you have not enabled any trace flag you have no option but to look at DMV
sys.dm_exec_requests
and look for columnpercent_complete
to gauge how much your restore operation has completed. Sample script from hereAre you sure this is the redo phase, I think this is the UNDO phase and depending on how much VLF's are there in database log file the UNDO process can take time. Of course the whole process of restore can further be delayed if Instant file initialization is not there. You can check using This script whether database is having IFI . If not provide SQL Server service account perform volume maintenance tasks rights and this will require a SQL Server service restart
As already pointed by Gameiswar you can enable trace flags to get more information. You can also read Blog by Bob Dorr for more information about internal restore process.
Please note these are undocumented commands so don't enable it on prod servers.. These should be used for testing purpose only
Below is what I got when I restored a database with trace flags enabled