Backup operation does not protect all the AlwaysOn Databases

Article ID: SQL0017 The backup operation skips the AlwaysOn databases that are a part of an instance on a replica. The replica is protected separately and is not protected as part of an Availability Group client.

Symptom

The backup operation that is running on the AlwaysOn Databases does not protect all the databases.

One of the following events is displayed in the Event Viewer:

  • Skipping database [AlwaysOn_DataBase]. Not a preferred replica to run backup
  • Skipping database [AlwaysOn_ DataBase]. Only BACKUP LOG is fully supported on secondary replicas. BACKUP DATABASE supports only copy-only full backups of the database, files, or file groups. Differential backups are not supported on secondary replicas

Cause

The backup operation that is running against the AlwaysOn databases skips all the databases for one of the following reasons: 

  • The first event is displayed if the secondary replica is set as the preferred replica, and you are trying to run backup on the primary replica.
  • The second event is displayed when a database backup of the secondary replica is attempted. Because the secondary replicas support transaction log and copy only full database backups, the AlwaysOn Databases are skipped.

Resolution

Set the primary replica as the preferred backup replica, and run the backup operation on the preferred replica.