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)的解决办法
一.错误原因 出现这个错误的原因多半是由于指针出现错误,即出现了空指针,也有说是变量没有初始化,笔者碰到的情况是发生了内存溢出. 二.定位方法 一般这种问题直接导致程序崩溃,直接调试,就能找到对应的问 ...
随机推荐
- xfsdump 备份文件系统
实战:xfs 文件系统的备份和恢复 一.xfs 简单介绍. XFS 提供了 xfsdump 和 xfsrestore 工具协助备份 XFS 文件系统中的数据.xfsdump 按 inode顺序备 ...
- UML类图示例
- js设计模式总结4
链模式 链模式:通过在对象方法中将当前对象返回,实现对同一个对象多个方法的链式调用,从而简化多次调用该对象多个方法时的对该对象的多次引用. 具体不多说:主要是方法最后return this; 委托模式 ...
- AutoMapper之集合和数组映射
9.集合和数组映射 在项目中,集合和数组使用的很多的,继续下来就讲讲他们的映射,很简单. /// <summary> /// 源对象 /// </summary> public ...
- html+ashx制作网页发布之后遇到的问题
html+ashx发布之后访问不了ashx文件.(开发时一直是对的) .NETFramework开发时是4.5,服务器上的网站是2.0的. 开始意识到这个问题,发布时选择4.5的Framework.之 ...
- C#winform使用进度条
在用c#做WinFrom开发的过程中.我们经常需要用到进度条(ProgressBar)用于显示进度信息.这时候我们可能就需要用到多线程,如果不采用多线程控制进度条,窗口很容易假死(无法适时看到进度信息 ...
- 定时器--Quartz.Net
这次由于项目的需求:什么定时发送邮件通知,定时筛选取消客户下单未支付的订单 重新捡起定时器,在网上翻来找去找到----Quartz.Net老字号了并不表示它就真的老了哦 github:https:// ...
- MySQL闪退问题的解决
刚刚学习了数据库,并且安装了MySQL,正当高兴之余,发现我的MySQL出现了闪退的显现.上网搜了好久的解决方案.最后解决了这个问题,也舒心了. 问题从这里开始: 接着我打开MySQL,寻思能不能用, ...
- 大数据之 Hadoop学习笔记
1 hadoop生态系统 hdfs 分布式文件系统 hadoop-hdfs-2.7.2.jar mapreduce 分布式计算框架 hadoop-mapreduce-client-app-2.7.2. ...
- 方格填数-2015决赛C语言A组第一题
在2行5列的格子中填入1到10的数字. 要求: 相邻的格子中的数,右边的大于左边的,下边的大于上边的. 如[图1.png]所示的2种,就是合格的填法.请你计算一共有多少种可能的方案.请提交该整数,不要 ...