SQL Backup Completes with Success but Backup Failed
abuttery@impactrx.com
Posts: 20
I think I found a bug in SQL Backup (standard) 4.0:
I had a RAID controller in a production server fail last night during the backup processing. The job continued to report that each database was backed up successfully but the jobs were failing because the backup files could not be written due to the failed controller. Here is a sample backup email from SQL Backup:
SQL Backup log file
2/7/2006 6:49:19 PM: Backing up RT (full database) to:
L:\SQL_Backups\RT.sqb
2/7/2006 6:49:19 PM: Failed to create backup folder : L:\SQL_BackupsI expect the backup to fail when this occurs.
I had a RAID controller in a production server fail last night during the backup processing. The job continued to report that each database was backed up successfully but the jobs were failing because the backup files could not be written due to the failed controller. Here is a sample backup email from SQL Backup:
SQL Backup log file
2/7/2006 6:49:19 PM: Backing up RT (full database) to:
L:\SQL_Backups\RT.sqb
2/7/2006 6:49:19 PM: Failed to create backup folder : L:\SQL_BackupsI expect the backup to fail when this occurs.
Comments
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8
The backups are being run on NJCINNT37 and then a copy of the backed up file is saved on NJCINNT34 for quick disaster recovery.
The basic question still remains, why is SQL Backup indicating that the backup was successful when it cannot even write to the output device?
-- Alex Buttery
SQL Server Agent reports a failure only if it encounters an error when it executes a T-SQL task. By all means, the SQL stmt that you are running is valid and runs perfectly. However, the result from that T-SQL task is a failure code, which SQL Server Agent does not catch (unlike a command line job step).
In version 4.0, we create T-SQL job steps in the following form:
DECLARE @exitcode int
DECLARE @sqlerrorcode int
exec master..sqlbackup '-sql "<SQL Backup commdn>" ', @exitcode OUTPUT, @sqlerrorcode OUTPUT
IF (@exitcode <> 0) OR (@sqlerrorcode <> 0)
BEGIN
RAISERROR ('SQL Backup step failed: exit code %d, SQL error code: %d',
16, 1, @exitcode, @sqlerrorcode)
END
Any errors are raised manually, and this bubbles up to the SQL Server Agent job.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8