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

  • 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.

  • 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[/url]
    Learn Extended Events

  • 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
  • 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."

  • 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

  • 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.

  • 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[/url]
    Learn Extended Events

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply