SQL Server Agent作业执行CmdExec(bat)命令报权限问题

写了一个bat命令,定期去清理一些sql server的dump文件,然后配置成sql server作业,作业执行时报权限错误,具体错误信息如下所示:

 

message

executed as user: nt service\sqlserveragent. the process could not be created for step 1 of job 0xca038c081e9bef4c825da0f543c86d2f (reason: access is denied).  the step failed.

 

 

解决方案:

 

    出现这个问题,是因为运行sql server agent服务的账号(默认为nt service\sqlserveragent,有时候会设置其他账号,例如nt账号为运行sql server agent服务的账号,以实际环境为准)没有权限去执行这个bat命令,只需要给这个bat命令文件授予read & execute的权限即可解决问题。

 

(0)
上一篇 2022年3月21日
下一篇 2022年3月21日

相关推荐