Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server 2005 problem with transaction log backup failing after full backup Expand / Collapse
Author
Message
Posted Thursday, May 22, 2014 9:22 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 18, 2014 3:39 PM
Points: 6, Visits: 27
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.
Post #1573868
Posted Thursday, May 22, 2014 10:10 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 7:31 AM
Points: 17,808, Visits: 15,729
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
Post #1573873
Posted Friday, May 23, 2014 2:22 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 7:46 AM
Points: 40,175, Visits: 36,573
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 2008, MVP
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

Post #1573926
Posted Friday, May 23, 2014 3:41 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
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."
Post #1573949
Posted Friday, May 23, 2014 11:48 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 18, 2014 3:39 PM
Points: 6, Visits: 27
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

Post #1574169
Posted Friday, May 23, 2014 11:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 18, 2014 3:39 PM
Points: 6, Visits: 27
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.
Post #1574170
Posted Friday, May 23, 2014 11:59 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 7:31 AM
Points: 17,808, Visits: 15,729
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
Post #1574173
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse