Our backups are done at the disk level, so SQL itself doesn't know that we've backed up OK
So - here's how to clear the transaction logs:
- Set the recovery mode to simple. This stops SQL from logging transactions
- Run a database shrink - this will clear the logs
- Set the recover mode back to full.
a) One of our databases thought it was being replicated although we've never turned it on. In this case:
Exec sp_removedbreplication // against the database to remove replication info.
However - if you are using replication you should use:
EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1 // this removes the log entries that are locked as unreplicated
b) If you have created multiple files for data and logs, DON'T unless you have to for example to span disks. To remove them:
- Clear the log files (see above)
- Shrink each additional file ticking the "empty file by migrating" box
- Go to properties of the DB, then file and remove it
Nick
No comments:
Post a Comment