February 8, 2010 at 8:51 pm
Comments posted to this topic are about the item Transaction Log Backups
Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
February 9, 2010 at 12:25 am
sad, i got this one wrong... 🙁
2 options looked very likely ...
http://msdn.microsoft.com/en-us/library/aa173551(SQL.80).aspx
February 9, 2010 at 12:47 am
Thanks Paul. Excellent question.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
February 9, 2010 at 12:49 am
from sql help http://msdn.microsoft.com/en-us/library/ms186865.aspx
Under the full recovery model or bulk-logged recovery model, conventional backups also include sequential transaction log backups (or log backups), which are required. Each log backup covers the portion of the transaction log that was active when the backup was created, and it includes all log records not backed up in a previous log backup.
This indecates that the last answer is correct.
Also it would need to backup anything not backed up in a previous log backup so that it could restore to a point in time after the last log backup.
February 9, 2010 at 1:13 am
Good question..simple one if basics are clear...
February 9, 2010 at 5:28 am
This was removed by the editor as SPAM
February 9, 2010 at 6:35 am
This page suggests that option 2 is correct:
http://msdn.microsoft.com/en-us/library/ms186289.aspx
You can re-create a whole database in one step by restoring the database from a full database backup to any location. Enough of the transaction log is included in the backup to let you recover the database to the time when the backup finished.
February 9, 2010 at 6:35 am
Great question - got it wrong, but caused me to think.
Steve Jimmo
Sr DBA
“If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan
February 9, 2010 at 6:46 am
Good question. Easy if you understand recovery models and backup/restore processes.
February 9, 2010 at 8:23 am
@jadsmith But the question wasn't about log backups - it was about full backups. Full backups do not affect log backups, nor do they take them into account. A full backup only has to include the transaction log necessary to recover the database consistently to the time when the data-reading portion of the backup completed. It doesn't matter if the transaction log is GBs and there hasn't been a log backup for weeks - the full backup doesn't backup log it doesn't need.
Only a log backup will backup all log generated since the last log backup completes. And only a log backup in the FULL or BULK_LOGGED recovery models will allow the log to clear/truncate.
@John.curran.z3g That wouldn't be enough to recover the database. If there was a long running transaction that started before the full backup did, only backing up the transaction log generated during the backup would not allow the transaction to be rolled back correctly during the restore operation. All the transaction log for that transaction, all the way back to the initial LOP_BEGIN_XACT log record must be backed up for recovery to be able to operate correctly.
See my article in TechNet Magazine for a more full explanation: Understanding SQL Server Backups and also this blog post which gives you code examples you can use to convince yourself of what's going on under the covers: Misconceptions around the log and log backups: how to convince yourself
Thanks
Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
February 9, 2010 at 8:46 am
Lynn Pettis (2/9/2010)
Good question. Easy if you understand recovery models and backup/restore processes.
Yeah. What he said. Full means complete, all in one.
Nice question.
February 9, 2010 at 9:37 am
Excellent question. Then I noticed who the author of it is, and realized... but of course!
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
February 9, 2010 at 9:26 pm
That wouldn't be enough to recover the database. If there was a long running transaction that started before the full backup did, only backing up the transaction log generated during the backup would not allow the transaction to be rolled back correctly during the restore operation
I was under the impression that at the start of a backup, a checkpoint is issued and a marker is placed in the trans log indicating that a database wide lock was obtained (to ensure there are no running transactions), this lock is then released and the backup is performed. At the end of the backup, another checkpoint is issued (another lock obtained and released) and the section of the transaction log between the two checkpoints is backed up. Has this changed between 2005 and 2008 or did I dream all that 😀
February 9, 2010 at 9:41 pm
With all due respect Ted, you dreamed everything you described above 🙂 It doesn't do any of that except the checkpoint at the start, and that's just to flush out as many dirty pages from the buffer pool as it can, so as to reduce the amount of REDO recovery to do during the restore sequence.
[Edit: btw, a checkpoint doesn't take locks either - see my blog post for details: How do checkpoints work and what gets logged. Whatever differing descriptions you may read elsewhere are unfortunately incorrect - this description is based on the code itself.]
Take a look at my backup article I referenced a few posts above which explains exactly what happens.
It's worked the same way since 7.0 up to 2008.
Thanks
Paul Randal
CEO, SQLskills.com: Check out SQLskills online training!
Blog:www.SQLskills.com/blogs/paul Twitter: @PaulRandal
SQL MVP, Microsoft RD, Contributing Editor of TechNet Magazine
Author of DBCC CHECKDB/repair (and other Storage Engine) code of SQL Server 2005
February 10, 2010 at 3:05 am
Viewing 15 posts - 1 through 15 (of 17 total)
You must be logged in to reply to this topic. Login to reply