删除 SQL Server 复制订阅

发布于 2025-01-07 10:57:46 字数 260 浏览 2 评论 0原文

我的计算机上的复制出现问题,SSMS 中显示的许多订阅并不存在。我尝试使用 SSMS 中的 UI 删除它们,还使用一些 T-SQL...但没有成功。这些出版物甚至不再存在(它们位于同一台机器上)。

关于如何删除它们有什么想法吗?

更多信息: 这就是我遇到的情况,有 3 个订阅(SSMS 不会让我查看,因为“它们不存在”)。


在此处输入图像描述

I have a problem with the replication on my machine where I am stuck with a number of subscriptions showing in SSMS that do not exist. I have tried deleting them using the UI in SSMS and also using some T-SQL...but no luck. The publications don't even exist any more (they were on the same machine).

Any ideas on how I could remove them?

More info:
This is the situation I appear to be in where there are 3 subscriptions (that SSMS will not let me look at because 'they do not exist').


enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

风情万种。 2025-01-14 10:57:46

分发数据库中可能有一些孤立的元数据。如果您不再发布任何数据,您可能需要尝试禁用发布和分发< /a> 删除孤立的发布和订阅。

You might have some orphaned metadata in the distribution database. If you're no longer publishing any data you might want to try Disabling Publishing and Distribution to remove the orphaned publications and subscriptions.

ま昔日黯然 2025-01-14 10:57:46

我发现奇怪的是 sp_removedbreplication 不起作用......也许尝试 sp_dropsubscription,并包含 ignore_distributor 参数:

declare @yourServer sysname
set @yourServer = @@servername

exec sp_dropsubscription 
    @publication='UD-ForCMS',
    @article='all',
    @subscriber=@yourServer,
    @destination_db='CMS',
    @ignore_distributor=1

I find it odd that sp_removedbreplication didn't work... maybe try sp_dropsubscription, and include the ignore_distributor parameter:

declare @yourServer sysname
set @yourServer = @@servername

exec sp_dropsubscription 
    @publication='UD-ForCMS',
    @article='all',
    @subscriber=@yourServer,
    @destination_db='CMS',
    @ignore_distributor=1
送你一个梦 2025-01-14 10:57:46

我发现有时复制创建的系统视图对象可能会挂起。停止手动重建复制。我的解决方案是手动删除系统视图syncobj。我建议在删除上面的发布属性之前始终删除订阅和发布,因为我发现项目被遗留下来导致长期问题。

消息 2714,级别 16,状态 3:已经存在一个名为
数据库中的“syncobj_0x3437324238353830”。消息 21745,16 级,
状态 1,过程 sp_MSrepl_articleview,第 272 行无法生成
过滤视图或过程。验证为指定的值
sp_addarticle的@filter_clause参数可以添加到WHERE中
SELECT 语句的子句以生成有效的查询。消息 3931,级别
16、状态 1,过程 sp_MSrepl_articleview,第 401 行 当前
事务无法提交且无法回滚
保存点。回滚整个事务。警告:分布
代理作业已隐式创建并将在 SQL 下运行
服务器代理服务帐户。

I've found sometimes that the system view objects created by the replication can be left hanging. Stopping replication from being manually rebuilt. My solution was to manual drop the system view syncobj. I recommend always dropping the subscriptions and the publication before dropping publication properties above since I've found items get left behind leaving for long term problems.

Msg 2714, Level 16, State 3: There is already an object named
'syncobj_0x3437324238353830' in the database. Msg 21745, Level 16,
State 1, Procedure sp_MSrepl_articleview, Line 272 Cannot generate a
filter view or procedure. Verify that the value specified for the
@filter_clause parameter of sp_addarticle can be added to the WHERE
clause of a SELECT statement to produce a valid query. Msg 3931, Level
16, State 1, Procedure sp_MSrepl_articleview, Line 401 The current
transaction cannot be committed and cannot be rolled back to a
savepoint. Roll back the entire transaction. Warning: The distribution
agent job has been implicitly created and will run under the SQL
Server Agent Service Account.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文