Restart log shipping when out of sync











up vote
3
down vote

favorite
1












The scenario is. A database secondary server are for different reason out of sync or is suspected that is not sync. Someone has made the secondary databases online by mistake or other mishaps. If you now want to make sure that they are set back on track. How do you do that? Preferably swiftly and for many databases at once.



When you set up a log shipping between two servers using the guide it takes care of the initial backup and copying of backup file and then the initial restore.
If I have to redo that I have to unable/enble and redo the loghipping and fill all the parameters again. Is there an other way? Can I use sqllogship application?
I there a "C:Program FilesMicrosoft SQL Server100ToolsBinnsqllogship.exe" -Restart -server SQLServPROD2
Or is there something that could be done easily with powershell and SQL Server Management Objects - SMO?



I want to use all the parameters that are already in tables like log_shipping_secondary.



I have not found any scripts for doing this. I looked at the generated script when I used the guide but that does not contain the inital backup and copy. I can write my own script. I am just afraid someone will say: Why did you not just run: $smoLogShipping.Redo










share|improve this question




























    up vote
    3
    down vote

    favorite
    1












    The scenario is. A database secondary server are for different reason out of sync or is suspected that is not sync. Someone has made the secondary databases online by mistake or other mishaps. If you now want to make sure that they are set back on track. How do you do that? Preferably swiftly and for many databases at once.



    When you set up a log shipping between two servers using the guide it takes care of the initial backup and copying of backup file and then the initial restore.
    If I have to redo that I have to unable/enble and redo the loghipping and fill all the parameters again. Is there an other way? Can I use sqllogship application?
    I there a "C:Program FilesMicrosoft SQL Server100ToolsBinnsqllogship.exe" -Restart -server SQLServPROD2
    Or is there something that could be done easily with powershell and SQL Server Management Objects - SMO?



    I want to use all the parameters that are already in tables like log_shipping_secondary.



    I have not found any scripts for doing this. I looked at the generated script when I used the guide but that does not contain the inital backup and copy. I can write my own script. I am just afraid someone will say: Why did you not just run: $smoLogShipping.Redo










    share|improve this question


























      up vote
      3
      down vote

      favorite
      1









      up vote
      3
      down vote

      favorite
      1






      1





      The scenario is. A database secondary server are for different reason out of sync or is suspected that is not sync. Someone has made the secondary databases online by mistake or other mishaps. If you now want to make sure that they are set back on track. How do you do that? Preferably swiftly and for many databases at once.



      When you set up a log shipping between two servers using the guide it takes care of the initial backup and copying of backup file and then the initial restore.
      If I have to redo that I have to unable/enble and redo the loghipping and fill all the parameters again. Is there an other way? Can I use sqllogship application?
      I there a "C:Program FilesMicrosoft SQL Server100ToolsBinnsqllogship.exe" -Restart -server SQLServPROD2
      Or is there something that could be done easily with powershell and SQL Server Management Objects - SMO?



      I want to use all the parameters that are already in tables like log_shipping_secondary.



      I have not found any scripts for doing this. I looked at the generated script when I used the guide but that does not contain the inital backup and copy. I can write my own script. I am just afraid someone will say: Why did you not just run: $smoLogShipping.Redo










      share|improve this question















      The scenario is. A database secondary server are for different reason out of sync or is suspected that is not sync. Someone has made the secondary databases online by mistake or other mishaps. If you now want to make sure that they are set back on track. How do you do that? Preferably swiftly and for many databases at once.



      When you set up a log shipping between two servers using the guide it takes care of the initial backup and copying of backup file and then the initial restore.
      If I have to redo that I have to unable/enble and redo the loghipping and fill all the parameters again. Is there an other way? Can I use sqllogship application?
      I there a "C:Program FilesMicrosoft SQL Server100ToolsBinnsqllogship.exe" -Restart -server SQLServPROD2
      Or is there something that could be done easily with powershell and SQL Server Management Objects - SMO?



      I want to use all the parameters that are already in tables like log_shipping_secondary.



      I have not found any scripts for doing this. I looked at the generated script when I used the guide but that does not contain the inital backup and copy. I can write my own script. I am just afraid someone will say: Why did you not just run: $smoLogShipping.Redo







      sql-server powershell smo failover






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 '11 at 21:16









      Soner Gönül

      79.4k26147270




      79.4k26147270










      asked Apr 14 '11 at 15:18









      Patrik Lindström

      70031016




      70031016
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          If you bring a standby database on-line (i.e.) restore it with_recovery then this will break the log-shipping. The only way to re-establish log shipping is to restore the standby database from a full backup of the source again and use no_recovery / standby mode.






          share|improve this answer





















          • >The only way to re-establish log shipping is to restore the standby database from a full backup.
            – Patrik Lindström
            May 22 '11 at 14:29










          • >The only way to re-establish log shipping is to restore the standby database from a full backup. Yes I have understood that. I wondered if there was a feature to do these steps automatically. Since all the information about logshipping is stored in log_shipping_secondary.
            – Patrik Lindström
            May 22 '11 at 14:34


















          up vote
          0
          down vote













          I do not know of any community supported script to do what you ask but it can be scripted easy enough. The GUI can handle most of the process, you would then just need to tweak it be parameterized and customized to the work flow that you are after. The link below gives an example of what I'm talking about.



          Scripting Log Shipping Automation






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f5665490%2frestart-log-shipping-when-out-of-sync%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            If you bring a standby database on-line (i.e.) restore it with_recovery then this will break the log-shipping. The only way to re-establish log shipping is to restore the standby database from a full backup of the source again and use no_recovery / standby mode.






            share|improve this answer





















            • >The only way to re-establish log shipping is to restore the standby database from a full backup.
              – Patrik Lindström
              May 22 '11 at 14:29










            • >The only way to re-establish log shipping is to restore the standby database from a full backup. Yes I have understood that. I wondered if there was a feature to do these steps automatically. Since all the information about logshipping is stored in log_shipping_secondary.
              – Patrik Lindström
              May 22 '11 at 14:34















            up vote
            0
            down vote













            If you bring a standby database on-line (i.e.) restore it with_recovery then this will break the log-shipping. The only way to re-establish log shipping is to restore the standby database from a full backup of the source again and use no_recovery / standby mode.






            share|improve this answer





















            • >The only way to re-establish log shipping is to restore the standby database from a full backup.
              – Patrik Lindström
              May 22 '11 at 14:29










            • >The only way to re-establish log shipping is to restore the standby database from a full backup. Yes I have understood that. I wondered if there was a feature to do these steps automatically. Since all the information about logshipping is stored in log_shipping_secondary.
              – Patrik Lindström
              May 22 '11 at 14:34













            up vote
            0
            down vote










            up vote
            0
            down vote









            If you bring a standby database on-line (i.e.) restore it with_recovery then this will break the log-shipping. The only way to re-establish log shipping is to restore the standby database from a full backup of the source again and use no_recovery / standby mode.






            share|improve this answer












            If you bring a standby database on-line (i.e.) restore it with_recovery then this will break the log-shipping. The only way to re-establish log shipping is to restore the standby database from a full backup of the source again and use no_recovery / standby mode.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 20 '11 at 12:37









            Wes Price

            173412




            173412












            • >The only way to re-establish log shipping is to restore the standby database from a full backup.
              – Patrik Lindström
              May 22 '11 at 14:29










            • >The only way to re-establish log shipping is to restore the standby database from a full backup. Yes I have understood that. I wondered if there was a feature to do these steps automatically. Since all the information about logshipping is stored in log_shipping_secondary.
              – Patrik Lindström
              May 22 '11 at 14:34


















            • >The only way to re-establish log shipping is to restore the standby database from a full backup.
              – Patrik Lindström
              May 22 '11 at 14:29










            • >The only way to re-establish log shipping is to restore the standby database from a full backup. Yes I have understood that. I wondered if there was a feature to do these steps automatically. Since all the information about logshipping is stored in log_shipping_secondary.
              – Patrik Lindström
              May 22 '11 at 14:34
















            >The only way to re-establish log shipping is to restore the standby database from a full backup.
            – Patrik Lindström
            May 22 '11 at 14:29




            >The only way to re-establish log shipping is to restore the standby database from a full backup.
            – Patrik Lindström
            May 22 '11 at 14:29












            >The only way to re-establish log shipping is to restore the standby database from a full backup. Yes I have understood that. I wondered if there was a feature to do these steps automatically. Since all the information about logshipping is stored in log_shipping_secondary.
            – Patrik Lindström
            May 22 '11 at 14:34




            >The only way to re-establish log shipping is to restore the standby database from a full backup. Yes I have understood that. I wondered if there was a feature to do these steps automatically. Since all the information about logshipping is stored in log_shipping_secondary.
            – Patrik Lindström
            May 22 '11 at 14:34












            up vote
            0
            down vote













            I do not know of any community supported script to do what you ask but it can be scripted easy enough. The GUI can handle most of the process, you would then just need to tweak it be parameterized and customized to the work flow that you are after. The link below gives an example of what I'm talking about.



            Scripting Log Shipping Automation






            share|improve this answer



























              up vote
              0
              down vote













              I do not know of any community supported script to do what you ask but it can be scripted easy enough. The GUI can handle most of the process, you would then just need to tweak it be parameterized and customized to the work flow that you are after. The link below gives an example of what I'm talking about.



              Scripting Log Shipping Automation






              share|improve this answer

























                up vote
                0
                down vote










                up vote
                0
                down vote









                I do not know of any community supported script to do what you ask but it can be scripted easy enough. The GUI can handle most of the process, you would then just need to tweak it be parameterized and customized to the work flow that you are after. The link below gives an example of what I'm talking about.



                Scripting Log Shipping Automation






                share|improve this answer














                I do not know of any community supported script to do what you ask but it can be scripted easy enough. The GUI can handle most of the process, you would then just need to tweak it be parameterized and customized to the work flow that you are after. The link below gives an example of what I'm talking about.



                Scripting Log Shipping Automation







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 23 '17 at 12:02









                Community

                11




                11










                answered Feb 10 '15 at 2:11









                SQL Hammer

                196211




                196211






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f5665490%2frestart-log-shipping-when-out-of-sync%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Full-time equivalent

                    さくらももこ

                    13 indicted, 8 arrested in Calif. drug cartel investigation