0

I neede some help with this problem.

Using MS SQL Server, I have a replication setup and working from Server A to server B. There is a clean up Job that has to run on the agent -

'Distribution clean up: distribution'

and it is failing with the error

Message
Executed as user: domain\servername$. Could not remove directory '\\servername\repldata\unc\servername$PublicationName\20240626113002\'. Check the security context of xp_cmdshell and close other processes that may be accessing the directory. [SQLSTATE 42000] (Error 20015)  Replication-@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum. 1=only check rowcou: agent distribution@rowcount_only parameter must be the value 0,1, or 2. 0=7.0 compatible checksum. 1=only  scheduled for retry. Could not clean up the distribution transaction tables. [SQLSTATE 01000] (Message 14152).  The step failed.

On the server, in that directory I have permission set correctly (I think) for the service user 'domain\servername'. enter image description here

The Job step "Run as" option is blank, and is not giving me ability to select a user. enter image description here

And If I attempt to run that stored procedure run manually, EXEC dbo.sp_MSdistribution_cleanup @min_distretention = 0, @max_distretention = 72, I get the same error.

I realized that that 'domain\servername$' is not the user under which the SQL Server is running, not the user under which an agent is running. and hence, I do not know how the job (or rather a step) is set to run under it. So, I would not mind chaning it to something, I feel like I have more control over.

I am somewhat lost at this point. I feel something is incomplete, but I don't know what

4
  • domain\servername$ is a computer object, not a service account. Commented Aug 26 at 15:36
  • @SeanGallardy, thanks. How can it help ? Commented Aug 26 at 15:52
  • You stated you gave the service account permissions, but it's not the correct account, you're failing to give the computer account permissions. You even state this in your question. Commented Aug 26 at 16:05
  • I realized that that 'domain\servername$' is not the user under which the SQL Server is running, not the user under which an agent is running. and hence, I do not know how the job (or rather a step) is set to run under it. So, I would not mind chaning it to something, I feel like I have more control over. Commented Aug 27 at 17:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.