Microsoft SQL Server backup job fails with error message: "SqlServerWriter VSS failed during the 'DoSnapshotSet' phase with error WriterErrorNonRetryable."
Open Windows Events Application log on the SQL Server and check for Event ID 24583 to match any of the following triggers for this event:
1) Cannot create worker thread or Insufficient resources to create UMS scheduler.
Log Name: Application
Source: SQLWRITER
Date: 1/8/2015 3:01:10 PM
Event ID: 24583
Level: Error
Computer: SQL
Description:
Sqllib error: OLEDB Error encountered calling ICommandText::Execute. hr = 0x80040e14. SQLSTATE: 42000, Native Error: 3013
Error state: 1, Severity: 16
Source: Microsoft SQL Native Client
Error message: BACKUP DATABASE is terminating abnormally.
SQLSTATE: 42000, Native Error: 3224
Error state: 1, Severity: 16
Source: Microsoft SQL Native Client
Error message: Cannot create worker thread.
or
Log Name: Application
Source: SQLWRITER
Date: 1/27/2015 1:01:29 AM
Event ID: 24583
Level: Error
Computer: SQL
Description:
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: BACKUP DATABASE is terminating abnormally.
SQLSTATE: 42000, Native Error: 3267
Error state: 1, Severity: 16
Source: Microsoft SQL Server Native Client 10.0
Error message: Insufficient resources to create UMS scheduler.
2) The log for database 'DBName' is not available.
Log Name: Application
Source: SQLWRITER
Date: 2/16/2015 4:34:04 AM
Event ID: 24583
Level: Error
Computer: SQL
Description:
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: BACKUP DATABASE is terminating abnormally.
SQLSTATE: HY000, Native Error: 9001
Error state: 1, Severity: 21
Source: Microsoft SQL Server Native Client 10.0
Error message: The log for database 'DBName' is not available. Check the event log for related error messages. Resolve any errors and restart the database.
3) Database 'DBName' is already open and can only have one user at a time.
Log Name: Application
Source: SQLWRITER
Date: 1/19/2015 8:00:37 AM
Event ID: 24583
Level: Error
Computer: SQL
Description:
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: BACKUP DATABASE is terminating abnormally.
SQLSTATE: 42000, Native Error: 924
Error state: 1, Severity: 14
Source: Microsoft SQL Server Native Client 10.0
Error message: Database 'DBName' is already open and can only have one user at a time.
This error is caused by a variety of SQL SERVER VSS writer issues. In each case, the cause is the SQL configuration or the current state of SQL. The following are possible causes for this error:
1) ERROR: Cannot create worker thread or Insufficient resources to create UMS scheduler.
CAUSE: Limit on 'Max worker threads' of SQL Instance reached or the Microsoft SQL limit of 1200 databases has been exceeded.
2) ERROR: The log for database 'DBName' is not available.
CAUSE: Database 'DBName' is in an inconsistent state or has property Auto Close = True.
3) ERROR: Database 'DBName' is already open and can only have one user at a time.
CAUSE: Database 'DBName' has property Restrict Access = 'SINGLE_USER'. SQLWRITER can not work properly with this database.
1) Cannot create worker thread or Insufficient resources to create UMS scheduler.
Solution
***Please note that 'SqlServerWriter' has a limitation of 1200 databases. If a SQL instance contains more than 1200 databases you can locate them on different volumes and protect them as separate Protection Groups which will allow you to work around the issue.
More information about property 'Max worker threads' can be read here https://msdn.microsoft.com/en-us/library/ms190219.aspx.
2) The log for database 'DBName' is not available.
Solution: Bring the log file back online for the database.
3) Database 'DBName' is already open and can only have one user at a time.
Solution
Please note that SQL Instance can contain many databases with 'SINGLE_USER' mode.You can use the following SQL query to set Restrict Access = 'SINGLE_USER' for all databases (user must have 'sysadmin' role):
DECLARE @name sysname
DECLARE @sql nvarchar(4000)
DECLARE dbCursor CURSOR for SELECT name FROM master.sys.databases WITH (NOLOCK) WHERE user_access != 0
OPEN dbCursor
FETCH dbCursor INTO @name
WHILE @@FETCH_STATUS >= 0
BEGIN
SELECT @sql =
'ALTER DATABASE [' + @name + '] SET MULTI_USER'
EXECUTE (@sql)
FETCH dbCursor INTO @name
END
CLOSE dbCursor
DEALLOCATE dbCursor
SELECT user_access_desc, user_access, name FROM master.SYS.databases WHERE user_access != 0
After the issue is defined and resolved, make sure that the SQLWRITER is in consistent state. On a command prompt, run 'vssadmin list writers'. 'SqlServerWriter' should be in '[1] Stable' state (see picture below). Otherwise, you should restart the service 'SQL Server VSS Writer'.
© ALL RIGHTS RESERVED. 使用条款 隐私 Cookie Preference Center