• Sue_H - Wednesday, January 17, 2018 2:30 PM

    desiboy102493 - Wednesday, January 17, 2018 1:58 PM

    Sue_H - Wednesday, January 17, 2018 1:48 PM

    desiboy102493 - Wednesday, January 17, 2018 1:27 PM

    Sue_H - Wednesday, January 17, 2018 12:33 PM

    desiboy102493 - Wednesday, January 17, 2018 11:54 AM

    I need to set up log shipping for about 10 databases. Log backup would occur ever 4 hours and would need to restore automatically to the source server.
    If anybody can help me with any kind of script which would work for this process, would be appreciated.

    Thanks for your help.

    You setup the log backups with Log Shipping - it's part of the process of log shipping itself. You have log shipping log backups and don't do others outside of those for log shipping. You can schedule the backups for whatever time increments you want. The log is backed up, the file is copied and then restored to the secondary.
    In terms of automatically restore to the source server - is that really what you want? I guess you really mean restore to the secondary. And that is what log shipping does - the job on the secondary does this.
    It sounds like you may not be real clear on how log shipping works. If you have to set it up and then support it, you may want to make sure you fully understand all of it. Otherwise, you could end up breaking your log backup chains and put the company's data at risk in terms of recoverability. And you also want to be able to troubleshoot thing. Here are links to sample scripts but most of that is useless if you don't understand log shipping. And you will have to make changes as needed to any scripts so understanding the process is needed for that as well.
    Scripting Log Shipping Automation
    Implementing Log Shipping for Many Databases

    Sue

    Already looked at those link doesn't seem to be working.
    Thanks anyway

    They work. You'd need to understand log shipping so you can make the necessary modifications to the scripts. Even if they supply things with variables, you need to understand what those are and how they are used and what permissions would be needed. Like the share. You'd need to know what that is, how its used and why and what permissions are needed.

    Go through the process of setting one up with the GUI and script it all out. You can make whatever necessarily changes for the other databases. But you will run into the same issues with that script as well. Log shipping can be setup once in a matter of minutes, it's fairly straight forward.

    Sue

    I did set up with GUI for one DB..and did LS manually many times
    but the goal is here to do multiple dbs at once. So don't have to manually do each of the db because it's more than 100 DBS 
    Thanks

    And that's why you use the GUI, generate the script and then use that script to make whatever necessarily changes to use as your template. 
    The second link is doing exactly that and just reads the databases, shares, backup directories from a table that was created. Somewhere in the process, you need to tell it what databases, what shares, what backup directories, etc. There won't be any script that has those values for those settings in your environment so you will need to provide that information. 

    Sue

    ofcourse lol all the parameters were changed. backup directories, restore path...etc.
    this script has error in it