SQL Server 2012 – What Happens When the Database Log File is Full?

sql serversql-server-2012

Recently we found out that .ldf file of our Microsoft SQL Server 2012 database was growing large. We have set limit as follows:

screenshot

Now we have a question: What will happen when log .ldf file reaches its size limit?

Thank you

Best Answer

If the log is full, your database will fail any transaction that requires something written to the log (insert,update,delete, schema change, etc.).

From your screenshot, are you really planning to limit it to 15MB? How big is the database? How big is the largest table in the database? You also mention that it is growing very large. How do you define very large?

Generally speaking, you need your log file to be at least as big as your largest index, so that if you rebuild it, it won't fail. If the log has grown, then that's usually because you need a bigger log file. The only time you'd want to shrink the log file is if you know that a 1 off operation happened that will never happen again (e.g. some sort of data load/export). If your log file is growing significantly larger than your data files, you may want to check your recovery model - if it's full then you need to be taking log backups.

Related Question