BACKUP LOG WITH TRUNCATE_ONLY has been removed from SQL Server 2008 R2.
DBCC SHRINKFILE is not necessary. You need to free up space within the transaction log, not shrink the physical file. Taking a transaction log backup of a full recovery model database will accomplish this.
If this doesn't work (the transaction log will not truncate if there are active transactions within a virtual log file), switch the recovery model to SIMPLE, then back to FULL. You will need additional space in the transaction log file, so you may have to temporarily add a second file to the transaction log. This second file may need to live on a different volume than the first.
If you use DBCC SHRINKFILE, the next time you write a transaction, you are just going to AUTOGROW the transaction log. This will lead to physical fragmentation of the transaction log file within the file system, slowing down transaction log backups and database recovery.
Best practice is to pre-allocate the space you need.
Refer to the Books Online Topic "Troubleshooting a Full Transaction Log (Error 9002)"
commented on Nov 16 2011 5:21AM