This entry was posted on Monday, May 23rd, 2005 at 11:44 am and is filed under Uncategorized, Tech data. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
We all know that feeling, your wife left you, your car has broken down and your transaction logs are making your database look a little frumpy. Well here is the answer to all your problems (apart from the first two).
STEP ONE: Make sure you are logged into query analyer and logged into the correct database.
STEP TWO: Truncate the logs is the first statement you need to run agaisnt the database. This command flags all the completed transactions.
BACKUP LOG {database name} WITH TRUNCATE_ONLY
STEP THREE: The second statement clears out all the tranasaction that you just flagged.
DBCC SHRINKFILE ( {log file name},2 )
BUG FIX: The {log file name} is the name that appear in the Name field in the table sysfiles, which is not necessairly the same as the file name.
Example:
BACKUP LOG eshot WITH TRUNCATE_ONLY
DBCC SHRINKFILE (eshot_log,2)
TAA DAA , Ed