Published on

March 11, 2015

Understanding SQL Server Backup Errors

Backups are an essential part of maintaining the integrity and availability of your SQL Server databases. However, sometimes you may encounter errors while taking backups, which can be frustrating. One common error message that you might come across is “Error 3201: Cannot open backup device”. In this blog post, we will explore the causes of this error and discuss possible solutions.

Let’s consider a scenario where the SQL Server service is running under a domain account, and you have already mapped a drive in Windows that you want to use for backups. However, when you try to take a backup using SQL Server Management Studio (SSMS), you are unable to see the mapped drive in the backup file selection screen.

This issue occurs because SQL Server, running as a service, does not have visibility of the mapped drive. As a result, when you attempt to take a backup, you receive the “Cannot open backup device” error.

To resolve this issue, you need to map the drive within SQL Server itself. Here are the steps to do so:

-- Map the drive via T-SQL so that SQL can see it.
EXEC xp_cmdshell 'net use Z: \\BigPinal\SharedFolder'
GO

After executing the above T-SQL command, you can verify that the drive is now visible to SQL Server by running the following command:

xp_cmdshell 'dir Z:'

Once the drive is successfully mapped within SQL Server, you will be able to see it in the backup file selection screen of SSMS. You can now proceed with taking the backup without encountering any errors.

If you encounter the error message “Msg 15123: The configuration option ‘xp_cmdshell’ does not exist”, it means that the xp_cmdshell feature is disabled by default for security reasons. To enable it temporarily, you can execute the following commands:

EXEC sp_configure 'advanced', 1
RECONFIGURE WITH OVERRIDE
GO
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE WITH OVERRIDE
GO

It is important to note that enabling xp_cmdshell should be done with caution and turned off again once you have completed your work, as it can pose security risks.

Have you ever encountered similar backup errors in SQL Server? What steps did you take to resolve them? Share your experiences and solutions in the comments below. Let’s learn from each other!

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.