RE: Distibution db cleanup will not run

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: John (jpappas_at_rd.com)
Date: 02/01/04


Date: Sun, 1 Feb 2004 12:27:08 -0800

Hi Baisong,

Thanks for your reply. I tried what you said to do:

1)I used filemon to see if there are any other processes
using that directory and there are not
2)I was logged in as the 'sa' account to start the
agent....I logged into Query Analyzer as 'sa' and was able
to succesfully execute 'exec xp_cmdshell 'dir c:\'
3)I was able to execute the following line as 'sa': 'exec
xp_dirtree '\\SERVER_NAME\C$\MSSQL\Repl\unc\REPLICATION_NAM
E_Tabl3d0a0ad\20040125190012\'.

Is this the information you were looking for?

When I was finished checking these things I attempted to
restart the agent again (using sa)and got a similair
message except the directory name it was complaining about
changed
to '\\SERVER_NAME\C$\MSSQL\Repl\unc\REPLICATION_NAME_Tabl3d
0a0ad\20040127190011\'.

I also noticed that the directory it complained about the
first time no longer exists!

Does that make any sense?

I appreciate your help. :)

Thanks,

John
>-----Original Message-----
>Hi John,
>
>Thank you for using the newsgroup and it is my pleasure
to help you with
>you issue.
>
>As my understanding of you problem, you notice that the
Distribution Clean
>Up Agent is not running and you started it manually but
encountered error
>like:
>
>'Executed as user: 'ACCOUNT_NAME'. Could not remove
directory
>'\\SERVER_NAME\C$\MSSQL\Repl\unc\REPLICATION_NAME_Tabl3d0a
0ad\20040125190012
>\'. 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.'
>
>Right?
>
>You are right that the Distribution Clean Up Agent
created automatically
>when replication was setup. It is among the the
Miscellaneous Agents folder
>in Replication Monitor, they are to clean up and monitor
different
>replication processes. Every 10 minutes, the
Distribution Cleanup Agent
>removes replicated commands from the distribution
database (default). The
>Agent also removes all snapshots that have already been
applied to the
>Subscriber from the snapshot folder and that are older
than 72 hours
>(default). Running this Agent ensures that there is space
for new snapshot
>files. It will using using sp_msadd_mergereplcommands
which calls
>xp_cmdshell.
>
>You could right-click the Distributor Clean Up Agent and
choose the 'Agent
>History' to the history of the activity of it. From the
information you
>provided and the error message, I wonder:
>1) You should check if there are any other process that
is using the
>directory, you could use FileMon from:
>http://www.sysinternals.com/ntw2k/source/filemon.shtml
>2) Confirm that this account you start the agent have the
permission to run
>'xp_cmdshell', when login Query Analyzer with this
account, try to run
>'exec xp_cmdshell 'dir c:\'
>3) Confirm that the the account you start the agent have
full control over
>the directory:
>\\SERVER_NAME\C$\MSSQL\Repl\unc\REPLICATION_NAME_Tabl3d0a0
ad\20040125190012\
>
>Hope this helps and I am looking forward to you resply!
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.
>
>
>
>.
>



Relevant Pages

  • Re: Deadlock between Distribution Agent and Distribution Agent Cle
    ... Another option will be to put your distribution database in bulk copy ... Looking for a SQL Server replication book? ... The Distribution Agent Cleanup job code ... and only reading the transactions committed some ...
    (microsoft.public.sqlserver.replication)
  • Re: Error at parameter 93 during datastream processing of paramete
    ... the distribution agent fails with the message. ... Message: Replication-Replication Distribution Subsystem: agent ... Source: ODBC SQL Server Driver ... > pack/hotfix level on each of the servers involved in this replication setup? ...
    (microsoft.public.sqlserver.replication)
  • Re: Agent Deadlock Errors
    ... I am not sure about updating the statistics in the distribution database. ... clean up agent is locking with. ... Looking for a SQL Server replication book? ...
    (microsoft.public.sqlserver.replication)
  • Re: Agent Deadlock Errors
    ... Changed the History Cleanup Agent to run every 10 minutes, ... Changed the Distribution Cleanup Agent to run every 5 minutes, ... Turned off the auto-refresh of the Replication Monitor on my Enterprise ... >>> Looking for a SQL Server replication book? ...
    (microsoft.public.sqlserver.replication)
  • Re: Transactional Replication Issues
    ... distribution agents will allow the snapshot agent to run (fewer processes ... Server Agent configured to run many jobs? ... configured all you replication agents to run under explicit Windows account. ...
    (microsoft.public.sqlserver.replication)