After configuring the 2012 alwayson High Availability group, I want to experience the new features of backup in the secondary database. Back up the backup on the secondary server, which can reduce the load on the primary server (a very good improvement, the databasemirroring secondary database is not accessible in the past ).
However, an error is reported during Backup:
Backup databasetesttodisk
= 'C: \ test. Bak'
MSG 3059, level 16, state 1, line 2
This backup or restore command is not supported ona database mirror or secondary replica.
MSG 3013, level 16, state 1, line 2
Backup database is terminating abnormally.
I checked Microsoft's website and found that there are restrictions and limitations on backup of secondary servers:
· Secondary copies only support backup log. Backup database only supports full backup for databases, files, or file groups. Secondary copies do not support differential backup.
Note: |
Copying backups only does not affect the log chain. Likewise, copying backups only does not clear the difference bitmap. |
· To back up the secondary database, the secondary copy must be able to communicate with the primary copy and be in the synchronized or synchronizing state.
· Configure the availability group to support secondary copy backup and create backup preferences only for the locations where the backup is to be performed.
The script is successfully backed up with the copy_only option:
Backup databasetesttodisk
= 'C: \ test. Bak' withcopy_only
Processed 328 pages for database 'test', file 'test' on file 1.
Processed 1 pages for database 'test', file 'test _ log' on file 1.
Backup database successfully processed 329 pages in0.140 seconds (18.327 MB/sec ).
The copy_only option is not required for log backup:
Backup log
Test to disk = 'C: \ test. trn'
Reference: http://msdn.microsoft.com/zh-cn/library/hh710053.aspx