Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Replication (2008)
 Delete Distribution Database

Author  Topic 

csaha
Yak Posting Veteran

52 Posts

Posted - 2012-08-30 : 12:15:46
Used the following method to drop distribution database use master go alter database distribution set offline; drop database distribution;
use master
go
alter database distribution set offline;
drop database distribution;
I no longer have distribution database listed in the system databases. However when I try to create a distribution database, rt click on the replication, cannot configure distribution database, but it is showing Distributor Properties. Also in Microsoft SQL Server folder Data distribution database is existing also the distribution database jobs are existing. Please advice how I can delete distribution database.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-08-30 : 12:53:37
You didn't follow the proper procedure. You should have disabled distribution first. Try running sp_dropdistributor.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

prett
Posting Yak Master

212 Posts

Posted - 2012-08-30 : 23:55:32
Check this article, it will help you drop distribution database: http://weblogs.sqlteam.com/tarad/archive/2009/09/02/How-to-remove-a-SQL-Server-distribution-database-if-other.aspx
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-08-31 : 00:03:50
quote:
Originally posted by prett

Check this article, it will help you drop distribution database: http://weblogs.sqlteam.com/tarad/archive/2009/09/02/How-to-remove-a-SQL-Server-distribution-database-if-other.aspx



The OP already ran those commands. And that's from my blog post.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

csaha
Yak Posting Veteran

52 Posts

Posted - 2012-08-31 : 09:23:42
Yes, I ran the above query and I cannot clean up the distribution database. Does that mean that I have to install sqlserver again? Due to lack of knowledge I deleted publisher and Subscriber, instead of running Disable Publishing and Distribution.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-08-31 : 14:08:54
I would open a support case with Microsoft.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

csaha
Yak Posting Veteran

52 Posts

Posted - 2012-09-05 : 09:57:49
Since the datafile was existing in the datafolder I was able to attach the distribution database using the following command:
CREATE DATABASE [distribution] ON
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\distribution.mdf'),
( FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\distribution.ldf')
FOR ATTACH
GO

select * from msdb.dbo.MSdistpublishers
delete from msdb.dbo.MSdistpublishers

sp_removedbreplication
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-09-05 : 12:42:23
Awesome, great work.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -