Occasionally checks database jobs for failures every day and finds errors
[SQL]View Plaincopy
- Select Top Ten job_id,run_date,run_time,run_duration,step_name,message
- From msdb: sysjobhistory where run_status = 0
- ORDER by run_date desc,run_time desc
The job failed. Plan 12 (replication agent schedule. ) called the job. The last Run is Step 1 (run the agent. )。.
was executed as user Ntauthority\networkservice.
Unable to delete directory ' d:\database\repldata\unc\*****************************\20150206021846\ '.
Review the security context of the xp_cmdshell and close other processes that may be accessing the directory.
[SQLSTATE 42000] (Error 20015). The step failed.
Error log message:
[email protected]_only parameter value must be 0, 1 or 2. 0=7.0 compatible checksum. 1= checks only the row count. 2= The new checksum feature introduced in version 8.0. : Agent [Email protected]_only parameter value must be 0, 1, or 2. 0=7.0 compatible checksum. 1= checks only the row count. 2= The new checksum feature introduced in version 8.0. Scheduled for retry. The Distribution transaction table could not be cleared.
[SQL]View Plaincopy
- --View the jobs performed
- SELECT * from msdb.dbo.sysjobs where job_id = ' dc0df572-9339-46ed-84e7-2c1ed622c067 '
View SQL Server Agent account, NT authority\network SERVICE
Find this directory, is the snapshot directory, has not been used for a long time. A few days ago there was initialization used, today the snapshot expires, and the distribution cleanup runs deleted.
The Agent account NT Authority\Network SERVICE does not have permission to manipulate folders
Add User Object NT Authority\Network SERVICE
Grant all permissions
OK, now execute [distribution cleanup: distribution] job, success!
SQL Server Agent performs [distribution cleanup: distribution] Unable to delete snapshot file