Hi All:
I have configured AlwaysON in my SQL Server 2014 environment.
Now I am trying to setup a backup strategy for the databases in the Availability group.
- When I try to create a management plan which takes full backup on the Primary Replica.
The below T-SQl Query gets automatically generated.
DECLARE @preferredReplica int
SET @preferredReplica=(SELECT [master].sys.fn_hadr_backup_is_preferred_replica('ABC'))
IF(@preferredReplica= 1)
BEGIN
BACKUPDATABASE [ABC]TO DISK=N'F:\Backups\ABC_backup_2014_10_24_001906_4322669.bak'WITHNOFORMAT,NOINIT, NAME =N'ABC_backup_2014_10_24_001906_4322669',SKIP, REWIND,NOUNLOAD, STATS= 10
END
As I get the result for ‘SELECT [master].sys.fn_hadr_backup_is_preferred_replica('ABC')’as ‘0’ the step is skipped and the backup is not taken.
- When I try to create a management plan which takes full backup on the Secondary Replica, I get the following error while executing the backup job
"This BACKUP or RESTORE command is not supported on a database mirror or secondary replica. BACKUP DATABASE is terminating abnormally.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. End Error Warning: 2014-10-24 00:08:54.64 Code: 0x80019002 Source: Subplan_1 Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED
I want to know where do I take the full backup for availability group, please let me know right steps to take proper backups for availability group databases.
Thanks