首页 > 代码库 > The log or differential backup cannot be restored because no files are ready to rollforward.
The log or differential backup cannot be restored because no files are ready to rollforward.
The log or differential backup cannot be restored because no files are ready to rollforward.
If you have found this page, it is likely that you encountered the following error when you tried to restore a differential backup using Microsoft SQL Server 2005. Restore failed for Server ‘‘. (Microsoft.SqlServer.Smo) Additional Information:System.Data.SqlClient.SqlError: The log or differential backup cannot be restored because no files are ready to rollforward. (Microsoft.SqlServer.Smo) What this error is telling you is that there is no database that was left in non-operational mode, and thus has not been cleaned up such that uncommitted transactions have not been rolled back. The easy way to reproduce this error is to backup your database using full recover model, and do full and differential backups. Once you have your full and differential backup files you, if you want to restore your database all you have to do is restore the full backup first, and then one of the differential files (differential backups have all the changes since the last full backup) that brings you up to the point you want to restore to. You will get the above error when you try to restore the differential backup (after you just restored the full backup). Unfortunately, you forgot one critical detail (just like I did at first). You MUST restore all but the last (in this case the full backup) with NORECOVERY option. In the Microsoft SQL Server Management Studio there are three options on the Option "page" when you restore a database. Option 1 (the default): Leave the database ready to use by rolling back uncommitted transactions. Additional transaction logs cannot be restored.(RESTORE WITH RECOVERY) Option 2: Leave the database non-operational, and do not roll back uncommitted transactions. Additional transaction logs can be restored.(RESTORE WITH NORECOVERY) To properly restore a database that is backup up using full recovery mode with full and differential backups, here are the steps you need to follow to not get the above error. Restore Full backup
- Open the Restore Database window in Microsoft SQL Server Management Studio
- Ensure the To database field is filled in with the name you want.
- Choose From device as the Source for restore.
- Choose the full backup file you want to restore. In most cases this is the most recent full backup file.
- Click the Options page on the left navigation.
- Choose Leave the database non-operational, and do not roll back uncommitted transactions. Additional transaction logs can be restored.(RESTORE WITH NORECOVERY). This is the most important step!!!
- Open the Restore Database window in Microsoft SQL Server Management Studio
- Ensure the To database field is filled in with the name you want. The same that you specified in step 2 for the Restore Full backup
- Choose From device as the Source for restore.
- Choose the differential backup file you want to restore. In most cases this is the most recent differential backup file.
- Click the Options page on the left navigation.
Choose the default: Leave the database ready to use by rolling back uncommitted transactions. Additional transaction logs cannot be restored.(RESTORE WITH RECOVERY) Make sure to choose this if you want to use your database after the restore
source http://justgeeks.blogspot.com/2009/03/log-or-differential-backup-cannot-be.html
The log or differential backup cannot be restored because no files are ready to rollforward.
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。