Knowledge found and lost while working with Microsoft Dynamics CRM
RSS icon Home icon
  • Shrinking the CRM database transaction log

    Posted on June 27th, 2007 mitch Print Print No comments

    On one of my CRM installations I began to notice that the transaction log for the MSCRM database was not shrinking even though it was being backed up properly.  If you don't keep an eye on the physical files, they can grow to huge sizes.

    After making a full backup of the database and transaction log, the following SQL script will shrink the transaction log file:

       1: BACKUP LOG MYCOMPANY_MSCRM WITH TRUNCATE_ONLY
       2: GO
       3: DBCC SHRINKFILE (MYCOMPANY_MSCRM_log, 1)
       4: GO

     

    Note: Just replace MYCOMPANY with the name of your CRM database name.

    Note 2: The second command does indeed have "_log" appended to the name. That is the device name for the transaction log itself.

    Customization, Dynamics CRM
    1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading ... Loading ...
    1,630 views

    Leave a reply