Often times, people will do a complete back up the database nightly but they never do anything with the transaction logs. When this happens, the log files can grow out of control and fill up the partition. Here is a simple routine that will simply dump the logs and shink the database to free up disk space:
USE YourDataBaseName
GO
DBCC SHRINKFILE(YourDatabase_log, 1)
BACKUP LOG YourDataBaseName WITH TRUNCATE_ONLY
DBCC SHRINKFILE(YourDataBaseName_log, 1)
No comments:
Post a Comment