Tuesday, November 27, 2012

Database does not exist when configuring Log Shipping for a database in SQL Server 2005


When you are trying to configure a Log Shipping for a database in SQL Server 2005 and you get the error: 

Database does not exist as log shipping primary.

1. Validate the server name on both primary and secondary instance:

SELECT @@servername
EXEC sp_helpserver

2. If you are getting NULL as a result of the SELECT then add the server to the instance:

sp_addserver '\', local

3. If you get the error:

Msg 15028, Level 16, State 1, Procedure sp_MSaddserver_internal, Line 89
The server '\' already exists.

4. You should need to drop the server first and then add it again:

sp_dropserver '\'

5. And then add the server name:

sp_addserver '\', local

Finally try again running the Log Shipping configuration script or run it from the wizard.