Home » SQL Server Error : 3201, Severity: 16. Cannot open backup device ‘%ls’. Operati

SQL Server Error : 3201, Severity: 16. Cannot open backup device ‘%ls’. Operati

SQL Server Error : 3201 Details


SQL Server Error: 3201
Severity: 16
Event Logged or not: No
Description:
Cannot open backup device ‘%ls’. Operating system error %ls.
Severity 16 Description:
Indicates general errors that can be corrected by the user.

Related errors:

  1. sql server backup system cannot find path specified
  2. a specified logon session does not exist map network drive
  3. windows server backup a specified session does not exist
  4. a specified logon session does not exist netapp
  5. a specified logon session does not exist
  6. it may already have been terminated

Cause:

We are so accustomed to making backups that it can occasionally provide us with new experiences. Taking backups on a shared drive is one of the most common messages I see. If you came on this blog while looking for an error message, you might want to check out the blogs below if you aren’t dealing with a mapped drive. Let’s have a look at Error 3201.

 

Solution for Resolving the Error

When SQL Backup command is failing with below error.

Msg 3201, Level 16, State 1, Line 1
Cannot open backup device ‘F:\test.bak’. Operating system error 3(The system cannot find the path specified.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

If we try to get details about the drives visible from SQL Server by Windows “dir” command then we see below.

xp_cmdshell 'dir F:'

Output
———————————————–
The system cannot find the path specified.
NULL
(2 row(s) affected)

Above confirms that SQL is not able to see the F drive, even though it is mapped on Windows. In case you get below error

Msg 15123, Level 16, State 1, Procedure sp_configure, Line 72

The configuration option ‘xp_cmdshell’ does not exist, or it may be an advanced option.

Then you need to execute below to enable xp_cmdshell as its disabled by default due to security reasons. (Please turn off again once you done with the work)

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

Now if “The system cannot find the path specified.” because SQL Server instance as it is running as a service. To fix the error, we need to map the drive via SQL Server using below steps

EXEC xp_cmdshell 'net use F: \\Drive123\TestSharedFolder'
GO

After mapping this drive Backup will be successfull.

 

Reading sql server error log location from SQL Query

Identifying SQL Server Error Log File used by SQL Server Database Engine can be done by reading SQL Server Error Logs. DBA can execute the XP_READERRORLOG extended stored procedure to read the SQL Server Error Log and search for its location used by the instance of SQL Server.

USE master
Go
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file', NULL, NULL, N'asc'
Go

For other ways to read and find error log location please our article https://sqlserver-dba.co.uk/error-log/sql-server-identify-location-of-the-sql-server-error-log-file.html

SQL Server Error Code and solution summary


SQL Server Error: 3201
Severity: 16
Event Logged or not: No
Description:
Cannot open backup device ‘%ls’. Operating system error %ls.

We will need to map the network drive from SQL  Server to be visible to SQL Server for taking backups. Steps above..

Leave a Reply

Your email address will not be published.