Hi!
I´m working with Sqlserver 2012 SE and Windows 2008 R2
Recently I´ve trying to set a transacctional replication by setting the distribuitor in another server.
For any reason, the replication never worked, and then I decided to erase all the publicatión for then to start again from the beginning.
Then I noticed that my database now has become as a system database and it is placed with the other system databases (master, tempdb, model, msdb) in the Management Studio.
I researched about it and I think that it is because database has been marked as distributor.
The query:
select is_distributor from sys.databases where database_id=6
is returning 1
Is the only database that have this value.
Then I begin again to investigate how to fix this and I note on a recurrent basis that I must use the following procedures, with the result that I will show:
EXEC sp_removedbreplication @dbname = N'My_DBname';
* This run correctly
EXEC sp_dropdistributiondb @database = N'My_DBname';
*Msg 21122, Level 16, State 1, Procedure sp_dropdistributiondb, Line 124
Cannot drop the distribution database 'My_DBname' because it is currently in use.
*then I run SELECT spid FROM sys.sysprocesses WHERE dbid = db_id('distribution') and I kill the active sessions, but the result is the same
EXEC sp_dropdistpublisher @publisher = @@SERVERNAME;
*Msg 14080, Level 11, State 1, Procedure sp_dropdistpublisher, Line 120
The remote server "My_ServerName" does not exist, or has not been designated as a valid Publisher, or you may not have permission to see available Publishers.
EXEC sp_dropdistributor @no_checks = 1
*Msg 21122, Level 16, State 1, Procedure sp_dropdistributiondb, Line 124
Cannot drop the distribution database 'My_DBname' because it is currently in use.
Basically, I have obtained these indications at this URL:
https://technet.microsoft.com/en-us/library/ms147921%28v=sql.105%29.aspx
In short, I find no way to return the database to its original state. I suspect that there may be some kind of corruption that is preventing.
Of course, any clarification or suggestion will be well received by me.
And finally, let me to my two questions:
Firstly... Is there any kind of implication by the fact that it the database appears as a system database?
And second (and sorry for this stupid question)...The sp_dropdistributiondb procedure that does exactly? ... because that name suggests that it could delete the database ... and that's not what I want to do. It is a production database.
thanks for your attention ... any help would be appreciated.
Regards
I´m working with Sqlserver 2012 SE and Windows 2008 R2
Recently I´ve trying to set a transacctional replication by setting the distribuitor in another server.
For any reason, the replication never worked, and then I decided to erase all the publicatión for then to start again from the beginning.
Then I noticed that my database now has become as a system database and it is placed with the other system databases (master, tempdb, model, msdb) in the Management Studio.
I researched about it and I think that it is because database has been marked as distributor.
The query:
select is_distributor from sys.databases where database_id=6
is returning 1
Is the only database that have this value.
Then I begin again to investigate how to fix this and I note on a recurrent basis that I must use the following procedures, with the result that I will show:
EXEC sp_removedbreplication @dbname = N'My_DBname';
* This run correctly
EXEC sp_dropdistributiondb @database = N'My_DBname';
*Msg 21122, Level 16, State 1, Procedure sp_dropdistributiondb, Line 124
Cannot drop the distribution database 'My_DBname' because it is currently in use.
*then I run SELECT spid FROM sys.sysprocesses WHERE dbid = db_id('distribution') and I kill the active sessions, but the result is the same
EXEC sp_dropdistpublisher @publisher = @@SERVERNAME;
*Msg 14080, Level 11, State 1, Procedure sp_dropdistpublisher, Line 120
The remote server "My_ServerName" does not exist, or has not been designated as a valid Publisher, or you may not have permission to see available Publishers.
EXEC sp_dropdistributor @no_checks = 1
*Msg 21122, Level 16, State 1, Procedure sp_dropdistributiondb, Line 124
Cannot drop the distribution database 'My_DBname' because it is currently in use.
Basically, I have obtained these indications at this URL:
https://technet.microsoft.com/en-us/library/ms147921%28v=sql.105%29.aspx
In short, I find no way to return the database to its original state. I suspect that there may be some kind of corruption that is preventing.
Of course, any clarification or suggestion will be well received by me.
And finally, let me to my two questions:
Firstly... Is there any kind of implication by the fact that it the database appears as a system database?
And second (and sorry for this stupid question)...The sp_dropdistributiondb procedure that does exactly? ... because that name suggests that it could delete the database ... and that's not what I want to do. It is a production database.
thanks for your attention ... any help would be appreciated.
Regards