SQL Server 2012 とレプリケーション プロセスを使用しています。現在、レプリケーション プロセスは正常に機能していますが、このレプリケーションを削除したいと考えています。つまり、スクリプトを使用したすべての出版物、サブスクリプション、および記事を削除したいと考えています。このサイトhttp://support.microsoft.com/kb/324401を調べて、次のスクリプトを試しました
:setvar PublisherDatabase "AdventureWorks2012"
:setvar SubscriberServer "HYDHTC0131320D\MSSQLSERVER2"
use [$(PublisherDatabase)]
--Drop all subscriptions
exec sp_dropsubscription
@publication = N'TestPubs',
@article = N'all',
--@subscriber = [$(SubscriberServer)]
@subscriber = N'all',
@destination_db = N'all'
--Drop publication
if exists (Select 1 From SysPublications where name = N'TestPubs')
EXEC sp_droppublication @publication = N'TestPubs'
EXEC sp_replicationdboption @dbname = [$(PublisherDatabase)], @optname = N'publish', @value = N'false'
--Drop subscriber entry
EXEC sp_dropsubscriber @subscriber = [$(SubscriberServer)]
--Drop distributor
EXEC sp_dropdistributor @no_checks = 1
上記のスクリプトを実行した後、次のエラーが発生します。
Only one Log Reader Agent or log-related procedure (sp_repldone, sp_replcmds, and sp_replshowcmds) can connect to a database at a time. If you executed a log-related procedure, drop the connection over which the procedure was executed or execute sp_replflush over that connection before starting the Log Reader Agent or executing another log-related procedure.
Msg 18752, Level 16, State 1, Procedure sp_replcmds, Line 1
Only one Log Reader Agent or log-related procedure (sp_repldone, sp_replcmds, and sp_replshowcmds) can connect to a database at a time. If you executed a log-related procedure, drop the connection over which the procedure was executed or execute sp_replflush over that connection before starting the Log Reader Agent or executing another log-related procedure.
The Subscriber was dropped.
Msg 20015, Level 16, State 1, Procedure
sp_MSreplremoveuncdir, Line 83
Could not remove directory 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\ReplData\unc\HYDHTC0131320D_ADVENTUREWORKS2012_TESTPUBS\20120719152739\'. Check the security context of xp_cmdshell and close other processes that may be accessing the directory.
詳細については、このスクリーンショットを確認してください
誰でもこれらの問題を解決するのを手伝ってもらえますか