SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

TonyTheDBA
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.

Regards

Tony

TonyTheDBA
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.



--
Regards
Tony The DBA
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.06 seconds. Powered By: Snitz Forums 2000