Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Other SQL Server 2012 Topics
 2012 Availability groups and Offloading Backups
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

United Kingdom
121 Posts

Posted - 10/03/2012 :  07:56:17  Show Profile  Reply with Quote
Hi All,

I'm after some thoughts from the collective wisdom

Shortly we will be implementing a Dual Node AlwaysOn cluster, and the one aspect that interests me is the ability to offload the backups to a secondary replica.

Now we take Full Backups at the start and end of the day (COPY_ONLY on the replica I understand), and TLog backups evey 15 minutes.

What I would like to know is, is there a way on each HA Node to determine which one is the Active node so that I can ensure that my backup scripts (In my sysadmindb) only run on the replica??

On the AG Listner I can Run

select SERVERPROPERTY ('ComputerNamePhysicalNetBIOS')

which returns the active Node Name, but it returns NULL when run on either of the HA Nodes.



Posting Yak Master

United Kingdom
121 Posts

Posted - 10/03/2012 :  09:25:44  Show Profile  Reply with Quote
A bit of digging around in the System objects found what I needed.

SELECT sys.fn_hadr_backup_is_preferred_replica ( 'DatabaseName' )

Returns a 1 if it is the secondary replica, and 0 on the primary.

Tony The DBA
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000