• Tecina (7/21/2016)


    [font="Tahoma"]Hello guys,

    I'm in the process of creating a powershell function which will call .sql scripts to perform Log Shipping, FailOver and Failback.

    I've covered, according to my environment requirement, the first part of the

    Log Shipping (Part 1)

    Shipping log from Prod DB to Test/DR DB. I've used the commands generated by SSMS to edit log shipping configuration at it works well.:-)

    FailOver (Part 2)

    I've used once again the same generated SSMS script for both servers/DBs, edited to fit the failover process: TEST DB now ships its logs to PROD DB.

    BUT, when i check PROD DB in SSMS, it's ONLINE and still the primary database in the (Failover)Log Shipping configuration.

    IF i run the following query, i can see that it's the secondary database in the (Failover)Log Shipping configuration and in STANDBY mode. But hell, not in SSMS which got me insane :crazy::w00t: i must admitt:-). Here's the query:

    SELECT secondary_database,

    restore_mode,

    disconnect_users,

    last_restored_file

    FROM msdb.dbo.log_shipping_secondary_databases

    Hence, the restore job on PROD DB is failing as the DB is not in either NORECOVERY or STANDBY mode.

    Do you guys have an idea why, the DB on PROD DB is not going on STANDBY mode?

    I know, how to put the DB in STANDBY or NORECOVERY but not really sure which process i should use to do it without breaking the LSN or getting an error such as no log files are ready to rollforward ????

    Thanks a lot for taking the time to review this with me.

    [/font]

    The process to switch log shipping roles is detailed at the URL below, is this the process you have followed?

    what errors do you see in the logs?

    https://msdn.microsoft.com/en-GB/library/ms178117.aspx

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉