There might have happened that you needed to truncate the log file because the server run out of space, but no matter what you do, you don't get that log file truncated in SQL Server.
To truncate the log file, you need to run the two following command in this same order:
BACKUP LOG database_name WITH TRUNCATE_ONLY
DBCC SHRINKFILE(database_log, 10)
Where database_name is the name of the database you want the log to be truncated. The database_log is the logical name of the log you need to truncate. The last parameter is the number of MB you need the log to be reduced to, in this case is to be reduced to 10 megabytes.
If you are not sure about the log name, check it through the Microsoft SQL Management Studio (usually going to the properties of the database, option Files).
There is a big note on this procedure though, be careful when you do this, because you will loose most of the information in the log. It is always recommended to make regular backups (complete backups if possible) to avoid loosing information.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment