We had two databases on one SQL Server 2005 instance with transactional replication between them (3 tables as articles). This server acted both as publisher and distributor.
Then the RAID on the server failed. However we managed to detach and copy almost all .mdf
files before the crash.
After the system restored, we reinstalled SQL Server, restored system databases (master, model, msdb) and placed the .mdf
files to the same paths. So it started.
The problem appeared with the replication. The Local Publications folder was empty, though the Local Subscriptions folder contained the subscription in question. When I tried to add a new publication I got:
New Publication Wizard encountered one or more errors while retrieving publication names.
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Invalid object name 'dbo.syspublications'. (Microsoft SQL Server, Error: 208)
I decided to try to remove the left subscription (eventually I managed to) and disable publishing and distribution on the server, which gave me:
SQL Server could not disable publishing and distribution on 'someserver'.
Invalid object name 'dbo.syssubscriptions'. Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1. Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1. Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1. Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1. Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 0, current count = 1. Changed database context to 'master'. (Microsoft SQL Server, Error: 208)
It seems like some info was not recovered from the system database backups (probably distribution
database may be missing something).
Also I tried to follow the answer given in unable to disable publishing and distribution. But to no success. I tried to create syspublications
both in master
and distribution
, but nothing changed.
So, how can I make replication work on this server?
Tried to publish some other database on the server and it worked. So the problem seems to be connected with the published database. How can I clear it up to manage create a new publication over it?
System Tables
subfolder of the problem database misses the replication tables, which are created, when a database is published.
In replication monitor I can see those old subscriptions, while they are not available in Replication folder.