LOG_BACKUP status not clearing in sys.databases

  • SQL Server 2008R2 SP2

    Does anyone know how to resolve this?

    When I view sys.databases on one of our servers, I can see two databases that have “log_reuse_wait_desc” status of LOG_BACKUP.

    But however many times I run backup log, this message does not clear.

    BACKUP LOG [GHLPLAY] TO DISK=N'G:\Logs\GHLPLAY_Log.bak' WITH NOINIT, SKIP, STATS=20, NAME=N'GHLPLAY Log'

    BACKUP LOG [GHLPLAY] TO DISK=N'G:\Logs\GHLPLAY_Log.bak' WITH NOINIT, SKIP, STATS=20, NAME=N'GHLPLAY Log'

    select name n,recovery_model_desc,log_reuse_wait_desc lrwd,* from sys.databases

    where name like 'GHLPLAY'

    => returns

    nrecovery_model_desclrwd

    GHLPLAYFULLLOG_BACKUP

    It is not (as far as I know) causing any issues but it is a little concerning.

    I don’t know if this is of any relevance but one of the two databases is the only mirrored database on the server – but is currently static (not being used).

  • As I flip through some dbs, I see some set with this state. Never noticed this.

    Not sure if there's an issue here, but I agree it's disconcerting. I found this: http://msdn.microsoft.com/en-us/library/ms345414.aspx

    My guess is this means that we have transactions in the active portion (active VLF) of the log and you need a log backup to clear. However, a log backup won't necessarily move to a new VLF, maybe because of new activity? Strange as I have some dbs in full without this and some in full with it.

  • Thanks Steve.

    It is at least re-assuring to know I am not the only one; I had not found anything similar by doing a web search.

    All the standard texts just say the status will change after doing a Log Backup - and clearly this would always appear to be the case.

  • If you've got enough activity, then the reason for the log not being reused can easily be log backup all the time, because by the time one log backup has completed there's more of the log that's waiting for the next log backup.

    Also the status doesn't always update immediately. Sometimes requires a checkpoint for the status to change (not for the underlying log to be reusable, just for the status in sys.databases to change)

    Why are you concerned? Is the log growing? Are there large portions of the log not being reused?

    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
  • Thanks Gail for the response.

    Checkpoint makes no difference.

    Certainly in one case, there is NO activity on the database; it is database that I set up to test mirroring and I am not using it. (Also NO open transactions.)

    No issue as far as I know - just "not what it says on the tin". Hopefully no more than an acedemic concern.

  • glennhill (8/27/2013)


    Thanks Gail for the response.

    Checkpoint makes no difference.

    Certainly in one case, there is NO activity on the database; it is database that I set up to test mirroring and I am not using it. (Also NO open transactions.)

    No issue as far as I know - just "not what it says on the tin". Hopefully no more than an acedemic concern.

    Same for me. This appears in my AdventureWorks2008 db on one instance that is a test instance and another instance for a different, sandbox db that only I use.

    strange.

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

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