SQL Server Performance

'truncate_only' is not a recognized BACKUP option.

Discussion in 'SQL Server 2008 Questions [Archive Only - Closed]' started by kvdba, Jun 12, 2008.

  1. kvdba New Member

    Hi All,
    How do I have to shrink the Transaction log file of the user database in SQL SERVER 2008? In the earlier version of the sqlserver we can do the same by using the below command
    Backup log <database name> with truncate_only
    DBCC shrinkfile(<Log_filename>, <size>)
    When I run the above commands I get the below error message
    'truncate_only' is not a recognized BACKUP option.
    I don't want to backup the database. I tried to change the Recovery model of the database from full to Simple, still It didn't help me.
    Can someone guide me how to Shrink the transactional log file to the desired size in sql server 2008.
    Thanks in Advance.
  2. kvdba New Member

    I got the solution to my above query
    USE AdventureWorks;GO-- Truncate the log by changing the database recovery model to SIMPLE.ALTER DATABASE AdventureWorksSET RECOVERY SIMPLE;GO-- Shrink the truncated log file to 1 MB.DBCC SHRINKFILE (AdventureWorks_Log, 1);GO-- Reset the database recovery model.ALTER DATABASE AdventureWorksSET RECOVERY FULL;GO

Share This Page