How do I decrease the size of my sql server log file?
- Perform a full backup of your database. Don't skip this. Really.
- Change the backup method of your database to "Simple"
- Open a query window and enter "checkpoint" and execute
- Perform another backup of the database
- Change the backup method of your database back to "Full" (or whatever it was, if it wasn't already Simple)
- Perform a final full backup of the database.
- Run below queries one by one
USE Database_Name
select name,recovery_model_desc from sys.databases
ALTER DATABASE Database_Name SET RECOVERY simple
DBCC SHRINKFILE (Database_Name_log , 1)
Welcome to the fickle world of SQL Server log management.
SOMETHING is wrong, though I don't think anyone will be able to tell you more than that without some additional information. For example, has this database ever been used for Transactional SQL Server replication? This can cause issues like this if a transaction hasn't been replicated to a subscriber.
In the interim, this should at least allow you to kill the log file:
- Perform a full backup of your database. Don't skip this. Really.
- Change the backup method of your database to "Simple"
- Open a query window and enter "checkpoint" and execute
- Perform another backup of the database
- Change the backup method of your database back to "Full" (or whatever it was, if it wasn't already Simple)
- Perform a final full backup of the database.
You should now be able to shrink the files (if performing the backup didn't do that for you).
Good luck!