I used the Maintenance Plan Wizard under SQL2014 to create a simple maintenance plan that once a week:
- Check Database Integrity including indexes
- Rebuild Index
- Clean Up History
When the job runs this is the error message. Any ideas why it is failing? I did check and NT SERVICE\SQLSERVERAGENT is a member of the sysadmin group as it should be
Executed as user: NT SERVICE\SQLSERVERAGENT. ...2 01:01:31.89 Source: Check Database Integrity Executing query "USE [vc2] ".: 50% complete End Progress Error: 2016-05-12 01:01:51.89 Code: 0xC002F210 Source: Check Database Integrity Execute SQL Task Description: Executing the query "DBCC CHECKDB(N'vc2') WITH NO_INFOMSGS " failed with the following error: "A database snapshot cannot be created because it failed to start. A database snapshot cannot be created because it failed to start. CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'E:\vc2.mdf_MSSQL_DBCC29'. The database snapshot for online checks could not be created. Either the reason is given in a previous error or one of the underlying volumes does not support sparse files or alternate streams. Attempting to get exclusive access to run checks offline. The database could not be exclusively locked to perform the operation. Check statement aborted. The database could not be checked as a database snapshot could not be created and the database or table could not be locked. See Books Online for details of when this behavior is expected and what workarounds exist. Also see previous errors for more details.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.