If you are near Pittsburgh, PA on May 22, 2014 catch the following all-day training session from 8:30 AM to 4:00 PM (EDT)
Do you need to build a High Availability (HA) and/or Disaster Recovery (DR) strategy for SQL Server Databases? If so, you will no doubt have questions like:
• What does a good High Availability or Disaster Recovery strategy look like?
• What options are available to help implement a proper HA/DR strategy?
• What do I do if my database server goes down?
• How do I mitigate downtime for planned outages?
• How much time do I have to recover, and which native SQL Server features helps me reach my goal?
• How does this work with my company’s existing HA/DR strategy?
Linchpin People & SIOS are offering this seminar to answer those questions and more!
In this all-day training, we will help teach you the fundamentals and best practices of building and implementing a full HA/DR Strategy for your company. You will learn how to build a recovery plan by mastering the basics of backups and restores. You will also learn how to implement and monitor log shipping, database mirroring, replication, Windows clustering, SQL Server Failover Clustering Instances, and the new Availability Group features. After this training session, you will have the knowledge to design, implement and manage your very own high availability and disaster recovery (HA/DR) plan.
Meet The Presenters!
John Sterrett is a Group Principal and Sr. Consultant at Linchpin People. Previously, he was a Sr. Database Admin Advisor for Dell, directly responsible for several mission-critical databases behind dell.com. John has presented at many community events, is a PASS Regional Mentor, and one of the founders of the WVPASS user group and the PASS HA/DR Virtual Chapter.
Tim Radney is the Lead System DBA for a top 40 US held bank. He is also a chapter leader for the Columbus GA SQL Users Group, PASS Regional Mentor for Greater South East US. Tim is a Microsoft Systems Admin turned DBA. Prior to becoming a full time DBA, he spent 10 years supporting Citrix, Novell, Windows, IIS, and MSSQL.
Thursday May 22nd, 2014 - 8:30am-4:30pm (EDT)
Cost: $79.00 before April 30th, $99.00 after April 30th Location:
30 Isabella St., Second Floor
Alcoa Business Services Center
Pittsburgh, PA 15212
Phone: (412) 323-6700 Food: Lunch, and drinks will be provided at the event location. Please contact the organizer if you require a vegetarian option.
In SQL Server 2012 we got this great new high availability feature called availability groups. With readable secondaries under the covers it can be harder to figure out the following two questions. When did the availability group failover? Where did the availability group go when the failover occurred? The goal of this blog post is to help you answer these questions.
AlwaysON Extended Event
One of the things I really like about Availability Groups is that there is a built-in extended event named “ALwaysOn_health” that runs and captures troubleshooting information. I took a look at the extended event and noticed that there are several error numbers that were included in the filter for this extended event. This is shown below as I scripted out the default extended event for a quick review.
CREATE EVENT SESSION [AlwaysOn_health] ON SERVER
ADD EVENT sqlserver.alwayson_ddl_executed,
ADD EVENT sqlserver.availability_group_lease_expired,
ADD EVENT sqlserver.availability_replica_automatic_failover_validation,
ADD EVENT sqlserver.availability_replica_manager_state_change,
ADD EVENT sqlserver.availability_replica_state_change,
ADD EVENT sqlserver.error_reported(
WHERE ([error_number]=(9691) OR [error_number]=(35204) OR [error_number]=(9693) OR [error_number]=(26024) OR [error_number]=(28047)
OR [error_number]=(26023) OR [error_number]=(9692) OR [error_number]=(28034) OR [error_number]=(28036) OR [error_number]=(28048)
OR [error_number]=(28080) OR [error_number]=(28091) OR [error_number]=(26022) OR [error_number]=(9642) OR [error_number]=(35201)
OR [error_number]=(35202) OR [error_number]=(35206) OR [error_number]=(35207) OR [error_number]=(26069) OR [error_number]=(26070)
OR [error_number]>(41047) AND [error_number]<(41056) OR [error_number]=(41142) OR [error_number]=(41144) OR [error_number]=(1480)
OR [error_number]=(823) OR [error_number]=(824) OR [error_number]=(829) OR [error_number]=(35264) OR [error_number]=(35265))),
ADD EVENT sqlserver.lock_redo_blocked
ADD TARGET package0.event_file(SET filename=N'AlwaysOn_health.xel',max_file_size=(5),max_rollover_files=(4))
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=ON)
This got me interested in learning why these specific errors were included in the extended event session created specifically for managing Availability Groups. Knowing that the descriptions for errors are kept in the sys.messages table I did a little digging.
Taking the error numbers from the AlwaysON_health extended event I was able to build the following query to get the description of the errors included in the extended event.
FROM sys.messages m where language_id = 1033 -- English
--AND m.message_id =1480
AND ([message_id]=(9691) OR [message_id]=(35204) OR [message_id]=(9693) OR [message_id]=(26024) OR [message_id]=(28047)
OR [message_id]=(26023) OR [message_id]=(9692) OR [message_id]=(28034) OR [message_id]=(28036) OR [message_id]=(28048)
OR [message_id]=(28080) OR [message_id]=(28091) OR [message_id]=(26022) OR [message_id]=(9642) OR [message_id]=(35201)
OR [message_id]=(35202) OR [message_id]=(35206) OR [message_id]=(35207) OR [message_id]=(26069) OR [message_id]=(26070)
OR [message_id]>(41047) AND [message_id]<(41056) OR [message_id]=(41142) OR [message_id]=(41144) OR [message_id]=(1480)
OR [message_id]=(823) OR [message_id]=(824) OR [message_id]=(829) OR [message_id]=(35264) OR [message_id]=(35265))
ORDER BY Message_id
Now we will focus on one particular error message. This is error message 1480. Looking at the description below you will see that every time a database included in an availability group or in database mirroring changes its role this error occurs.
The %S_MSG database “%.*ls” is changing roles from “%ls” to “%ls” because the mirroring session or availability group failed over due to %S_MSG. This is an informational message only. No user action is required.
When did my AlwaysOn Availability Group Failover?
By now it should not be a big surprise to see how you can figure out when our availability group failed over. To answer this question we are going to filter the “AwaysOn_health” extended event for error_number 1480.
The “AlwaysOn_health” extended event target is to file and by default it will utilize the default log folder for SQL Server. Also keep in mind, that by default the target does rollover for 4 5 MB files for a total of 20 MB. If you are constantly having events occur data will be purged.
For my server used for this blog post my path is “C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\” if this is not your path you will need to modify line 2 in the script below.
;WITH cte_HADR AS (SELECT object_name, CONVERT(XML, event_data) AS data
FROM sys.fn_xe_file_target_read_file('C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\AlwaysOn*.xel', null, null, null)
WHERE object_name = 'error_reported'
SELECT data.value('(/event/@timestamp)','datetime') AS [timestamp],
data.value('(/event/data[@name=''error_number''])','int') AS [error_number],
data.value('(/event/data[@name=''message''])','varchar(max)') AS [message]
WHERE data.value('(/event/data[@name=''error_number''])','int') = 1480
Below you will see an example of the result set which shows my last failover.
You could also utilize the Extended Event GUI to watch data. We will skip that today as I would recommend using T-SQL so you can find failovers in multiple Availability Groups on different servers. We will go into more detail about this process a little later in the blog post.
How Do We Become Proactive?
If you want an action to occur when an database inside an availability group changes roles to be proactive you can configure an SQL Agent Alert. An SQL Agent alert can performs an actions like sending an email to your DBA team or running another SQL Agent job to perform your required action.
The following shows you how to configure this alert via the SSMS user interface.
NOTE: This assumes you have an standard install process that keeps the default log path the same across your SQL Server 2012 instances. I strongly encourage that you have an automated SQL Install process that keeps using the same path for all your installs but we will keep that blog post for another day.
Please follow the Twitter tag @SQLPASS_HADR for announcements of upcoming sessions, and check out the home page for the virtual chapter at hadrvc.sqlpass.org for details on the future sessions. Make sure to visit MyPASS dashboard and add the HADR virtual chapter to your MyChapters page so you get the announcements as they happen!
Are you interested in joining us building the HADR Virtual Chapter?
I have a feeling that David and I are not the only ones in the SQL Community interested in building a virtual chapter from scratch. We are currently looking for people to help host meetings, manage the web site, drive marketing, and finding speakers, If you are interested in joining us contact me.
Welcome to the first Throwback Thursday blog post of 2014. Throwback Thursday is a blog series where I dig deep into my evernote collection and find some great content on a single subject and share it with you. In the fourth installment of the Throwback Thursday series we are going to cover the plan cache.
One of the features that is helpful for performance tuning in SQL Server is the plan cache. Many DBA’s understand that when you execute a stored procedure by default the execution plan gets cached so it can be reused. This allows CPU cycles to be saved as you don’t have to recompile stored procedures every time they are executed. What some DBA’s don’t know is that you can leverage the plan cache to get performance metrics. During this Throwback Thursday we are going to focus on some great community articles, white papers and blogs that can greatly improve your performance tuning process though using the plan cache.
Plan Caching in SQL Server 2008 - This is a great white paper by Microsoft that gives you a great introduction into what the plan cache is and how can make your performance tuning life easier.
How to Drop One Plan from Cache – A lot of DBA’s think that DBCC FREEPROCCACHE is used only to drop all the execution plans from your instance. Grant Fritchey does a great job showing how you can utilize this DBCC command to remove only a single plan.
Finding Top Offenders from Plan Cache – This is how I go about finding top offenders for frequently used execution plans. It’s not the only tool in my tool-belt for performance tuning but it can be a good starting point.
Finding Key Lookups in Plan Cache - At the end of the day, a execution plan is cached as XML. Kendal Van Dyke does a great job showing us how we can probe this XML structure to find key lookup operators inside of the plans that are in the plan cache.
T-SQL Tuesday is a monthly blog party hosted by a different blogger each month.
T-SQL Tuesday 50 – Automation
This blog party was started by Adam Machanic (blog|twitter). You can take part by posting your own participating post that fits the topic of the month. This month, SQLChow blessed us with a topic I am very passionate about. This months T-SQL Tuesday topic is automation.
I have a confession to share. I am a Lazy DBA. Those who know me won’t be shocked by reading this. Those who don’t know me. Trust me, I mean this in a good way. My lazyness over the years has actually motivated me to be a better DBA and data professional. I learned early on in my career that in order to be productive I must automate. No longer can we do manual daily checklists. We lose several hours that could have been spent on tasks that show our value not just hold the status quo. Automation allows us to end the cycle of repeating tasks and allows me to spend that time doing things that provide value, save the company money and make us happy.
I see more things being automated. More and more parts of the current “Production DBA” role as we know it today will be automated. This is going to open us up to doing amazing things. One day, an end to end performance tuning process will be automated. I look forward to seeing things that we thought were not possible be possible and automated. For example, automating server procurement and deployment once fell into this realm. Now, it’s already here. It’s known as “the cloud”. I will be honest, I was shocked to see how easy and quick it is to deploy an Windows Azure Server.
What are your thoughts about automation? Where do you see it going in the future?
I hope everyone is having a good time gearing up for the holidays. Throwback Thursday is a bi-weekly blog series where I dig deep into my evernote collection and find some great content on a single subject and share it with you. In the third installment of the Throwback Thursday series we are going to cover some helpful SQL Server disk articles.
IOPS Calculator – This is a great tool to figure out how many IOPS you should get from your storage configuration. It’s also a helpful tool for estimating how many disks are needed to support your workload if you are purchasing new storage.
The Fundamental of Storage Systems - We couldn’t talk about storage and SQL Server without mentioning my friend Wes Brown. He has a plethora of information on this subject including this is a great blog series that hits all the basics.
Storage Top 10 Best Practices – A great quick list of best practices for storage with SQL Server provide by Microsoft. Over time, I have seen all of these best practices be neglected. I neglected a few myself when I was starting out and I paid for it.
Benchmark SQL Server Disk Latency - The following is how I benchmark disk latency with SQL Server. Remember this is just for SQL Server so you also want to take a look at perfmon too to verify if SQL Server is the cause to your I/O problems.
Measuring Disk Latency with Windows Performance Monitor – Perfmon (Windows Performance Monitor) is the gold standard for measuring disk performance inside of windows. Have you ever wondered what exactly is included in the stack when you look at Avg Disk reads/sec? Jeff Huges does a great job of answering this question and some others you might not be thinking about.
I hope everyone is having a great Thanksgiving with their families. When you come out of that food coma I hope you enjoy my second blog post in the Throwback Thursday series. Throwback Thursday is a bi-weekly blog series where I dig deep into my evernote collection and find some great content on a single subject and share it with you.
This week were going to cover becoming a speaker and becoming a better speaker. I am still working on several tips included in these links.
You Don’t Have to Be an Expert To Speak - One of the first fears I had when I considered building presentations was that I wasn’t an expert. After doing some thinking I decided to write why I got up and present regardless of my experience.
Why You Should Create A Speakers Resume – If you have completed the hard task of building and giving a presentation make sure you get some credit. Kendra Little gives some great advice. At first I didn’t do this. Once I started I found out it helped me get some great jobs and more speaking gigs.
I have a quick secret to share with my readers. Ever since I saw Tom Larock’s SQL Server Blogger rankings I have always wanted to be on that list. Today, that happened. To many it might seem like a small accomplishment towards bigger accomplishments. Right now, I am just happy take a moment and realize I accomplished something I didn’t think was possible when I stared blogging.
When I started blogging my goals were simple. I wanted to improve my communication skills, document lessons learned so I could find them and share knowledge. In reality, it has opened doors and given me opportunities I never thought would come my way.
One of my hobbies is being a turntablist. In high school I took a job just so I could buy myself two Technics 1200′s, crates full of records and a mixer. I love scratching, beat juggling, and mixing accapella tracks over instrumentals. The radio stations I like would always have a turntablist mix old school hits on Thursday. The show was called Throwback Thursdays.
I am not the only turntablist in the family.
Being a database professional I learned to like backups. Backups didn’t just apply to database backups. I use evernote to backup blogs and articles that I found that are helpful for my career. Recently, this gave me a great idea to group them and share the ones that are old but still very valuable to my career. I am basically mixing some great content that you forgot about or never found that still applies as great reference material. If they are still helpful to me I bet they are helpful to others who frequently visit this blog.
#1 Throwback Topic: SQL Inspire
I had many different ideas for the first thursday throwback. I decided to go with my all-time favorite needle in the haystack. When I would go crate digging for a great instrumental to mix with a new hip hop song I would typically look for something that was unique and different. When I think of conferences I found that with SQL Inspire. All presentations were recorded and they are still online. The concept is simple, try to inspire SQL people. Not only did Andy and Brian put on an event that inspired me, it also gave me my favorite SQL Server presentation of all-time. You can watch it below its only 20 minutes.
You can also catch the follow up interview. Tom’s prediction on the future of PASS two years ago is spot on. I think PASS accomplished some of those goals in just two years.
Here are all the SQL Inspire Presentations. I recommend that you watch them.
Today, I have the privilege of speaking at the SQL PASS Big Data Virtual Chapter Meeting at 2PM EST time. These meetings are free for everyone to attend. If you are new to Virtual Chapters I highly suggest that you check them out. All sessions are recorded so you can find several recordings for a similar topic.