About Me - Who is DR DBA?

Hello. My name is Rudy Panigas and I am a Production Senior Microsoft SQL Server Database Administrator (DBA) with over 14 years of experience. Have published articles with SQL Central, am a leader for the my local PASS chapter in Toronto (TORPASS) and love to automate anything SQL including disaster recovery. I created this blog to share my views, knowledge and to discuss Microsoft SQL server in order to help out others in this field. Please test these scripts before using. I do not warranty and do not take any responsibility for it, its misuse or output it creates. You can reach me at this email address: sqlsurgeon@outlook.com

Thursday, February 7, 2013

SQL 2012 Always On Replication Monitoring


Hello everyone,

A new feature in SQL 2012 is the Always On replication. It will allow you to replicate a database to a another SQL server and make it available in READ ONLY mode. This is a great addition to SQL Server and you can find out more in BOL (Books On Line) and a lot of places on the internet.

Once Always On is configured and running you should monitor its status to ensure that data is replicating. I have created the script below to help perform this task. You can add to this by placing the results in a table and have a SQL job update the table. Once an error is detected, you can have a report or email alert generated. It's basically up to you.

The last section of the code is commented out. This section is for testing the main script and you should modify and try it out then note the output from the main script.

This script creates no tables or stored procedures but you should test it on your development system first.

Enjoy!

Rudy

Download script here: https://docs.google.com/file/d/0B07PMQYOhF2DNy1OcVBhWmdRZFk/edit?usp=sharing

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.