04-15-2011 12:18 PM
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
Solved! Go to Solution.
04-17-2011 04:01 PM
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.
04-15-2011 12:21 PM
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
04-17-2011 04:01 PM
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.
04-18-2011 12:43 AM
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).
04-18-2011 11:54 AM
Thanks guys
Ron
04-19-2011 01:48 PM
The script worked great.
Ron
04-19-2011 01:51 PM
Cheers Ron. Thanks for following up.