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‘.

 

------------------------------

 

其他信息:

 

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‘

 

 

时间: 2025-01-03 22:25:49

Could not update the distribution database subscription table. The subscription status could not be changed.的相关文章

MySQL之创建Database与Table

一.Database (1)创建数据库 create database [database name]; (2)选择数据库 use [database name] (3)显示数据库 show databases; (4)显示数据库创建语句 show create database [database name]; 二.Table (1)创建表 create table [table name] ( [column name] [column type]([column length]), ...

sql--select into,create database,create table,Constraints

SQL SELECT INTO 语句可用于创建表的备份复件.SELECT INTO 语句SELECT INTO 语句从一个表中选取数据,然后把数据插入另一个表中.SELECT INTO 语句常用于创建表的备份复件或者用于对记录进行存档. SQL SELECT INTO 语法 您可以把所有的列插入新表:SELECT *INTO new_table_name [IN externaldatabase] FROM old_tablename或者只把希望的列插入新表:SELECT column_name

MySql: show databases/tables use database desc table

1. show databases mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema || test |+--------------------+4 rows in set (0.00 sec) 2. use database_name mysql> use testDatabase

[转]实现Hive数据同步更新的shell脚本

引言: 上一篇文章<Sqoop1.4.4 实现将 Oracle10g 中的增量数据导入 Hive0.13.1 ,并更新Hive中的主表>http://www.linuxidc.com/Linux/2014-09/106282.htm描述了增量更新Hive表的原理和Sqoop,Hive命令,本文基于上一篇文章的内容实现了shell脚本的编写,稍加修改就可用于实际工程. shell脚本 #!/bin/bash #Please set the synchronize interval,unit is

【甘道夫】实现Hive数据同步更新的shell脚本

引言: 上一篇文章<[甘道夫]Sqoop1.4.4 实现将 Oracle10g 中的增量数据导入 Hive0.13.1 ,并更新Hive中的主表>http://blog.csdn.net/u010967382/article/details/38735381 描述了增量更新Hive表的原理和Sqoop,Hive命令,本文基于上一篇文章的内容实现了shell脚本的编写,稍加修改就可用于实际工程. ***欢迎转载,请注明来源***    http://blog.csdn.net/u01096738

[Hive - LanguageManual] Create/Drop/Alter Database Create/Drop/Truncate Table

Hive Data Definition Language Hive Data Definition Language Overview Create/Drop/Alter Database Create/Drop/Truncate Table Alter Table/Partition/Column Create/Drop/Alter View Create/Drop/Alter Index Create/Drop Function Create/Drop/Grant/Revoke Roles

How to: Update an .edmx File when the Database Changes

https://msdn.microsoft.com/en-us/library/cc716697.aspx In the Model Browser, right-click the .edmx file and select Update Model from Database. The Update Model Wizard starts. If there is no database connection specified, the Choose Your Database Conn

Redshift中查看database、schema、table数据大小

1. 查看当前数据库大小以及记录行数 select trim(pgdb.datname) as database, sum(b.mbytes) as mbytes, sum(a.rows) as rows from (select db_id, id, name, sum(rows) as rows from stv_tbl_perm a group by db_id, id, name) as a join pg_class as pgc on pgc.oid = a.id join pg_n

设置Distribution clean up 每次删除Command的数量

Replication Job “Distribution clean up: distribution” 默认设置是,每10minutes运行一次,每次删除2000个Command.这对于有1.9亿条Commands的distribution来说,显得力不从心.需要修改 PROCEDURE [dbo].[sp_MSdelete_publisherdb_trans],重新设置每次删除的Commands 数量,我的设置是每次删除20000 command. 设置的过程比较简单,在PROCEDURE