Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Microsoft SQL Server > Re: Applying tr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 11 Topic 11172 of 11517
Post > Topic >>

Re: Applying tranaction log to old data file

by "Dan Guzman" <guzmanda@[EMAIL PROTECTED] > Jun 25, 2008 at 06:41 AM

> I have  one transactional log (it has
> size ab. 24 GB) and half year old data file (from backup).
> What should I run to apply this log to the data file.

As Erland said, you need to first backup the transaction log with 
NO_TRUNCATE.  For example:

BACKUP LOG MyDatabase
TO DISK = 'C:\MyDatabase_Log.bak'
WITH NO_TRUNCATE;

Then restore the database from your full backup with NORECOVERY:

RESTORE DATABASE MyDatabase
FROM DISK = 'C:\MyDatabase.bak'
WITH NORECOVERY;

Finally restore the log backup with RECOVERY:

RESTORE LOG MyDatabase
FROM DISK = 'C:\MyDatabase_Log.bak';

Not that this procedure will work only if you are running in the FULL 
recovery model or in the BULK_LOGGED model with no minimally logged 
operations since your fill backup.

-- 
Hope this helps.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

<koszuf@[EMAIL PROTECTED]
> wrote in message 
news:e83510e5-5d51-4811-b320-c6283174d023@[EMAIL PROTECTED]
 Jun 24, 11:06 pm, Erland Sommarskog <esq...@[EMAIL PROTECTED]
> wrote:
> (kos...@[EMAIL PROTECTED]
) writes:
> > on my SQL Server data file is corrupted. Unfortunately last backup was
> > made about half year ago. Transaction log seems to be ok.
> > Is it possible to restore data file from old backup and apply
> > transactions from current transaction log?
>
> Yes, if you have run with full or bulk-logged recovery for all these six
> months. If you have run with simple recovery for just a second since
your
> last backup, you can forget about it.
>
> In order to do this, you need to use the WITH NO_TRUNCATE option when
you
> backup your transaction log.

To be honest - I'm not an SQL Server administrator - in my company I'm
responsible for Oracle databases. Person responsible for this server
asked me to restore database. I have  one transactional log (it has
size ab. 24 GB) and half year old data file (from backup).
What should I run to apply this log to the data file.

Thanks for your help.
 




 11 Posts in Topic:
Applying tranaction log to old data file
koszuf@[EMAIL PROTECTED]   2008-06-24 07:01:47 
Re: Applying tranaction log to old data file
Ed Murphy <emurphy42@[  2008-06-24 07:35:00 
Re: Applying tranaction log to old data file
Erland Sommarskog <esq  2008-06-24 21:06:35 
Re: Applying tranaction log to old data file
koszuf@[EMAIL PROTECTED]   2008-06-24 23:53:05 
Re: Applying tranaction log to old data file
"Dan Guzman" &l  2008-06-25 06:41:14 
Re: Applying tranaction log to old data file
koszuf@[EMAIL PROTECTED]   2008-06-25 05:49:26 
Re: Applying tranaction log to old data file
"Dan Guzman" &l  2008-06-25 21:06:59 
Re: Applying tranaction log to old data file
Sybaseguru <collap@[EM  2008-06-26 18:56:00 
Re: Applying tranaction log to old data file
"Dan Guzman" &l  2008-06-26 19:53:27 
Re: Applying tranaction log to old data file
Erland Sommarskog <esq  2008-06-26 21:54:58 
Re: Applying tranaction log to old data file
"Dan Guzman" &l  2008-06-26 19:55:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 0:55:50 CST 2008.