SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server 2005 problem with transaction log backup failing after full backup


SQL Server 2005 problem with transaction log backup failing after full backup

Author
Message
csastri
csastri
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 28
Here is the sequence of events, after a maintenance plan with full backups and log backups started having problems with the log backup portion of the plan. To isolate the problem I did backups and log backups on each database to isolate the problem cases. The details below:

Database 1:
1. Take a full backup - it succeeds
2. Take a log backup immediately after - it succeeds.
3. Take a log backup after step 2 -- fails with message
"BACKUP LOG cannot be performed because there is no current database backup.

Database 2:
1. Take a full backup - it succeeds.
2. Take a log backup immediately after - it fails with message "BACKUP LOG cannot be performed because there is no current database backup.

Databases 3,4,5 on same server full backups and log backups work normally.
Any assistance or insight greatly appreciated.
SQLRNNR
SQLRNNR
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32561 Visits: 18557
is this just the case when running these backups via maintenance plan?

What happens when running a tsql script backup?

Any chance the recovery model is getting switched to simple and back to full in between backups?



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87895 Visits: 45274
Something switching recovery models after the backup? Check the SQL error log.

Edit: Also check the error log for messages indicating explicit log truncation (backup log with truncate_only). It may be that there's something like that scheduled for that DB only.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


free_mascot
free_mascot
Hall of Fame
Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)

Group: General Forum Members
Points: 3991 Visits: 2235
Execute following command and check the recovery model of the user databases on which you do have issue.

select name, recovery_model_desc from sys.databases

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
csastri
csastri
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 28
The tests were done using T-SQL for the database and log backups.
All databases are in 'Full Recovery' mode.
The SQL Server Log does show this entry repeatedly:
BACKUP LOG WITH TRUNCATE_ONLY or WITH NO_LOG is deprecated. The simple recovery model should be used to automatically truncate the transaction log.

But I not see anything in the Maintenance plan that would indicate that the recovery modes are switched.

In addition further research has led me to run this query:
SELECT
DB_NAME(database_id), last_log_backup_lsn
FROM
sys.database_recovery_status;

This shows that the two problem databases have the last_log_backup_lsn = NULL
I gather this means the chain is broken and it has be restarted.
Would the correct procedure be:
1. Stop all user activity in the database
2. Switch to the SIMPLE recovery model (breaking the log backup chain and removing the requirement that the damaged portion of log must be backed up)
3.Switch to the FULL recovery model
4. Take a full database backup (thus starting a new log backup chain)
5. Start taking log backups
csastri
csastri
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 28
The tests were done using T-SQL for the database and log backups.
All databases are in 'Full Recovery' mode.
The SQL Server Log does show this entry repeatedly:
BACKUP LOG WITH TRUNCATE_ONLY or WITH NO_LOG is deprecated. The simple recovery model should be used to automatically truncate the transaction log.
But I not see anything in the Maintenance plan that would indicate that the recovery modes are switched.

In addition further research has led me to run this query:
SELECT
DB_NAME(database_id), last_log_backup_lsn
FROM
sys.database_recovery_status;

This shows that the two problem databases have the last_log_backup_lsn = NULL
I gather this means the log backup chain is broken and it has be restarted.

Would the correct procedure be:
1. Stop all user activity in the database
2. Switch to the SIMPLE recovery model (breaking the log backup chain)
3. Switch to the FULL recovery model
4. Take a full database backup (thus starting a new log backup chain)
5. Start taking log backups

Thanks in advance.
SQLRNNR
SQLRNNR
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32561 Visits: 18557
Based on the errors, it appears you have something/someone trying to trunc the log.

the steps you listed are unnecessary to resolve the issue.

Find what is truncating the log and make sure nothing is switching your databases from full -> simple -> full.

Oh, and get your maintenance routines switched from using the Maintenance Plans and start using scripts.



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search