0

I am getting error when restoring DB trans log files. Running

RESTORE VERIFYONLY FROM DISK = xxxxxx

is returning a message

The backup set on file 1 is valid

However when running

RESTORE LOG [db_name] FROM DISK = xxxxxx

I get error

The log scan number (yyyyyyyyyyyy) passed to log scan in database '[db_name]' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication.
Otherwise, restore from backup if the problem results in a failure during startup.
RESTORE LOG is terminating abnormally.

There is a replication setup on the DB that I am applying the logs backup file. Does it mean that the trans log backup is corrupted or there is something with the replication.

Why does the Verifyonly check return that the file is valid?

4
  • Just curious and partly guessing, is it master database?
    – Raymond A.
    Dec 8, 2021 at 17:07
  • no it is not a master DB
    – syl
    Dec 8, 2021 at 17:29
  • Do you have the option to do it through GUI? When I restore translogs (often due to the need to go back in time, before a mistake was done), I preferr to use SMSS GUI.
    – Raymond A.
    Dec 8, 2021 at 18:17
  • I get this same error when trying to apply the logs in SSMS.
    – syl
    Dec 8, 2021 at 18:20

1 Answer 1

0

first question

error message suggest 2 causes either database corruption, have you run dbcc checkdb ? or that the log file does not match the data file (transaction log backup from wrong db?).

From what I can see this error occurred during a transaction log restore not during replication so you can ignore that part of the error message.

second question

verifyonly is checking that the backup file is readable and complete - it is not checking the entire logic as clearly stated in the documentation.

https://learn.microsoft.com/en-us/sql/t-sql/statements/restore-statements-verifyonly-transact-sql?view=sql-server-ver15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.