cancel
Showing results for 
Search instead for 
Did you mean: 

EV Database Log File - Large but empty

RonK
Level 4

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

1 ACCEPTED SOLUTION

Accepted Solutions

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

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.

View solution in original post

6 REPLIES 6

JesusWept3
Level 6
Partner Accredited Certified

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

https://www.linkedin.com/in/alex-allen-turl-07370146

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

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.

Simon_B_
Level 6
Partner Accredited

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). 

RonK
Level 4

Thanks guys

Ron

RonK
Level 4

The script worked great.

Ron

AndrewB
Moderator
Moderator
Partner    VIP    Accredited

Cheers Ron. Thanks for following up.