LDF file growing

  • Hi

    I have a database that have an LDF file with 35 gigabytes, is this unnormal. The biggest table have 750000 rows. Is there some way to make this LDF file smaller, other than deleting rows in the database tables

    //Peter

  • First take full backup of the database

    then use following command

    DBCC SHRINKDATABASE('dbname',10,TRUNCATEONLY)

    or

    BACKUP LOG dbname WITH TRUNCATE_ONLY

  • peter,

    As you said it is unuasual file size. If you are taking frequent backups it should not reach that much size.

    what is recovery model of the database??

    Full recovery model normally occupies more log space than Simple and Bulk-Logged recovery models. If it is in full recovery model and you are not backing up  the log frequently it will grow unusually.

     

     

    Regrads,

    K. Kalyan

  • A transaction log grows unexpectedly or becomes full on a computer that is running SQL Server

    http://support.microsoft.com/default.aspx?scid=kb;en-us;317375

  • There is no Transactionlog on this database, would that solve any problem now if I turned on a transaction log every hour or every halfhour. Do you think it would shrink or just stop growing?

    //Peter

  • There IS a transaction log...SQL Server doesn't work without one per database. That's what the .ldf file is. You apparently aren't doing transacation log BACKUPs. And yes, you need to start doing them. Or change your database recovery mode to SIMPLE.

    There is a huge amount of posts on this site about transaction logs, check them out.

    -SQLBill

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply