dbTalk Databases Forums  

What columns/order transaction logs to use in Point in Time recove

microsoft.public.sqlserver.server microsoft.public.sqlserver.server


Discuss What columns/order transaction logs to use in Point in Time recove in the microsoft.public.sqlserver.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
JB
 
Posts: n/a

Default What columns/order transaction logs to use in Point in Time recove - 08-28-2009 , 03:37 PM






Hello

I am using the full recovery model and I make transaction log backups
every 15 minutes. Now I need to restore the database because of user update
error. When I run the command:

use master
RESTORE HEADERONLY
FROM LgBackupLog

It shows 14 transaction logs that have been backed up. The columns
BackupStartDate and BackupFinishDate have a Date/Time. I assume that I use
the BackupFinishDate column to restore the database for Point-in-Time
recovery, my question is:

1-Out of the 14 transaction logs which is the first one to restore and which
is the last one to restore?

2-Do I only include the StopAt clause on the last transaction log that I
apply?

JB
--
JB

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: What columns/order transaction logs to use in Point in Time recove - 08-28-2009 , 04:11 PM






JB (JB (AT) discussions (DOT) microsoft.com) writes:
Quote:
I am using the full recovery model and I make transaction log backups
every 15 minutes. Now I need to restore the database because of user
update error. When I run the command:

use master
RESTORE HEADERONLY
FROM LgBackupLog

It shows 14 transaction logs that have been backed up. The columns
BackupStartDate and BackupFinishDate have a Date/Time. I assume that I
use the BackupFinishDate column to restore the database for
Point-in-Time recovery, my question is:

1-Out of the 14 transaction logs which is the first one to restore and
which is the last one to restore?
The first is the oldest. Well, if it's older than the full backup, you
don't need it, but SQL Server should tell you. The last log is the one
that has a FinnishDate after the mistake.

Quote:
2-Do I only include the StopAt clause on the last transaction log that I
apply?
A quick look in Books Online tells me that you should be able to specify
it on all RESTORE commands. "If the specified STOPAT time is after the last
LOG backup, the database is left in the unrecovered state, just as if
RESTORE LOG ran with NORECOVERY."

A Google search on "Restoring a Database to a Point Within a Backup"
maybe helpful for you.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #3  
Old   
Tibor Karaszi
 
Posts: n/a

Default Re: What columns/order transaction logs to use in Point in Time recove - 08-29-2009 , 03:09 AM



Quote:
A quick look in Books Online tells me that you should be able to
specify
it on all RESTORE commands.
Yes, as of 2005. For all but the "last one" (where we actually will
stop), this is just to let SQL Server know out intention. Imagine you
have the following:

a, 10:00 log
b, 11:00 db
c, 12:00 log
d, 13:00 log

Now, if my intention is to stop at 09:45, clearly I need some db
backup prior to a. If I bymistale restore b, c and then do STOPAT
10:45 for d, I would have wasted time on restoring b and c. By
specifying STOPAT for all restore command, SQL Server would notify me
for my first restore (b) that I need to go hunt for some earlier
backup.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi


"Erland Sommarskog" <esquel (AT) sommarskog (DOT) se> wrote

Quote:
JB (JB (AT) discussions (DOT) microsoft.com) writes:
I am using the full recovery model and I make transaction log
backups
every 15 minutes. Now I need to restore the database because of
user
update error. When I run the command:

use master
RESTORE HEADERONLY
FROM LgBackupLog

It shows 14 transaction logs that have been backed up. The
columns
BackupStartDate and BackupFinishDate have a Date/Time. I assume
that I
use the BackupFinishDate column to restore the database for
Point-in-Time recovery, my question is:

1-Out of the 14 transaction logs which is the first one to restore
and
which is the last one to restore?

The first is the oldest. Well, if it's older than the full backup,
you
don't need it, but SQL Server should tell you. The last log is the
one
that has a FinnishDate after the mistake.

2-Do I only include the StopAt clause on the last transaction log
that I
apply?

A quick look in Books Online tells me that you should be able to
specify
it on all RESTORE commands. "If the specified STOPAT time is after
the last
LOG backup, the database is left in the unrecovered state, just as
if
RESTORE LOG ran with NORECOVERY."

A Google search on "Restoring a Database to a Point Within a Backup"
maybe helpful for you.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:
http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.