Published on

March 27, 2016

Solving SQL Server Error 112: Not Enough Space on Disk

Solving puzzles can be a fun and challenging activity that stimulates our creative thinking and problem-solving skills. Just like solving a puzzle, troubleshooting and resolving issues in SQL Server can be equally rewarding. In this blog post, we will discuss how to solve the SQL Server Error 112, which occurs when there is not enough space on the disk during a backup operation.

Imagine a scenario where you are working with a client who has been experiencing backup failures with the error message “The operating system returned the error ‘112 (There is not enough space on the disk.)'”. The backups are being taken at a network location, and the client is using compressed backup.

Upon further investigation, you discover that the size of a compressed backup can vary throughout the process. SQL Server cannot determine the final compressed backup size beforehand, which can lead to backup failures if the disk space is not properly allocated.

To resolve this issue, you can enable a trace flag called 3042. This trace flag bypasses the pre-allocation algorithm and ensures that the backup has the most optimized space beforehand. Here is the code to enable the trace flag:

DBCC TRACEON (3042,-1);
GO

If, for any reason, you need to turn off the trace flag, you can use the following code:

DBCC TRACEOFF (3042,-1);
GO

As a general rule of thumb, it is recommended to have at least 1/3 of the volume of the backup available as free space. For example, if the size of the backup database is 50 GB, there should be at least 17 GB of free space on the backup drive. However, please note that this is a general guideline and the true space required can only be determined after the compressed backup is completed.

By following these steps and guidelines, you can effectively solve the SQL Server Error 112 and ensure successful backups without running out of disk space.

For more information on backup compression and other related topics, you can visit my blog:

https://www.exampleblog.com

Click to rate this post!
[Total: 0 Average: 0]

Let's work together

Send us a message or book free introductory meeting with us using button below.