Could not update the distribution database subscription table. The subscription status could not be changed.

简介: 在一个测试服务器删除发布(Publication)时遇到下面错误,具体如下所示 标题: Microsoft SQL Server Management Studio ------------------------------ Could not delete publication 'RPL_GES_MIS_QCSDB'.

在一个测试服务器删除发布(Publication)时遇到下面错误,具体如下所示

image

标题: Microsoft SQL Server Management Studio
 
------------------------------
 
Could not delete publication 'RPL_GES_MIS_QCSDB'.
 
------------------------------
 
其他信息:
 
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
 
------------------------------
 
'xxxxx' is not defined as a Subscriber for 'xxxx\xxxx'.
 
Could not update the distribution database subscription table. The subscription status could not be changed.
 
Changed database context to 'xxxx'. (Microsoft SQL Server,错误: 20032)

 

 

其实这个环境是克隆过来,生产服务器是配置过发布订阅,复制克隆后,修改过服务器名称,另外在实际服务器上,并没有真的订阅这个Publication,当然这个测试环境的复制可能还被人折腾过。这个就是我当前案例的环境。

遇到这个错误时,可以使用下面脚本删除所有Subcrition后,

USE DataBaseName;
GO
 
EXEC sp_dropsubscription 
    @publication =N'RPL_GES_MIS_QCSDB',  --根据具体情况填写Publication名称
    @article= N'all',
    @subscriber=N'all',
    @ignore_distributor=1;

 

然后手工删除分发服务器(当然也可以使用下面脚本删除,根据实际情况,修改对应的数据库名称)。

use DatabaseName;
 
GO
 
exec sp_droppublication @publication = N'RPL_GES_MIS_QCSDB', @ignore_distributor = 1
 
exec sp_helpreplicationdboption @dbname = N'DatabaseName', @reserved = 1
 
use [DatabaseName]
 
exec sp_helppublication 
 
use [DatabaseName]
 
exec sp_replicationdboption @dbname = N'DatabaseName', @optname = N'publish', @value = N'false'
 
 

相关文章
|
SQL 数据库
SQL logic error or missing database no such table: xxx
原文:SQL logic error or missing database no such table: xxx System.
3516 0
|
关系型数据库 数据库 PostgreSQL
|
关系型数据库 数据库 PostgreSQL
|
SQL
sql script: select database select all table
---表中的主鍵 select [name],'tablekey'= (select top 1 COLUMN_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where TABLE_NAME = sysobjects.name) from sysobjects where type='U' --所有表 selec
1008 0
|
7月前
|
SQL Oracle 关系型数据库
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database (
97 2
|
7月前
|
Oracle 关系型数据库
19c 开启Oracle Database Vault
19c 开启Oracle Database Vault
170 1
|
7月前
|
SQL Oracle 关系型数据库
Connect to Autonomous Database Using Oracle Database Tools
Connect to Autonomous Database Using Oracle Database Tools
66 1
|
6月前
|
Oracle 关系型数据库 Linux
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
Requirements for Installing Oracle Database/Client 19c on OL8 or RHEL8 64-bit (x86-64) (Doc ID 2668780.1)
57 0
|
7月前
|
人工智能 Oracle 关系型数据库
一篇文章弄懂Oracle和PostgreSQL的Database Link
一篇文章弄懂Oracle和PostgreSQL的Database Link