I configured logshipping for a database. I did some tests and tried a controlled failover.
During log shipping secondary db is in restoring state.
To have a controlled failover i stopped the primary database. then i put online my secondary db with:
RESTORE DATABASE AdventureWorks WITH RECOVERY
Then stopped the log shipping jobs in the secondary server and pointed my application (a website) to the secondary server.
Everything worked as expected. Now i want to bring back online the primary server: i started the primary server then i pointed the application to the primary server and restarted the logshipping jobs in the secondary server. I only need to set the secondary db in restoring mode but the command:
RESTORE DATABASE AdventureWorks WITH NORECOVERY
and it gives me the error:
The database is already fully recovered. RESTORE DATABASE is terminating abnormally.
do i need to restore a backup in the secondary anyway?
which are the best practice in this case? how do i revert to the initial situation?