Error Fix – Replication subscriber does not exist on the server anymore(删除Replication时报错的解决办法)
Recently one of my client has faced weird situation related to SQL Server Replication. Their main database goes down so they started running mirroring database as a primary database, removed subscriber and distributor. Once they have setup primary server back properly, they have restored mirrored database backup to primary server.
Now situation is complicated as subscriber was removed, distributor was removed but in primary server, they are seeing publication as well as subscriber. They have already tried the way I have explained in one of my earlier article “Forcefully remove replication publisher, subscriber and distributor in SQL Server” but no luck.
When they tried to remove publication by pressing “Del” key after selecting “Publication” under “Replication” in SSMS, they faced following message.
TITLE: Microsoft SQL Server Management Studio
------------------------------
Could not delete publication 'SMXPPublisher'. For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1&EvtSrc=Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.Replication.ReplicationMenuItem&EvtID=CantDeletePublication&LinkId=20476
------------------------------ ADDITIONAL INFORMATION: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------ Cannot drop the publication because at least one subscription exists for this publication. Drop all subscriptions to the publication before attempting to drop the publication. If the problem persists, replication metadata might be incorrect; consult Books Online for troubleshooting information.
Changed database context to 'SMXP'. (Microsoft SQL Server, Error: 14005)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.2500&EvtSrc=MSSQLServer&EvtID=14005&LinkId=20476
------------------------------
BUTTONS: OK
------------------------------
Here is the screen capture of the error:

This is obvious message that they can’t delete Publisher until and unless they remove subscriber under publication but the twist is they have already deleted subscriber from the secondary server and primary server were down at that time so effect doesn’t came there so while deleting subscriber from the primary server, they were greeted with following message.
TITLE: Microsoft SQL Server Management Studio
------------------------------
"MARS:SMXPRepl" does not exist on the server anymore. Please refresh its parent tree node.
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1&EvtSrc=Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.Replication.ReplicationMenuItem&EvtID=ObjectNoLongerExists&LinkId=20476
------------------------------ BUTTONS: OK
------------------------------
Here is the capture for this error:

Now, there is a big question, how to remove this replication?
After getting in this clumsy situation, they have called me up to help. They needed very fast solution so I provided undocumented and dirty but yet workable way. Here is what I have asked them to perform and update me with the result.
Here is the small TSQL script I told them to run on primary server in replicated database.
USE master
EXEC sp_removedbreplication @dbname='smxp'
GO sp_dropsubscription @subscriber='smxprepl' sp_droppublication 'smxppublisher'
After executing above given commands, they were facing following error:
--Cannot drop the table 'dbo.MSpeer_lsns' because it is being used for replication.
Well, my suggestion now is to unmark “MSPeer_lsns” object from replication with following command and then try to execute above script to remove and drop replication.
sp_MSunmarkreplinfo 'MSpeer_lsns'
Again there wasn’t luck with them so finally I send them one more TSQL which did the magic.
DROP TABLE sysarticleupdates
DROP TABLE sysarticles
sp_removedbreplication 'smxp'
GO
DROP TABLE syspublications
DROP TABLE sysschemaarticles
DROP TABLE systranschemas
DROP TABLE syssubscriptions
DROP TABLE sysarticlecolumns
DROP TABLE MSpub_identity_range
DROP TABLE MSpeer_response
DROP TABLE MSpeer_request
DROP TABLE MSpeer_lsns
DROP VIEW sysextendedarticlesview
After executing above given TSQL script, it has removed everything related to replication. However, I don’t recommend this script for normal situation.
Error Fix – Replication subscriber does not exist on the server anymore(删除Replication时报错的解决办法)的更多相关文章
- mac 安装mysql 报错“ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock' (2)” 解决办法
首先安装 homebrew 再 brew install mysql 之后连接 mysql 无论是登录还是修改初始密码都会报如下的错误 ERROR 2002 (HY000): Can not conn ...
- error: Failed to start domain lb error: Failed to activate service 'org.freedesktop.machine1': timed out 报错的解决办法
能正常查看kvm虚拟机列表: virsh list 但在执行virsh start lb启动虚拟机时卡顿了好几秒,然后报以下错误: error: Failed to start domain lber ...
- 【LR11】Error -27796: Failed to connect to server"server:port": [10060] Connection timed out错误解决办法
场景描述:被测系统是发布在远程服务器上的,假设IP是10.10.10.10,端口是8066,那么访问地址是http://10.10.10.10:8066/,在control机器上我设置了IP欺骗. ...
- android eclipse 报error loading /system/media/audio/ xxx 错的解决办法。
只针对 报错..error loading /system/media/audio/ xxx.ogg 一步操作 解决烦恼..把 模拟器声音 关了..所有的错 都没了. 包括 关闭按键声音,触摸声音 ...
- 安装“Microsoft SQL Server 2014 Management Objects”时报错"Error Writing to file: Microsoft.SqlServer.XEvent.Linq.dll."
问题: 当安装的软件依赖Microsoft SQL Server 2014 Management Objects时,会把这个组件打进安装包里,但是在服务器上安装时却报如下错误: “Error Writ ...
- [AS3.0] Error #1069: Property onBWDone not found on flash.net.NetConnection and there is no default value.解决办法
在运用FMS录制视频时,假如出现这个错误,最直接的解决办法如下: _netConnection.client = { onBWDone: function():void{ trace("on ...
- 【Runtime Error】打开Matlib7.0运行程序报错的解决办法
1.在C盘建立一个文件夹temp,存放临时文件: 2.右键我的电脑-属性-高级系统设置-环境变量-系统变量,将TEMP.TMP的值改成C:\temp: 3.还是在第2步那里,新建变量,变量名称为BLA ...
- Mac上csv导入mysql提示错误[Error Code] 1290 - The MySQL server is running with the --secure-file-priv option解决办法
1.进入mysql查看secure_file_prive的值 $mysql -u root -p mysql>SHOW VARIABLES LIKE "secure_file_priv ...
- 错误error: Exception at 0x613baa14, code: 0xc0000005: read access violation at: 0x0, flags=0x0 (first chance)的解决办法
一.错误原因 出现这个错误的原因多半是由于指针出现错误,即出现了空指针,也有说是变量没有初始化,笔者碰到的情况是发生了内存溢出. 二.定位方法 一般这种问题直接导致程序崩溃,直接调试,就能找到对应的问 ...
随机推荐
- Hadoop2源码分析-序列化篇
1.概述 上一篇我们了解了MapReduce的相关流程,包含MapReduce V2的重构思路,新的设计架构,与MapReduce V1的区别等内容,今天我们在来学习下在Hadoop V2中的序列化的 ...
- [Python 从入门到放弃] 3. BIF(内建函数)
BIF (built-in functions) Python中提供了70多个内建函数,具备大量的现成功能. BIF不需要专门导入,可以直接使用,拿来就用 1.print() # 在屏幕上打印输出 如 ...
- 在使用Git提交代码的时候犯了个低级错误
今天在使用git提交代码的时候,犯了个很低级的错误,按照一切流程当我add并commit提交代码,最后使用push到远程仓库, 接下来奇怪的事情发生了,push之后,查看远程仓库代码并没有发现提交记录 ...
- zoj Beautiful Number(打表)
题目链接: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2829 题目描述: Mike is very lucky, as ...
- nodejs 的序列化与反序列化
1.序列化 stringify函数的作用就是序列化对象,也就是说将对象类型转换成一个字符串类型(默认的分割符("&")和分配符("=")),先介绍它的基 ...
- Linux-man命令(17)
man命令是Linux下的帮助指令,通过man指令可以查看Linux中的指令帮助.配置文件帮助和编程帮助等信息 可以按章节来搜索手册: man 1: 用户命令(ls,cd,cp,rm,tar等) ma ...
- JavaSE 集合补充点(JDK1.9对集合添加的优化)
通常,我们在代码中创建一个集合(例如,List 或 Set ),并直接用一些元素填充它. 实例化集合,几个 add方法调用,使得代码重复. public class Demo01 { public s ...
- Java基础——可变参数
大家都知道main方法的参数就是一个数组类型的,那么它其实也是可以改成不定参数类型.我试了试,并调用了一些弹出来的方法. public class ClassC2 { public static vo ...
- 【Linux】CentOS安装solr 4.10.3
Solr是什么? Solr 是Apache下的一个顶级开源项目,采用Java开发,它是基于Lucene的全文搜索服务器.Solr提供了比Lucene更为丰富的查询语言,同时实现了可配置.可扩展,并对索 ...
- Alice and Bob(博弈)
Alice and Bob Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65536KB Total submit users ...