<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx</link><description>You may think that having a database set to FULL Recovery Model means that your database can be fully recovered. The key word in that previous sentence is 'can'. It is possible to fully recovery a database in FULL recovery, or to restore it to an arbitrary</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#10212</link><pubDate>Mon, 01 Dec 2008 09:08:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:10212</guid><dc:creator>Hugo Kornelis</dc:creator><description>&lt;p&gt;Hi Kalen,&lt;/p&gt;
&lt;p&gt;Good post. But allow me to pick a nit. The third way to get into auto-truncate is not &amp;quot;you have never taken a full backup&amp;quot;, but &amp;quot;you have never taken a full backup SINCE THE LAST TIME YOU SWITCHED FROM SIMPLE TO FULL RECOVERY&amp;quot;.&lt;/p&gt;
&lt;p&gt;Probably obvious to any reader, but I wanted to point it out anyway.&lt;/p&gt;
&lt;p&gt;Best, Hugo&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#10223</link><pubDate>Mon, 01 Dec 2008 16:40:15 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:10223</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;Hi Hugo&lt;/p&gt;
&lt;p&gt;I've made the correction, and also enhanced on your correction a bit!&lt;/p&gt;
&lt;p&gt;~Kalen&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#10227</link><pubDate>Tue, 02 Dec 2008 00:55:31 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:10227</guid><dc:creator>James Luetkehoelter</dc:creator><description>&lt;p&gt;Great Kalen, excellent point - I've seen it more than once. Actually it is true if you've never taken a full backup, you're dead in the water anyway Hugo :)&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#10335</link><pubDate>Sun, 07 Dec 2008 04:42:08 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:10335</guid><dc:creator>David</dc:creator><description>&lt;p&gt;There's a typo in the paragraph &amp;quot;So how can you tell....&amp;quot; &amp;nbsp;&amp;quot;sys. recovery_recovery_status&amp;quot; should be &amp;quot;sys.database_recovery_status&amp;quot;&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#10336</link><pubDate>Sun, 07 Dec 2008 04:54:21 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:10336</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;Thanks David... I've done that several times recently.. the code is correct (because I test that before publishing) but the description is a bit sloppy..&lt;/p&gt;
&lt;p&gt;It should be fixed now ...&lt;/p&gt;
&lt;p&gt;~Kalen&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#10483</link><pubDate>Fri, 12 Dec 2008 14:17:26 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:10483</guid><dc:creator>Rob Maurer</dc:creator><description>&lt;p&gt;SELECT *&lt;/p&gt;
&lt;p&gt;FROM sys.database_recovery_status&lt;/p&gt;
&lt;p&gt;Server: Msg 208, Level 16, State 1, Line 1&lt;/p&gt;
&lt;p&gt;Invalid object name 'sys.database_recovery_status'.&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#10704</link><pubDate>Mon, 22 Dec 2008 22:25:42 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:10704</guid><dc:creator>Mike Suarez</dc:creator><description>&lt;p&gt;Thanks for the explanation!&lt;/p&gt;
&lt;p&gt;This actually clears a lot up for me. A while back, I was playing around with transaction logs in different recovery modes. I added data to tables, invoked checkpoints, and shrunk the files, all while looking at the physical size of the files every step of the way. I was suprised to see the same behavior under both simple and full recovery modes. I just assumed that maybe i didnt understand what was going on as well as i thought i did. But now I know that the reason they were doing the same thing was because they were still both in auto-truncate mode (because of reason #3). Now I am back to believing that I understand it. Thanks!&lt;/p&gt;
</description></item><item><title>A year in review, The 31 best blog posts on SQLBlog for 2008</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#10874</link><pubDate>Wed, 31 Dec 2008 15:38:04 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:10874</guid><dc:creator>Denis Gobo</dc:creator><description>&lt;p&gt;Wow, it has been already a year since I wrote A year in review, The 21 + 1 best blog posts on SQLBlog&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#19111</link><pubDate>Mon, 23 Nov 2009 09:50:41 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:19111</guid><dc:creator>martinz</dc:creator><description>&lt;p&gt;Hi Kalen,&lt;/p&gt;
&lt;p&gt;Thanks for providing these details.&lt;/p&gt;
&lt;p&gt;I believe that there may be another senario to get into auto-truncate.&lt;/p&gt;
&lt;p&gt;That is when the database is reverted from a snapshot.&lt;/p&gt;
&lt;p&gt;I've been playing with the script you provided and have added a few details below.&lt;/p&gt;
&lt;p&gt;CREATE DATABASE FOO&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;-- Check status after first creating db&lt;/p&gt;
&lt;p&gt;SELECT db_name(database_id) as 'database', last_log_backup_lsn &lt;/p&gt;
&lt;p&gt;FROM sys.database_recovery_status&lt;/p&gt;
&lt;p&gt;WHERE database_id = db_id('foo') &lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;BACKUP DATABASE foo TO disk = 'C:\foo.bak'&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;-- Check status after backing up db&lt;/p&gt;
&lt;p&gt;SELECT db_name(database_id) AS 'database', last_log_backup_lsn &lt;/p&gt;
&lt;p&gt;FROM sys.database_recovery_status&lt;/p&gt;
&lt;p&gt;WHERE database_id = db_id('foo') &lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;-- Check status after truncating log&lt;/p&gt;
&lt;p&gt;SELECT db_name(database_id) AS 'database', last_log_backup_lsn &lt;/p&gt;
&lt;p&gt;FROM sys.database_recovery_status&lt;/p&gt;
&lt;p&gt;WHERE database_id = db_id('foo') &lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;ALTER DATABASE [FOO] SET RECOVERY SIMPLE WITH NO_WAIT&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;SELECT db_name(database_id) AS 'database', last_log_backup_lsn &lt;/p&gt;
&lt;p&gt;FROM sys.database_recovery_status&lt;/p&gt;
&lt;p&gt;WHERE database_id = db_id('foo') &lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;USE [master]&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;ALTER DATABASE [FOO] SET RECOVERY FULL WITH NO_WAIT&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;BACKUP DATABASE foo TO disk = 'C:\foo.bak'&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;SELECT db_name(database_id) AS 'database', last_log_backup_lsn &lt;/p&gt;
&lt;p&gt;FROM sys.database_recovery_status&lt;/p&gt;
&lt;p&gt;WHERE database_id = db_id('foo') &lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;CREATE DATABASE foo_dbss ON&lt;/p&gt;
&lt;p&gt;( NAME = foo, FILENAME = &lt;/p&gt;
&lt;p&gt;'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Data\foo_snapshot.ss' )&lt;/p&gt;
&lt;p&gt;AS SNAPSHOT OF foo;&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;RESTORE DATABASE foo from &lt;/p&gt;
&lt;p&gt;DATABASE_SNAPSHOT = 'foo_dbss';&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;SELECT db_name(database_id) AS 'database', last_log_backup_lsn &lt;/p&gt;
&lt;p&gt;FROM sys.database_recovery_status&lt;/p&gt;
&lt;p&gt;WHERE database_id = db_id('foo') &lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;DROP DATABASE [foo_dbss]&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
&lt;p&gt;DROP DATABASE foo&lt;/p&gt;
&lt;p&gt;GO&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#22635</link><pubDate>Fri, 26 Feb 2010 16:29:06 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:22635</guid><dc:creator>SteveLaRochelle</dc:creator><description>&lt;p&gt;I have a database that appears to be in auto-truncate mode, yet the truncation never happens. &amp;nbsp;DB is in Simple mode; last_log_backup_lsn in database_recovery_status is NULL. &amp;nbsp;Full backups are taken nightly. &amp;nbsp;However the % of transaction log continues to grow, leading to transaction log growth, hundreds of VLFs all Status=2(Active), etc. The database has one snapshot publication which seems to be the cause; existence of it prevents the auto-truncation. &amp;nbsp;Drop/recreate of publication does clear the active portion of the log. &amp;nbsp;Same with (manually) running sp_repldone NULL,NULL,0,0,1. &amp;nbsp;Though both of those seem like band aids to cover or compensate for whatever the real problem is.&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#22715</link><pubDate>Mon, 01 Mar 2010 23:43:45 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:22715</guid><dc:creator>Kalen Delaney</dc:creator><description>&lt;p&gt;Hi Steve&lt;/p&gt;
&lt;p&gt;If your VLFs are all active, it doesn't matter how many truncates you do. Truncate (whether by being in SIMPLE mode or otherwise) will not affect active log. (Note that status 2 doesn't necessarily mean active, it just means not truncatable, as you are finding. Also, backing up the full database never has any effect on the log.)&lt;/p&gt;
&lt;p&gt;This sure sounds like replication is the culprit. Have you tried completely removing replication?&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://support.microsoft.com/kb/324401"&gt;http://support.microsoft.com/kb/324401&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;~Kalen&lt;/p&gt;
</description></item><item><title>re: Geek City: When is FULL Recovery not Really FULL Recovery</title><link>http://sqlblog.com/blogs/kalen_delaney/archive/2008/11/30/when-is-full-recovery-not-really-full-recovery.aspx#22757</link><pubDate>Tue, 02 Mar 2010 17:17:13 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:22757</guid><dc:creator>SteveLaRochelle</dc:creator><description>&lt;p&gt;I just ran some tests, and replication looks to be the problem; however, replication TO this database may be the cause? &amp;nbsp;I removed all replication to/from this DB. &amp;nbsp;Transaction log usage went to a minimal amount. &amp;nbsp;I recreated my lone snapshot publication then executed a few thousand dummy transactions. &amp;nbsp;I saw the log file usage, and file, grow as the transactions were occurring. &amp;nbsp;But a minute later, usage is back to a minimal amount which is expected in a DB that is in auto-truncate mode. &amp;nbsp;I haven't recreated the transactional replication that is going TO this database yet, but is it possible that being a push subscriber is what is preventing my log file from auto-truncating? &amp;nbsp;If so, how, and how to fix? &amp;nbsp;I have plenty of other auto-truncate DBs that are push subscribers that don't have this problem. Seems that the combination of push subscriber and IsPublished=1 leads to my issue.&lt;/p&gt;
</description></item></channel></rss>