Restore log problem

dmikeledmikele Posts: 8
edited October 10, 2012 1:46PM in SQL Backup Previous Versions
Why is this happening and how can I avoid this issue?
Also how can I fix it, but not restoring whole db again?

10/10/2012 1:53:01 AM: SQL error 3013: SQL error 3013: RESTORE LOG is terminating abnormally.
10/10/2012 1:53:01 AM: SQL error 4305: SQL error 4305: The log in this backup set begins at LSN 7644000005259200001, which is too recent to apply to the database. An earlier log backup that includes LSN 7644000005259000001 can be restored.

Thanks in advance!

Comments

  • peteypetey Posts: 2,358 New member
    That means that an earlier transaction log is required to maintain the transaction log sequence. Perhaps someone made a backup of the transaction log manually?

    You could use the following query to find the missing file(s), and also when the backup was taken and by whom:
    SELECT b.physical_device_name, a.user_name, a.backup_start_date
    FROM msdb..backupset a
    INNER JOIN msdb..backupmediafamily b on a.media_set_id = b.media_set_id
    WHERE a.type = 'L'
      AND a.database_name = '<your database name>'
      AND a.first_lsn <= 7644000005259000001 AND a.last_lsn >= 7644000005259000001
    

    Note that you have to fill in the database name in the above script.

    If the missing files are SQL Server backup files, you'll need to restore them using Management Studio first, before using SQL Backup to restore the subsequent files. If the missing files are SQL Backup backup files, you could place them in the same directory with your existing SQL Backup files, and use SQL Backup to restore them all together.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Hi,
    thanks for fast answer.

    Is there any other reason for this error because nobody is making logs manually, that happens very often. When I run query you send I get result which is ok, only user for log shipping is making logs. The log files which you mention dont exist, is configuring log shipping for that db again only solution?
    One more thing which is happening often is "Compressed data block not found in file"
  • peteypetey Posts: 2,358 New member
    When you configure log shipping, all trx log backups made by SQL Backup are stored in location A. The restore job on the secondary server will restore all the files it finds in that location.

    If someone else backs up the transaction log, this breaks the transaction log chain in location A. To get things back in sequence again, you'll need to restore that transaction log backup that was not backed up by the SQL Backup log shipping job.

    The query I provided should have provided the name of the backup file, the time of the backup and the user that created the backup. Was that backup file created by the SQL Backup backup job?

    With regards to the 'Compressed data block not found in file', is the backup file you are trying to restore a SQL Backup backup file?
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Yes I know how it works and I dont understand why is this happening when only Sql backup job is making transaction log backup.
    If I understand correctly, when I run that qry and get results, these are files which I have to restore first so everything can back to normal?
    Regarding to the "Compressed data block not found in file", yes it is Sql backup file.
  • peteypetey Posts: 2,358 New member
    Could you please let me know the name of the missing file, as returned by the query?

    Thanks.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • I have already reconfigured log shipping because we was in hurry, so I don`t know name of missing log files. If it happen again I will contact you.
    Error "Compressed data block not found in file" was for another db.
    Thanks for help.
Sign In or Register to comment.