Pages

Tuesday, November 19, 2013

Backup Database Error SQL Server 2012: This BACKUP or RESTORE command is not supported on a database mirror or secondary replica. BACKUP DATABASE is terminating abnormally

Microsoft SQL Server 2012 has introduced a new feature called AlwaysOn High Availability. There are numerous resources online to get information on AlwaysOn High Availability. So here i am not going in depth with features of this.

Will be coming up with some interesting post on this topic later. But for those you have already configured this feature, you might run into below error while running a backup command.

"This BACKUP or RESTORE command is not supported on a database mirror or secondary replica. BACKUP DATABASE is terminating abnormally"

This is because AlwaysOn is configured to only allow backups on the primary replica.

So avoid this if you are running backup from Some SSIS Package, make sure you include below phrase in your backup command

sys.fn_hadr_backup_is_preferred_replica ( name ) = 1



So this will run backup on databases which are only Primary replica.





Hope this helps.

No comments:

Post a Comment