Re: Restoring from non-truncated transaction log

From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 02/07/05


Date: Mon, 7 Feb 2005 09:40:14 +0100

The transaction log is there to support transactional consistency (rollbacks and recovery) as well
as supporting "incremental" backup (backup of the transaction log).

A database backup contains both data pages as well as the necessary log records (from the
transaction log file(s)). This is so that SQL Server when you restore can apply the data pages and
perform recovery (roll -forward and -back). When your restore a database backup, the contents of the
ldf file of the current database will be overwritten. I agree with Paul R regarding reading up on
the suggested section on Books Online. :-)

-- 
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"2 Struggling Admins" <2StrugglingAdmins@discussions.microsoft.com> wrote in message 
news:12970127-DB33-4D7B-ADE7-7136BD17E4F8@microsoft.com...
>> That restore overwrites everything inside the database. Including the
> entries in the transaction
>> log. This of a restore like applying a VM Ware image on a machine.
> Like I said I am not very experienced with SQL.  Please forgive my ignorance
> in this matter.  We were not backing up the Transaction log, just the
> database.  When the restore was done it wasn't restoring the transaction log.
> Does it remove the entries from the transaction log when you restore the
> database form a backup even if it doesn't restore the transaction log?  I
> would think that would be the opposite of what the transaction log was
> supposed to do.
>
>
>
> "Tibor Karaszi" wrote:
>
>> > We have a database which unfortunately someone has restored from a backup
>> > which was 2+ months old after he ran a script against the database that had
>> > negative effects.
>>
>> That restore overwrites everything inside the database. Including the entries in the transaction
>> log. This of a restore like applying a VM Ware image on a machine.
>>
>>
>> > What I am wondering is would it be possible to restore the missing data in
>> > the database with the transaction log?
>>
>> Are you saying that you saved something, somehow (backup, detach) before that restore was 
>> performed?
>> If not, I fail to see anyway to get anything back. Unelss you have some type of backup which is 
>> more
>> recent that the 2 month old backup.
>> -- 
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>> http://www.sqlug.se/
>>
>>
>> "Support" <Support@discussions.microsoft.com> wrote in message
>> news:A8AE3D87-6975-444D-BD77-23407F529DEE@microsoft.com...
>> > We have a database which unfortunately someone has restored from a backup
>> > which was 2+ months old after he ran a script against the database that had
>> > negative effects.  So, now there is a gap in the data from Nov23 - Jan 31.
>> > What I am wondering is would it be possible to restore the missing data in
>> > the database with the transaction log?  We were not backing up the
>> > transaction log; so, it was not truncated.  We have detached the database and
>> > the transaction log and reattached them on another server.
>> >
>> > For some reason every time I explain this in person, people miss something.
>> > So, here are the basic facts:
>> >
>> > MS SQL server 2000 database restored from backup
>> > 2 months of missing data
>> > in tact(not truncated) transaction log
>> > a script was run against the database before it was restored from backup on
>> > Jan 31
>> > database structure is identical.
>> >
>> > Is this savable data, or should we just give up.  I am not a DBA.  He quit
>> > about 1.5 months ago; so please be specific about what to do as I am not yet
>> > extreamly familiar with SQL server 2000.  By the way we have been working on
>> > this since the 31st, and all we know for sure is that SQL doesn't like it
>> > when you do something like this.  Thanks in advance for any guidance either
>> > way.
>>
>>
>> 


Relevant Pages

  • Backup and Restore Files
    ... What is the best way to backup and restore a runtime database file? ... pszDisplayName As String ...
    (microsoft.public.access.gettingstarted)
  • RE: How do I restore from mdf and ldf files?
    ... Tasks -> Backup Database ... Tasks -> Restore Database ... Windows 2003 Server with Latest Service Pack ... Pre-requisites for Sharepoint Backup and Restore: ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Restoring SQL Server Backups
    ... ORIGINAL BACKUP & RESTORE (MSDE Database) ... occurrenceof cachestore flush for the 'Object Plans' cachestore (part ...
    (microsoft.public.sqlserver.server)
  • Re: POINT IN TIME RESTORE
    ... Perform a transaction log backup of the original database (If you have ... Restore the subsequent transaction log files in order of backup WITH ...
    (microsoft.public.sqlserver.server)
  • Re: Restoring SQL Server Backups
    ... ORIGINAL BACKUP & RESTORE (MSDE Database) ... occurrenceof cachestore flush for the 'Object Plans' cachestore (part ...
    (microsoft.public.sqlserver.server)

Loading