Red Gate forums :: View topic - Restore log problem
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Backup 7
SQL Backup 7 forum

Restore log problem

Search in SQL Backup 7 forum
Post new topic   Reply to topic
Jump to:  
Author Message
dmikele



Joined: 14 Aug 2012
Posts: 6

PostPosted: Wed Oct 10, 2012 9:20 am    Post subject: Restore log problem Reply with quote

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!
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2301

PostPosted: Wed Oct 10, 2012 1:31 pm    Post subject: Reply with quote

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:

Code:
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 7
Back to top
View user's profile Send private message Send e-mail
dmikele



Joined: 14 Aug 2012
Posts: 6

PostPosted: Wed Oct 10, 2012 1:57 pm    Post subject: Reply with quote

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"
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2301

PostPosted: Wed Oct 10, 2012 3:28 pm    Post subject: Reply with quote

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 7
Back to top
View user's profile Send private message Send e-mail
dmikele



Joined: 14 Aug 2012
Posts: 6

PostPosted: Wed Oct 10, 2012 3:38 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
petey



Joined: 24 Apr 2005
Posts: 2301

PostPosted: Wed Oct 10, 2012 4:14 pm    Post subject: Reply with quote

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 7
Back to top
View user's profile Send private message Send e-mail
dmikele



Joined: 14 Aug 2012
Posts: 6

PostPosted: Wed Oct 10, 2012 6:46 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group