Error: Could not apply log backup file

  • hi

    i have a sql 2005 db with log shipping enabled.

    the secondary server is suddenly giving me the below errors, anyone any tips on how to fix the issue trans log? or am i going to have to do a full db restore?

    Error: Could not apply log backup file
    Error: Could not redo log record
    Restore from a backup of the database, or repair the database.
    An error occurred while processing the log for database 'SysproCompanyW'. If possible, restore from backup. If a backup is not available, it might be necessary to rebuild the log.
    RESTORE LOG is terminating abnormally.
    Processed 0 pages for database 'SysproComp

  • Looks like the transaction log on the secondary is damaged (or could be the data files)
    You're going to need to re-do it, and it may be a good idea to recover the database (if possible) and run checkDB to see what happened, and then re-do the log shipping

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • hi Gila

    so the db is currently in restoring mode as you would expect, as soon as i take it out of this mode, wont i have to do a full db restore?
    i have tried copying over the issue log file again and retrying restore but it fails again with same error

    mal

  • As I said, you're going to need to redo it. i.e. full database restore

    But, before you do that, it may be a good idea to recover the DB and run CheckDB so that you can see what's broken.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • cheers Gila for advise! always appreciated

  • hello, if it's a small enough database, you may want to consider restoring the adhoc full + dif + trn form the primary to another instance then do DBCC CHECKDB.

    That should give some benefit of testing the restore as well before touching and re-doing the faulty replica. Also consider the DBCC on the primary maybe if it's possible size/availability wise to rule out any issue with that instance/host.

  • hello -- you might already be aware that the driver they use will have an impact?
    But just in case here's the link: https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/always-on-client-connectivity-sql-server

    e.g.

    DriverMulti-Subnet FailoverApplication IntentRead-Only RoutingMulti-Subnet Failover: Faster Single Subnet Endpoint FailoverMulti-Subnet Failover: Named Instance Resolution For SQL Clustered Instances
    SQL Native Client 11.0 ODBCYesYesYesYesYes
    SQL Native Client 11.0 OLEDBNoYesYesNoNo
    ADO.NET with .NET Framework 4.0 with connectivity patch*YesYesYesYesYes
    ADO.NET with .NET Framework 3.5 SP1 with connectivity patch**YesYesYesYesYes
    Microsoft JDBC driver 4.0 for SQL ServerYesYesYesYesYes
  • He's using Log Shipping on SQL 2005 (3 versions before Availability Groups was introduced), the link and chart are hence not relevant.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • soon hopefully we will upgrade, and we can experience 10 year old Tech 🙂

  • dopydb - Monday, February 26, 2018 6:28 AM

    soon hopefully we will upgrade, and we can experience 10 year old Tech 🙂

    🙂

    If upgrades are in the planning phase, I would recommend straight to 2017. No more work than any other version, and some nice features to help you fix any problems from the upgrade (Query Store)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaMonster - Monday, February 26, 2018 6:23 AM

    He's using Log Shipping on SQL 2005 (3 versions before Availability Groups was introduced), the link and chart are hence not relevant.

    oh shoot sorry.. so that is where my response went! i believe this is in response to another thread. thanks.

  • hi Gila
    yea we are going straight to 2017 hopefully in later part of the year! be nice to read a new book for a change 🙂
    thanks
    mal

Viewing 12 posts - 1 through 11 (of 11 total)

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