BACKUP LOG WITH TRUNCATE_ONLY is no longer a recognized BACKUP option. This command get rid of the contents of your SQL Server’s transaction log without really backing it up. This command will to invalidate the point in time recoverability of the database as this breaks the log chain.

This command is used by Database administrators when they end in situations where getting rid of the transaction log is only way by which he can shrink their log file with a DBCC SHRINKFILE command, thereby freeing up drive space.

Microsoft always recommends that DBA’s must switch to simple recovery mode getting rid of the transaction logs instead of truncating logs by above command if no Point in Time recovery is required. But by using simple recovery mode, there is no scope of point in time recovery which means in case of disaster, all you can get is last Full Backup to be restored which may be a day or two old.

TRUNCATE_ONLY option is capability is completely removed in from SQL Server 2008. The error encountered if you try use this option is

Msg 155, Level 15, State 1, Line 1
'TRUNCATE_ONLY' is not a recognized BACKUP option.

There are two ways of getting rid of transaction logs in case of extreme emergencies in SQL Server 2008:
1.Backing up Transaction logs by sending Log Backups to “NUL:” but it should only be in case of extreme emergencies.

BACKUP LOG [Demo1] TO DISK = N'Nul:' WITH NOFORMAT, NOINIT, NAME = N'Demo1-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10

2.Switching database to Simple and Back to Full Recovery mode can also be used under extreme emergencies where T-Log Backup is not possible due Space constraints or due to size.

Note: One should always do a fresh FULL backup after using any of the methods above where log chain is broken, this enables

Vamshi B

View Comments

Share
Published by
Vamshi B

Recent Posts

sql server detected logical consistency based error

Learn about SQL Server detecting logical consistency based issues and how to resolve them.

5 months ago

sql server error 1222

Learn about SQL Server error 1222 and how to resolve the lock request time out…

5 months ago

Microsoft SQL Server 2022 New Features

Discover the new features of Microsoft SQL Server 2022 and how they compare to previous…

5 months ago

SQL Server Error 1222 lock request time out period exceeded

SQL Server Error 1222 lock request time out period exceeded   Lock request time out…

6 months ago

SQL Server Error : 427, Severity: 20. Could not load the definition for constr

SQL Server Error : 427, Severity: 20. Could not load the definition for constraint ID…

10 months ago

SQL Server Error : 204, Severity: 20. Normalization error in node %ls.

SQL Server Error : 204, Severity: 20. Normalization error in node %ls.

10 months ago

This website uses cookies.