all groups > sql server replication > april 2004 >
You're in the

sql server replication

group:

deleting restored dB that is read-only


deleting restored dB that is read-only larry
4/14/2004 1:42:14 PM
sql server replication:
I restored a dB and set it as read-only. The dB is being
used for replication, so in my Replication Monitor in EP,
all the publications are listed numerous times. I cannot
detach the dB because it is being used for replication.
I cannot use sp_removedbreplication because it is read-
only. So the question is, how do I remove the dB?? How
Re: deleting restored dB that is read-only Paul Ibison
4/15/2004 8:53:12 AM
Larry,

this should remove the database for you (just need to replace xxx with your
database name).

alter database xxx set read_write with rollback immediate
go
exec sp_removedbreplication xxx
go
use master
go
drop database xxx
go

Regards,
Paul Ibison

Re: deleting restored dB that is read-only anonymous NO[at]SPAM discussions.microsoft.com
4/15/2004 11:20:22 AM
Paul,

I ran the commands you suggested and received the
following errors...


Server: Msg 5063, Level 16, State 1, Line 1
Database 'StoreMain-lpr10' is in warm standby. A warm-
standby database is read-only.
Server: Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.
Server: Msg 3906, Level 16, State 1, Procedure
sp_dropsubscription, Line 441
Could not run BEGIN TRANSACTION in database 'StoreMain-
lpr10' because the database is read-only.
Server: Msg 3724, Level 16, State 3, Line 1
Cannot drop the database 'StoreMain-lpr10' because it is
being used for replication.


HELP!!!

Re: deleting restored dB that is read-only Paul Ibison
4/15/2004 8:18:13 PM
Larry,
this database is in RO mode because it has been restored without recovery.
The following script should be run before my original one:

alter database StoreMain-lpr10 set single_user with rollback immediate
go
restore database StoreMain-lpr10 with recovery
go

Regards,
Paul Ibison

AddThis Social Bookmark Button