Backup DB's on High Availability issue

I have an issue with backing up the DB's from cluster server that have 2 nodes on him.

I have a Cluster server with High Availability (for Active/Active cluster) and I trying to take a full backup from him but it says that :

The selected backup type is not supported on a "Always on secondary replica"...

And sending me to Microsoft webpage : http://go.microsoft.com/fwlink/?LinkId=208213 

Active Secondary's: Backup on Secondary Replicas.

All I want to do is to backup the primary node with Full Backup type on nightly basis and shrink the log file . (without un-synchronizing every day)

Thank you

  • Moved by SSISJoostMVP 10 hours 47 minutes ago moved for better support
April 23rd, 2015 12:36pm

Use copy_only for full backup on secondary.

Backup Types Supported on Secondary Replicas

  • BACKUP DATABASE supports only copy-only full backups of databases, files, or filegroups when it is executed on secondary replicas. Note that copy-only backups do not impact the log chain or clear the differential bitmap.
  • Differential backups are not supported on secondary replicas.
  • BACKUP LOG supports only regular log backups (the COPY_ONLY option is not supported for log backups on secondary replicas).

A consistent log chain is ensured across log backups taken on any of the replicas (primary or secondary), irrespective of their availability mode (synchronous-commit or asynchronous-commit).

  • To back up a secondary database, a secondary replica must be able to communicate with the primary replica and must be SYNCHRONIZED or SYNCHRONIZING.

https://msdn.microsoft.com/en-us/library/hh245119.aspx

Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2015 12:59pm

is the database you are trying to backup participate - always availability group, if so,you cannot take full backup on secondary, with out specifying "READONLY". 

are you trying to taking full backup on secondary??

you can take full backup on secondary with read_only.

 you can take log backups on secondary

you cannot take differential backup on secondary 

you can use - sys.fn_hadr_is_primary_replica - to check if the node is primary for the AG and then if it is primary - do the full b

April 23rd, 2015 1:00pm


All I want to do is to backup the primary node with Full Backup type on nightly basis and shrink the log file . (without un-synchronizing every day)

Thank you

You can go to primary replication and run full backup and tlog backup, looks like you are on secondary replica and trying to run backup. Microsoft has provided us with a system function called 

sys.fn_hadr_backup_is_preferred_replica ( 'dbname' )

This function will return 0 if the current instance is not the preferred backup location or 1 if it is the preferred replica for backups according to the preference and priority settings.

Please refer:

http://www.mssqltips.com/sqlservertip/2880/backing-up-sql-server-databases-participating-in-alwayson-availability-groups/



  • Edited by dave_gona 13 hours 58 minutes ago
Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2015 1:10pm

and shrink the log file . (without un-synchronizing every day)

Shrinking the log file isn't a very good idea. If you do this every night the log file will simply grow back to it's original size during the day. And this isn't cheap as the log file can't take advantage of instant initialization. The consequence of doing this will be delays/waits writing to the log file as it auto-grows.

Also, when a database is part of an AlwaysOn group the log file behaves differently, the log VLFs will remain marked as active due to lazy log truncation. So don't be surprised if you're shrinking your log and no space is released to the operating system. 

April 23rd, 2015 3:25pm

if so,you cannot take full backup on secondary, with out specifying "READONLY".

FYI - I think you meant COPY_ONLY and not readonly.

-Sean

Free Windows Admin Tool Kit Click here and download it now
April 24th, 2015 2:41am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics