Sql-server – Integrity checks permissions issue

dbcc-checkdbpermissionssql server

I am running Hallengren's IntegrityChecks job which fails with the following error:

CREATE FILE encountered operating system error 5(Access is denied.) while attempting to open or create the physical file 'T:\SQL_Data\Example.mdf_MSSQL_DBCC9'.

SQL Server Agent service account is NT Service\SQLAgent$INSTANCENAME, which has full access to the T drive including all sub folders.

Any idea how to overcome this?

Thanks

Best Answer

SQL Server Agent will schedule a job and cause it to be run by the SQL Server service - the database engine. The account which is trying to create this snapshot for your CHECKDB to be run concurrently with users in it is not the Agent service, but the SQL Server service. So look to see who your SQL Server service is running as and what permissions that account has.