`
baobaojinjin
  • 浏览: 142200 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

SQL Server删除distribution数据库

 
阅读更多

在数据库服务器删除复制(发布订阅)后,如何删除掉数据库distribution呢?如果你通过SSMS工具去删除数据库distribution,你会发现根本没有删除选项。 下面介绍一下删除distribution的步骤

 

步骤1: 查看相关订阅服务器的信息,如果还存在对应的订阅服务器,从注册的服务器中删除订阅服务器名称

exec sp_helpsubscriberinfo ;
go
 
exec sp_dropsubscriber 'SubscriberName';
go

 

步骤2: 查看分发服务器的发布服务器的属性

exec sp_helpdistpublisher;

 

步骤3: 删除分发发布服务器

exec sp_dropdistpublisher  @publisher = 'PublisherName'

 

步骤4: 使用sp_dropdistributiondb删除数据库distribution

use master;
 
go
 
exec sp_dropdistributiondb @database = N'distribution'
 
go
 
use master; 
 
go 
 
exec sp_dropdistributor @no_checks = 1, @ignore_distributor = 1 
 
go
 

 

注意事项:

1:错误信息“Could not drop the distribution database 'distribution'. This distributor database is associated with a Publisher.”

 

exec sp_dropdistributiondb @database = N'distribution'

GO

消息 14120,级别 16,状态 1,过程 sp_dropdistributiondb,第 85 行

Could not drop the distribution database 'distribution'. This distributor database is associated with a Publisher.

clipboard

出现这个错误,是因为必须先删除对应的分发发布服务器,否则就会出现下面错误。

 

2:错误信息“Cannot drop the distribution database 'distribution' because it is currently in use”

 

exec sp_dropdistributiondb @database = N'distribution'

go

消息 21122,级别 16,状态 1,过程 sp_dropdistributiondb,第 124 行

Cannot drop the distribution database 'distribution' because it is currently in use.

 

出现上面情况,是因为会话窗口使用的数据库是distribution,你可以指定会话窗口的数据库为master或使用下面语句即可解决问题。

use master; 
 
go 
 
exec sp_dropdistributiondb @database = N'distribution' 
 
go
 

 

另外由于某些原因,导致无法使用sp_dropdistributiondb删除distribution数据库。此时可以使用下面方式强制删除数据库distribution。

clipboard[1]

use master 
go 
 
alter database distribution set offline; 
go
 
drop database distribution;

 

use master;
go
 
alter database distribution set single_user with rollback immediate
go
 
drop database distribution;
go
分享到:
评论

相关推荐

    SQLServer系统数据库恢复.pdf

    SQLServer系统数据库恢复 系统数据库恢复 标签:SQL SERVER/MSSQL SERVER/数据库/DBA/故障恢复/master 概述 概述 SQL Server 维护⼀组系统级数据库(称为"系统数据库"),这些数据库对于服务器实例的运⾏⾄关重要。...

    SqlServer系统数据库的作用深入了解

    至于SqlServer系统数据库的作用可以从以下几个部分介绍下:Master/Model/Tempdb/Distribution/Msdb;感兴趣的你可以参考下哦,不妨可以充充电了

    SQL Server Data Access Components 2.45.22 for d6

    Applications with SDAC components access server directly:[SQL Server] <-> [OLE DB] <-> [Client application]Using SQL Server Data Access gives you the following advantages: - No distribution, ...

    监控SQL Server事务复制

    微软在distribution数据库提供了系统存储过程dbo.sp_replmonitorsubscriptionpendingcmds,用于返回订阅上等待的命令数,以及需要投递所有这些命令到订阅者的时间的预估。我创建了一个每10分钟运行的作业,保存状态...

    SDAC2.45 1.19

    Applications with SDAC components access server directly:[SQL Server] <-> [OLE DB] <-> [Client application]Using SQL Server Data Access gives you the following advantages: - No distribution, ...

    各种数据库连接方式

    附件中是描述各种数据库之间的相互连接方式,及如何处理相应的业务

    数据库系统概念Database System Concept(英文第6版)文字版

    Database System Concepts——数据库系统概念第六版(英文版) 作者: Abraham Silberschatz (Yale University) Henry F. Korth (Lehigh University) S. Sudarshan (Indian Institute of Technology, Bombay) 本书...

    Eclipse整合S2SH例子(直接运行)

    数据库sqlserver 2008 spring-framework-3.1.3.RELEASE struts-2.3.7-all hibernate-distribution-3.6.0.Beta3-dis jdk 7.0 tomcat 7 数据库:Test 表名:userInfo CREATE TABLE [dbo].[userInfo]( [id] [int]...

    计算机科学与技术--企业门户网站的设计与实现.doc

    本企业门户网站是采用.NET所见即所得的开发工具和平台 ,采用SQL Server数据库连接数据,网站的图片采用PhotoShop CS2进行处理,一些动态特效是采用JavaScript实现的。 本设计(文档)详细介绍了企业门户网站的所有...

    ODAC 5.1.0.6

    So in consequence of BDE community get unable server specific features, use more resources, reduce speed of processing data, cumbrous distribution of an application and its administration. New ...

    外文文献翻译+参考案例

    NET can handle the N layer's data architecture which doesn't join that Web application program requires, thus when visiting the database of SQL SERVER, superior performance has gotten extensive ...

    JSP校园交易平台论文

    3.2.3 Microsoft SQL Server 2000 19 第四章 校园电子商务平台设计和实现…………………………………...21 4.1 系统数据库设计 21 4.2 用户界面设计 27 4.3 系统设计模式分析和实现 31 4.3.1 模式分析 31 ...

    spring chm文档

    Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright...

Global site tag (gtag.js) - Google Analytics