If you get the error message:
Error: 9002, Severity: 17, State: 2
The transaction log for database '%.*ls' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
These are some of the reasons that caused this problem:
- A very large transaction log file.
- Transactions may fail and may start to roll back.
- Transactions may take a long time to complete.
- Performance issues may occur.
- Blocking may occur.
But bottom line is that is time to do something with the Transaction Log. Something you can do is start a clean transaction log (Be sure you have a backup to be save).
- Select your database, right click on it, go to Tasks >> Take Offline, we need this step in order to be sure nobody is using the data base.
- Now highlight the database, go to Tasks>>Detach.>> Click OK
- Go to the folder where the log file is located, then rename the *_log.ldf to be like *_log-jj.ldf
- Now it is time to retach the database, go to Databases and right click >> Attach…>> Click Add >> add the database you detached
- Select the log file and click the ‘Remove’ button so you only attach *.mdf file
- At this moment a new transaction log file is created and you can delete the old one.
No comments:
Post a Comment