Forum Discussion

RonK's avatar
RonK
Level 4
15 years ago
Solved

EV Database Log File - Large but empty

I have a few EV tranaction log files that are really large, and they are empty.  For example, the EVDA log file is 70GB.  The "currently allocated space" is 68GB, and the "available free space" is 68GB.  The "initial" database size is also 68GB.

When I try to shrink the transaction log file to say 500MB, the process fails since the "currently allocated space" is 68GB.  

Is there a way to reduce the size of the tranaction log file?  Can I reduce the "initial" database size?

Thanks

Ron

  • you might want to run this by your DBA like jw said. if you're feeling up to it you can do the following:

     

    USE DatabaseName
    GO
    DBCC SHRINKFILE(<TransactionLogName>, 1)
    BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY
    DBCC SHRINKFILE(<TransactionLogName>, 1)
    GO

     

    either way, be sure to run a full backup for good measure before making any changes.

6 Replies

  • well you would reduce the initial log file size and then shrink it, try talking to your DBA as this sounds like a custom change to the db properties and file sizes as opposed to something default

  • you might want to run this by your DBA like jw said. if you're feeling up to it you can do the following:

     

    USE DatabaseName
    GO
    DBCC SHRINKFILE(<TransactionLogName>, 1)
    BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY
    DBCC SHRINKFILE(<TransactionLogName>, 1)
    GO

     

    either way, be sure to run a full backup for good measure before making any changes.

  • Furthermore you might want to thing about changing the recovery model of the EV databases to simple.

    In general you always perform backups during a certain time where the EV services have been set to backup mode to ensure consistency over database/ev partitions. During that timespan you also backup the sql database. Therefore there is actually very little use for the possibility to restore the database to any point in time (which could mean non consistentency with the data in the partitions).