Backup failed when mirrored location not available
ztuner
Posts: 31
Backup always fails when mirrored location is not available which means there is no backup for that day at all.
Is there an option to ignore mirrored backup if the network location is not avaliable and do the normal backup on local drive only specified in "TO DISK =" and ignore one specified in "WITH MIRRORFILE ="
The help file says:
During the backup process, if any of the files cannot be written a warning is raised. However, the backup process continues as long as at least one specified backup file can be written. If none of the files can be written, an error is raised and the backup process is stopped.
I think this is not the case as the log fils says: Failed to create backup folder : \\XXXXX\ etc.
and the backup just fails with error:
Msg 50000, Level 16, State 1, Line 12
SQL Backup failed with exit code: 500 SQL error code: 0
Can you help to get this one working please?
My Script looks like this:
-SQL "BACKUP DATABASE [MyDatabase]
TO DISK = 'Y:\SQLRedGateBackup\<database>\<AUTO>.sqb'
WITH CONTINUE_AFTER_ERROR,
COMPRESSION = 3,
ERASEFILES = 7,
MIRRORFILE = '\\SERVER_B\<database>\<database>_MIRRORED.sqb' ,
VERIFY "
Thanks
Is there an option to ignore mirrored backup if the network location is not avaliable and do the normal backup on local drive only specified in "TO DISK =" and ignore one specified in "WITH MIRRORFILE ="
The help file says:
During the backup process, if any of the files cannot be written a warning is raised. However, the backup process continues as long as at least one specified backup file can be written. If none of the files can be written, an error is raised and the backup process is stopped.
I think this is not the case as the log fils says: Failed to create backup folder : \\XXXXX\ etc.
and the backup just fails with error:
Msg 50000, Level 16, State 1, Line 12
SQL Backup failed with exit code: 500 SQL error code: 0
Can you help to get this one working please?
My Script looks like this:
-SQL "BACKUP DATABASE [MyDatabase]
TO DISK = 'Y:\SQLRedGateBackup\<database>\<AUTO>.sqb'
WITH CONTINUE_AFTER_ERROR,
COMPRESSION = 3,
ERASEFILES = 7,
MIRRORFILE = '\\SERVER_B\<database>\<database>_MIRRORED.sqb' ,
VERIFY "
Thanks
Comments
SQL Backup only ignores errors with the mirrored backup files while it is writing the backup data. The check for the backup folder is a pre-backup check, which it will flag as a critical error.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8