May 11, 2004 at 4:46 am
When I try to drop the XXX database SQLServer returns me this error message:
Server: Msg 3724, Level 16, State 3, Line 1
Cannot drop the database XXX because it is being used for replication.
I've also tried to execute the following code but nothing has changed.
exec sp_removedbreplication 'XXX'
go
exec sp_dboption 'XXX','published',false
go
exec sp_dboption 'XXX','merge publish',false
go
The XXX DB is a restore of "Distribution" database of a Production Server that is a publication server!
Someone can help me?
Thanks for all suggestions!!!
Frank
May 11, 2004 at 6:43 am
Please, run sp_helpreplicationdb to check with databases are marked for replication.
Distribution is for replication but should not be marked for replication, so you should be able to restore it at any time.
May 11, 2004 at 9:23 am
I want to drop XXX Db that contains a restore of "distribution" database of a production server. I've tried to use sp_helpreplicationdb but I'm not be able to drop XXX DB.
Can you give me some more advices?
Thanks.
Frank
May 11, 2004 at 9:33 am
what type of replication?
What I've had to run to make sure my scripts are starting clean for merge replication are as follows:
'Drop any subscriptions
exec sp_dropmergesubscription @publication = N'<publication>''
'Drop the publication
exec sp_dropmergepublication @publication = N'<publication>'
'Set the DB to not be for replication
exe sp_replicationdboption @dbname= N'<db>' @optname=N'merge publish' @value = 'FALSE'
If you're using trans rep I believe the commands are similar.
Also if you go into EM and right-click the publication you can choose 'generate script' which will give you the option to see the script for creating or droping the publications.
regards,
Chris
May 12, 2004 at 4:41 am
although it's not recommended, sometimes you 'll have to update the REPLINFO column in SYSOBJECTS.
Maj.
May 28, 2004 at 7:00 am
You can restore another database backup, that don`t have replications configured, over the database that you want to delete(with the "force restore over existing database" option marked). Doing this you will overwrite the sysobjects lines that saves the replication parameters and the SQL Server will alow you to delete the database.
I hope It`s easy to understand..
Mila.
May 28, 2004 at 9:37 am
Nonenone!! Thanks a lot!!!
August 2, 2007 at 12:23 am
take the datbase offline and then drop it.
raja
August 3, 2007 at 5:01 pm
Set Category for the database to 0 in master.dbo.sysdatabases. Then you can delete it.
February 7, 2008 at 3:08 am
Hi
I have the same problem
I tried the following
update sysdatabases
set Category = 0
where dbid = 13
but I get the following error
Msg 259, Level 16, State 1, Line 1
Ad hoc updates to system catalogs are not allowed.
February 10, 2008 at 10:24 pm
write this and then try to update the system table
sp_configure 'allow updates',1
reconfigure with override
Then after the update execute this
sp_configure 'allow updates',0
reconfigure with override
June 27, 2008 at 2:41 pm
Hi,
Try to setup Server Seeting-> Server behaiver->allow modifications to be made directly to system catalogs
Richard Yang
July 17, 2008 at 2:11 pm
This will let you update. This is dangerous so make sure to run allow updates 0
sp_configure 'allow updates',1
GO
RECONFIGURE WITH OVERRIDE
GO
update sysdatabases set category=0 where name = 'xxx'
sp_configure 'allow updates',0
GO
RECONFIGURE WITH OVERRIDE
GO
July 27, 2008 at 8:34 pm
Is this any help?
http://www.dbforums.com/showthread.php?t=708918
Graham Okely B App Sc
Senior Database Administrator
January 8, 2009 at 3:28 am
I got the same problem.I tried to solved it.Then I checked "Replication" item,found that I set up the Publications rule for the detached database.So you can check the Publication and Subscriptions.
Viewing 15 posts - 1 through 15 (of 22 total)
You must be logged in to reply to this topic. Login to reply