Sunday 24 August 2014

Reverse Log shipping Setup



If database size big and in different data center and we need to reverse log shipping without restore full database.

Follow below steps:-

STEP 1:-

1)      Go to Primary Server and disable backup job
2)      Go to secondary Server run copy job manually and after that run restore job manually after completed the job disable both the jobs.

STEP 2:-

GO TO primary server and take log backup with no recovery command:-
Backup log REVERSE_LOGSHIPPING to disk='d:\REVERSE_LOGSHIPPING.trn' with no recovery

After execution this command you will see your primary Server will show in with restoring mode.
 

 

Step:3

Go to secondary Server and restore log backup that we took in step 2 with Recovery option:-

Use [Master]

Restore log REVERSE_LOGSHIPPING from disk='d:\REVERSE_LOGSHIPPING.trn' with recovery


Now your database will we operational from restoring mode.




 



Step 4:-

Now you can configure logshipping again:-

Right click on the database [REVERSE_LOGSHIPPING] and configure the log shipping same way .





 
That’s all:-


If you want to see the data on both side then you have to take secondary database in operational if it’s on restoring state or if you configure as read_only then you can query easily.

If database in restoring mode you need to run the below command and after that you need to setup log shipping again better option go with stand_by\read only option.

As of now for testing purpose we are making secondary database operational from restoring state:-




 STEP 5 :-

You can see the same record exist on secondary server as well:-

See below screen shot:-


Row count from secondary Server (29)



Row count from Primary Server (29) rows