Sql Server Error: the log for the database is not available

Question: How do you resolve Sql Server Database Error: "the log for database is not available"?

Answer: There is a chance that you tried to attach a database to a Server and during the process of attaching the database the database log wasn't attached. 

- If this was the case then follow the solution below to resolve this issue:

  1. Check to see if the Database log hasn't hit the maximum file size specfied in the Database Properties
       - Right click on the Database 
       - Click on "Files"
       [NB] Once the database logs has been touched/modified the file won't be able to be modified again. So, changing the file size to unlimited space won't work.

    However, this does not imply not trying at all, things might have changed by the time you are reading this article.

  2. If the database won't allow you to write to it because the Database Log is not available, try to stop the Sql Server Service and restart the Server. Chances are that Databse Log file is corrupt and you should start looking into creating a new Database with new log files.
  3. Another possible solution is to set up a Transaction Log Shipping in Database Properties, this will back up the database and it's logs at an interval.
  4. Another possible solution is to Shrink the Database Log file:
     - Right Click the Database Name and navigate to "Tasks" then "Shrink Database", change from "Data" to "File" and choose "YourDatabaseLogFileName", finally click "Ok" to shrink the database log file.

Edit this Article
sql server error Technology published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.
Your Session is Ending
Login to Continue


© 2021 - ErnesTech - Privacy