MIRRORFILE problem
MikeShepard
Posts: 12
I want to be able to supply a TO DISK and a MIRRORFILE parameter, and have it succeed if either backup succeeds. The help file leads me to believe that this will work, but when I try it, it seems to return 0 (Failure) if either the TO DISK path or the MIRRORFILE path don't exist.
I am using the extended stored procedure. Here's an example command where the MIRRORFILE path doesn't exist, but the TO DISK does, and it still fails:
-SQL "BACKUP LOG [CRM88DMO] TO DISK = [\\mmofile\sqlbackups\MMOPSDEVAPP2\CRM88DMO\CRM88DMO_sqlbackup_2005-06-20_13.43.47.SQT] WITH NAME = [Database CRM88DMO, 2005-06-20_13.43.47], DESCRIPTION = [Backup on 2005-06-20_13.43.47 Database: CRM88DMO Server: MMOPSDEVAPP2], COMPRESSION=1,ERASEFILES_ATSTART
=3, MIRRORFILE= [ f:\sqlbackups2\CRM88DMO\CRM88DMO_sqlbackup_2005-06-20_13.43.47.SQT]" -E
I am using the extended stored procedure. Here's an example command where the MIRRORFILE path doesn't exist, but the TO DISK does, and it still fails:
-SQL "BACKUP LOG [CRM88DMO] TO DISK = [\\mmofile\sqlbackups\MMOPSDEVAPP2\CRM88DMO\CRM88DMO_sqlbackup_2005-06-20_13.43.47.SQT] WITH NAME = [Database CRM88DMO, 2005-06-20_13.43.47], DESCRIPTION = [Backup on 2005-06-20_13.43.47 Database: CRM88DMO Server: MMOPSDEVAPP2], COMPRESSION=1,ERASEFILES_ATSTART
=3, MIRRORFILE= [ f:\sqlbackups2\CRM88DMO\CRM88DMO_sqlbackup_2005-06-20_13.43.47.SQT]" -E
Comments
An option may be to use the command line executable instead, and use the exit code value to check for warnings/errors, as warnings are in the range 1 to 499. Admittedly, this is a little cumbersome to work into a script.
I've logged an issue to propose that future extended stored procedures return an output value that indicates the actual warning/error code.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8