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'.
The Job step "Run as" option is blank, and is not giving me ability to select a user.
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
domain\servername$
is a computer object, not a service account.'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.