Skip to main content
SQL Log backup fails with a database corruption error
Updated over 9 months ago

Problem description

SQL Log backup fails with the ‘ Backup detected corruption in the database log’ error.The full backup of the database completes; however, the log backup completes successfully but with an error. An error is seen in one of the databases.

Traceback

  • Phoenix Logs
    Download the logs of the failed job from the following location:
    PhoenixLogs-Jobxxx\xxxxx\PhoenixJobxxx\Phoenix.2019xxxx-xxx-xxx

     [2019-12-16 06:13:19,720] [ERROR] <Thread(Thread-30)> vdilib error: BACKUP detected corruption in the database log. Check the errorlog for more information. [2019-12-16 06:13:19,743] [ERROR] <Thread(Thread-30)> Log data upload failed due to vdilib error for[CORP-SQL2: XXDBA_XXDB] 
     [2019-12-16 06:13:19,756] [ERROR] <Thread(Thread-30)> Error <class 'vdilib.SqlException'>:BACKUP detected corruption in the database log. Check the errorlog for more information. Traceback -Traceback (most recent call last): SqlException: BACKUP detected corruption in the database log. Check the errorlog for more information.
  • SQL Error Logs
    Access the logs from the following location:

    Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\LOG\ERRORLOG and ERRORLOG files
     2019-12-18 04:44:12.69 Backup Error: 3041, Severity: 16, State: 1. 2019-12-18 04:44:12.69 Backup BACKUP failed to complete the command BACKUP LOG XXDBA_XXDB. Check the backup application log for detailed messages. 2019-12-18 04:44:12.71 spid110 Error: 18210, Severity: 16, State: 1. 2019-12-18 04:44:12.71 spid110 BackupVirtualDeviceFile::RequestDurableMedia: Flush failure on backup device '{BF669452-310B-4021-AB92-2AA8E8F272CE}'. Operating system error 995(The I/O operation has been aborted because of either a thread exit or an application request.).

Resolution

  1. Run a DBCC CHECKDB for the database that generated the error. This command checks the logical and physical integrity of all the objects in the specified database.

  2. The previous traces of the Error logs show a corruption detected in the database logs. A flush failure is reported by VDI.

  3. Check whether adequate virtual memory and physical memory is allocated to the SQL server.

  4. This error may occur when the disk, where the DB logs reside, gets full. Ensure that the disk has adequate space.

  5. Re-register the VDI.DLL to avoid any VDI error 1 being reported by the Event Viewer. Refer to the Microsoft guidelines.

  6. Ensure that there is no corruption in the underlying storage hardware.

  7. In the above scenario, there was a flush failure. The issue was fixed by changing the DB Recovery model to Simple and triggering a full backup. This committed the Log to the DB and flushed the logs by itself. Changing the recovery model back to full and then running the consecutive Log backup should fix the issue with flushing.

Did this answer your question?