Hi Baisong,
Here is the latest message from the agent history (it
looks like its the same as last time except the name of
the folder at the end has changed:
Executed as user: '@LOCAL_ACCT'. Could not remove
directory '\\SERVER_NAME\C$\MSSQL\Repl\unc\REPLICATION_NAME
_Tabl3d0a0ad\20040128210012\'. Check the security context
of xp_cmdshell and close other processes that may be
accessing the directory. [SQLSTATE 42000] (Error 20015)
Associated statement is not prepared [SQLSTATE HY007]
(Error 0) 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.
I double checked to see which account is the owner of the
agent by:
1) In Enterprise Manager...opening 'Replication Monitor'-
[quoted text, click to view] >'Agent'->' Miscellaneous Agents'
2) right-clicking 'distribution clean up: distribution'
3) choosing 'agent properties'
4) checking owner under the general tab
The owner of the agent is 'sa'.
Next, I double checked to see which account runs SQL
Server Agent by:
1) In Enterprise Manager...opening 'Management'
2) right-clicking 'SQL Server Agent'
3) choosing 'properties'
4) under the 'general' tab...I can see the service startup
account
The service startup account is a local windows account.
[Lets refer to the local account as "@LOCAL_ACCT" as to
not use the real name in the forum :)]
How do I log into Query Analyzer using "@LOCAL_ACCT" in
order to test if xp_cmdshell can READ and WRITE to that
directory? I know how to do this using a SQL Server
authenticated login...but not as a windows account...
I look forward to hearing back from you...
Thanks,
John
[quoted text, click to view] >-----Original Message-----
>Hi John,
>
>Thank you for you feedback.
>
>Well, since no other processes are using the directory,
the possiblity of
>this factor could be ignored. The 'sa' could be the owner
of the agent
>owner, or the job owner of the clean up job ( you could
unfolder the
>'Replication Monitor'->'Agent'->' Miscellaneous Agents',
right-click the
>'distribution clean up: distribution', choose 'agent
properties' and check
>it in the 'General' tab; Or you could
unfolder 'Management'->'SQL Server
>Agent'->'Job', right-click the job 'distribution clean
up: distribution'
>and in the 'General' tab, checking the owner). However,
as I mentioned
>before, that it will finally run 'xp_cmdshell' to delete
the directory, you
>should check the account which start the SQL Server Agent.
>
>You could get this information by right-click the 'SQL
Server Agent' in the
>'Management' and choose 'Properties', in the 'General'
tab, you will see
>the Start Service Account. Please confirm this account
could run
>'xp_cmdshell' to READ and WRITE the directory instead of
the job owner.
>Also, could you provide the agent 'Distribution Clean Up:
distribution''s
>history by right-click it and choose the 'Agent History'?
>
>Looking forward to your reply! Thanks
>
>Best regards
>
>Baisong Wei
>Microsoft Online Support
>----------------------------------------------------
>Get Secure! -
www.microsoft.com/security >This posting is provided "as is" with no warranties and
confers no rights.
>Please reply to newsgroups only. Thanks.
>
>
>.
Hi John,
Thank you for you post.
Could you please provide the job history? If the start service account is
running, you will see the steps information of how the job runs ( Note that
the 'Distribution clean up: Distribution' is actually a job). Please
right-click the 'Distribution clean up: Distribution' Agent in the
'Replication Monitor'->'Agents'->'Miscellenous Agents', and choose 'Agent
History'. You would see information of the job steps, and see the message
like 'The job succeeded. The Job was invoked by user <DomainName\UserName>.
The last step to run was step 1(Run agent.).' ( Note the
<DomainName\UserName> could be a <MachineName\UserName> as a local
account). If you could see the history of the 'Distribution clean up:
Distribution'. Could you please provide the history and if the job ran
successful, the job is invoked by which user?
There are two method to start the SQL Server Agent Service, if the job
owner is within SQL Server system administration role, all the job will run
by the Agent Start Service account. If it is not within the SQL Server
system administration role, you can add it by unfolder 'Management', right
'SQL Server Agent', choose 'properties', in the 'job system' tab, in the
'Non-SysAdmin job step proxy account', uncheck the and enter the password
For the error message, could you please provide the information of which
account you use to login into you windows, then open the Enterprise
Manager, the manually start the 'Distribution clean up: Distribution' agent
and get the error? As for the service start account you get from you post,
you could login into you windows, open Query Analyzer by 'windows
authentication' and run 'xp_cmdshell' (exec xp_cmdshell 'dir c:\') to check
if it has the permission to run it.
If you want to know clear what happened in details, please use profiler to
catch which T-SQL statement is running and by who.
Looking forward to your response.
Best regards
Baisong Wei
Microsoft Online Support
----------------------------------------------------
Get Secure! -
www.microsoft.com/security This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only. Thanks.