Databases with multiple backslash characters can be protected but fail during restore with DPM 2010

Article ID: 2550085
Expand all | Collapse all

Symptoms

When you create a new SQL database (or it is created automatically by an application), and there are multiple backslash (\) characters defined in the database data or log file physical path (like C:\\SQL\test.mdf), you will encounter the following error when you protect this database with System Center Data Protection Manager 2010 and try to recover it to an alternate SQL instance.  After you start the recovery process you will see an error in DPM console:

The VSS application writer or the VSS provider is in a bad state. Either it was already in a bad state or it entered a bad state during the current operation. (ID 30111)

Also on the target SQL server, where the database cannot be restored a SQLWRITER 24583 error event is logged in the Application log with the following message:

Sqllib error: OLEDB Error encountered calling ICommandText::Execute. hr = 0x80040e14. SQLSTATE: 42000, Native Error: 3013
Error state: 1, Severity: 16
Source: Microsoft SQL Server Native Client 10.0
Error message: RESTORE DATABASE is terminating abnormally.
SQLSTATE: 42000, Native Error: 3119
Error state: 1, Severity: 16
Source: Microsoft SQL Server Native Client 10.0
Error message: Problems were identified while planning for the RESTORE statement. Previous messages provide details.
SQLSTATE: 42000, Native Error: 3156
Error state: 4, Severity: 16
Source: Microsoft SQL Server Native Client 10.0
Error message: File 'DPMBackup_log' cannot be restored to 'C:\\DPMBackup\DPMBackup_log.ldf'. Use WITH MOVE to identify a valid location for the file.
SQLSTATE: 42000, Native Error: 1834
Error state: 1, Severity: 16
Source: Microsoft SQL Server Native Client 10.0
Error message: The file 'C:\\DPMBackup\DPMBackup_log.ldf' cannot be overwritten. It is being used by database 'DPMBackup'.
SQLSTATE: 42000, Native Error: 3156
Error state: 4, Severity: 16
Source: Microsoft SQL Server Native Client 10.0
Error message: File 'DPMBackup' cannot be restored to 'C:\\DPMBackup\DPMBackup.mdf'. Use WITH MOVE to identify a valid location for the file.
SQLSTATE: 42000, Native Error: 1834
Error state: 1, Severity: 16
Source: Microsoft SQL Server Native Client 10.0
Error message: The file 'C:\\DPMBackup\DPMBackup.mdf' cannot be overwritten. It is being used by database 'DPMBackup'.
 

Note that backup jobs will run without any issues, and when the database is added, SQL server will accept the path with multiple backslash characters and create the database. Later when you check the physical path of the database files in SQL Management Studio, you will see only one backslash character, as the GUI hides the others.

You can check the original physical path of the database files with the following query:

SELECT * FROM Sys.Database_files

As SQL VSS Writer returns with the path visible in the result of the above query, DPM will also use this path for recovery processes.

Resolution

To avoid the above error, always add new databases with single backslash characters in the database file path, and also ensure application-generated databases also use only one backslash character.

The above error does not occur if you try to recover the database to the original SQL instance or to a network folder.

If you already protected a database which contains multiple backslashes in the physical path for the database files, you will need to recover it to the original SQL instance, or if it is not available, then restore to a network folder and then attach the database files to a different SQL instance.

In the case you restore to the original instance, change the physical path for the database files after these are restored to not contain multiple backslash characters and then you will be able to recover further backups to an alternate SQL instance. You can quickly achieve this by detaching the database and attaching it with single backslashes in the path again.

More Information

If Secondary protection is enabled, DPMMetadata.xml will be generated on the Primary DPM server.  Here you can also see the path used by DPM for SQL database protection.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2550085 - Last Review: May 31, 2011 - Revision: 2.0
Keywords: 
KB2550085

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com