SQL Server Performance

Shrink My Logfile

Discussion in 'SQL Server 2005 Performance Tuning for DBAs' started by suvresh, Feb 23, 2008.

  1. suvresh New Member

    hi i have a problem - while i am rebuild my index my log file is increasing. it doubled its size when i am re-building my index. so i decided to shrink the log file to its original size - can anyone guide me how do i shrink my Log file to its original size.
    thanks in advance.
  2. madhuottapalam New Member

    Yes its true that when you rebuild indexes the TL size increses. To shrink the TL size,
    Backup Log YourDatabaseName WITH TRUNCATE_ONLY
    DBCC SHRINKFILE(yourdatabaselogicallogfilename,size)
    read about these command in BOL
    Note : WHen you shrink TL , the backup chain breaks, so soon after shrinking take full backup
  3. MohammedU New Member

    If you use TRUNCATE_ONLY option you loose your poin in time recovery option when your db recovery model is not simple...
    You can run the tlog backup then shrink file with DBCC SHRINKFILE command....

Share This Page