views:

52

answers:

2

This morning I truncated my transaction before it's hourly backup. Since I truncated the transaction log, the backup failed. The error code I got was 0xC002F210. Any ideas why this happened?

+2  A: 

The problem is caused by not having done a full backup before switching the data into SIMPLE recovery mode, shrinking the log file and then switching back to FULL recovery mode.

Ardman
A: 

Why did you truncate the log instead of just backing it up? If you were running out of space you could have backed up the log and then shrunk the file, instead of truncating. Truncating messes with the backup chain and forces you to start over (by taking a new, full backup).

This is one of the reasons BACKUP LOG WITH TRUNCATE_ONLY has been deprecated, and actually won't run in SQL Server 2008. For some background reading:

http://sqlserverpedia.com/blog/sql-server-backup-and-restore/backup-log-with-truncate_only-like-a-bear-trap/

http://sqlblog.com/blogs/aaron_bertrand/archive/2009/07/27/oh-the-horror-please-stop-telling-people-they-should-shrink-their-log-files.aspx

Aaron Bertrand
The transaction log was 33Gig and the backup failed because it ran out of disk space. So, I had to manually intervene.
Ardman
Well you'll need to discover a different approach to this emergency response (such as backing up the log instead of truncating it), since this trick won't work anymore once you move to SQL Server 2008.
Aaron Bertrand