Log Shipping scans files but doesn't restore

  • I would look at getting the vendor to populate the LS tables on their system if possible. Have you asked them if they are willing to do this?

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

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

  • Alright, after much more experimentation, it turns out that what I'm trying to do *can* work, provided that the formatting of the log backup file names exactly matches what log shipping is expecting.

    I'll be working on a blog post detailing everything discussed here as well as how I solved each step. Will include a link when it's up. Thank you everyone for your help!

    _______________________________________________________________________________________________
    Bob Pusateri
    Microsoft Certified Master: SQL Server 2008

    Blog: The Outer Join[/url]
    Twitter: @SQLBob

  • Thanks for the update.

    Sounds like half-a** coding and an item for Connect.

  • Steve Jones - SSC Editor (1/15/2014)


    and an item for Connect.

    No, log shipping is doing exactly what it should be. If anything, you'll probably get an unsupported message for the scenario that's being implemented here 😉

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

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

  • I have created two sql scripts: First one will create Log Shipping for all databases that are not already setup for Log Shipping on the primary server. My second script will then run on the secondary server to create all the new databases and creates the sql jobs for copying the files and loading them. This made it so easy for me to setup log shipping for 300 databases on a a single server.

  • SQL_Bob (1/14/2014)


    Alright, after much more experimentation, it turns out that what I'm trying to do *can* work, provided that the formatting of the log backup file names exactly matches what log shipping is expecting.

    I'll be working on a blog post detailing everything discussed here as well as how I solved each step. Will include a link when it's up. Thank you everyone for your help!

    Bob did you ever get a chance to write this info up? I am in the exact same situation you are in regarding the logs coming in from an external company and sure could use some help.

  • I would love to hear how you set up Log Shipping databases with FTP or dropbox. We have several Goodwill stores running SQL 2008 R2 Workgroup and do not have a VPN or any connection to our main office and I am trying to set up a data mart so I would like to have "copies" of the various stores databases so I can manipulate their data to have reports on the stores combined and individual. We do not want to connect the databases to make sure we do not violate PCI Compliance. Obviously we also have budgetary issues with trying to keep our money to the mission and not operations. Any suggestions would be appreciated.

    Tracy

  • I'm having the same issue which I described in the thread "Log shipping restore job doesn't restore"

    Interestingly, this is also not standard SQL Log Shipping. The log files originate on an Internet-facing domain and are passed through a firewall via an FTP job to a server in a secure domain.

    Oddly there are five databases on the Internet-facing instance that send their log files through the firewall to the same target instance, and four of the restore jobs work - one doesn't.

    If anyone has figured this out please let us know.

  • I encountered this same issue, found a solution and documenting this for prosperity.

    SQL Log shipping expects the trn files to be named  "{DBNAME}_yyyyMMddhhmmss.trn"

    for Ola Hallengren backup solution, this is equivalent to @AvailabilityGroupFilename or @BackupFilename='{DatabaseName}_{Year}{Month}{Day}{Hour}{Minute}{Second}.{FileExtension}'

    sqllogship.exe first scans the directory for log files matching "{dbname}_*.trn"   (verified via sysinternals procmon). If it finds matching trn files, but the full filename doesn't have the correct format  then the file won't be restored, but the restore job still "succeeds".

    The strange thing is that via profiler, you can verify that sqllogship.exe is calling 'sp_can_tlog_be_applied', but then skips actually restoring the log.

    Sample Error messages:

    Found first log backup file to restore. Secondary DB: 'MY_DATABASE', File: 'T:\Logs\MY_DATABASE_20220823_095553.trn'
    The restore operation was successful. Secondary Datbase: 'MY_DATABASE', Number of log backup files restored: 0

     

     

     

     

  • SpringTownDBA wrote:

    I encountered this same issue, found a solution and documenting this for prosperity.

    SQL Log shipping expects the trn files to be named  "{DBNAME}_yyyyMMddhhmmss.trn"

    for Ola Hallengren backup solution, this is equivalent to @AvailabilityGroupFilename or @BackupFilename='{DatabaseName}_{Year}{Month}{Day}{Hour}{Minute}{Second}.{FileExtension}'

    sqllogship.exe first scans the directory for log files matching "{dbname}_*.trn"   (verified via sysinternals procmon). If it finds matching trn files, but the full filename doesn't have the correct format  then the file won't be restored, but the restore job still "succeeds".

    The strange thing is that via profiler, you can verify that sqllogship.exe is calling 'sp_can_tlog_be_applied', but then skips actually restoring the log.

    Sample Error messages:

    Found first log backup file to restore. Secondary DB: 'MY_DATABASE', File: 'T:\Logs\MY_DATABASE_20220823_095553.trn'
    The restore operation was successful. Secondary Datbase: 'MY_DATABASE', Number of log backup files restored: 0

    Ola Hallengren backup scripts exclude log shipped databases, at least in the latest version of the scripts.

    You dont want anything other than the primary backup job taking log backups in a LS plan, the plan will name the files applicably

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

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

Viewing 10 posts - 16 through 24 (of 24 total)

You must be logged in to reply to this topic. Login to reply