Troubleshooting Service Broker

Slides:



Advertisements
Similar presentations
Service Broker Lesson 11. Skills Matrix Service Broker Service Broker, provides a solution to common problems with message delivery and consistency that.
Advertisements

Event Notifications with Service Broker Phil Brammer.
11 NETWORK PROTOCOLS AND SERVICES Chapter 10. Chapter 10: Network Protocols and Services2 NETWORK PROTOCOLS AND SERVICES  Identify how computers on TCP/IP.
How a little code can help with support.. Chris Barba – Developer at Cimarex Energy Blog:
Copyright ®xSpring Pte Ltd, All rights reserved Versions DateVersionDescriptionAuthor May First version. Modified from Enterprise edition.NBL.
DAT325 SQL Server 2005 (Codenamed “Yukon”): Using the Service Broker To Build Asynchronous, Queued Database Applications Roger Wolter Program Manager.
Endpoints Lesson 17. Skills Matrix Endpoints Endpoints provide a reliable, securable, scalable messaging system that enables SQL Server to communicate.
Making Sense of Service Broker Inside the Black Box.
Troubleshooting Exchange Transport Service Miha Pihler MVP – Enterprise Security Microsoft Certified Master | Exchange 2010.
C:\Users\> t An affair with SQL Server for nearly a decade Was part of SQL Escalation Services and Premier Field Engineering team.
A N I NTRODUCTION TO S ERVICE B ROKER. C OACHING Y OUR W AY T HROUGH ~ Wolf ~
A N I NTRODUCTION TO S ERVICE B ROKER. C OACHING Y OUR W AY T HROUGH ~ Wolf ~
Others Talk, We Listen. Managing Database Projects in Visual Studio 2013.
Welcome POS Synchronize Concept 08 Sept 2015.
Securing SQL Server Processes with Certificates
Monitoring Data Changes with Change Data Capture
Outsourcing Database Administration
Glasgow, SQL Server Meetup
Power BI after more than 1 year in production
Interview Tips Chris Shaw
DBA and IT Professional for ~9 years. Currently I am a Data Architect
Service Broker - Put Me In Coach
Solving the Hard Problems
Transactional replication
Meeting Facilitation: Turn Hate to Love
Electronic Communication
Electronic Communication
Reading Execution Plans Successfully
SQL Server Security Mistakes Everyone Makes
Exploring Your SQL Server Databases with T-SQL
DevOps Database Administration
Auditing in SQL Server 2008 DBA-364-M
Transactional Replication A Deeper Dive Drew Furgiuele, Senior DBA IGS
How to Lose Your Job in 3 Easy Steps
Please support our sponsors
LinkedIn Training.
DevOps Database Administration
5 WAYS TO BYPASS *OR ENSURE* SQL SERVER SECURITY MATT MARTIN
Making PowerShell Useful
Making Your Emergency Toolkit
What’s new in SQL Server 2016 Availability Groups
How to run an efficient, effective, and inclusive process
Making Sense of Service Broker
Electronic Communication
Stop Wasting Time & Resources: Performance Tune Your Jobs
Statistics: What are they and How do I use them
Securing SQL Server Processes with Certificates
The Mac DBA, using Docker and SQL Operations Studio
Hidden Power : Service Broker
SQL Server Performance Tuning Nowadays
Introduction to Object-Relational Mapping for DBAs
Microsoft Azure for SQL Server Professionals
DBA for ~4+years, IT Professional for 7.5 years.
Making PowerShell Useful
CUSTOMER SERVICE.
Outsourcing Database Administration
Please support our sponsors
Parameter Sniffing: the Good, the Bad, and the Ugly
Your code is not just…your code
Parameter Sniffing: the Good,the Bad, and the Ugly
Parameter Sniffing: the Good, the Bad, and the Ugly
Summit Nashville /3/2019 1:48 AM
Sioux Falls, SD | Hosted by (605) SQL
Governing Your Enterprise with Policy-Based Management
Electronic Communication
Summit Nashville /26/2019 4:32 AM
Using wait stats to determine why my server is slow
Do-It-Yourself Performance Monitoring
XML? What’s this doing in my database? Adam Koehler
Your code is not just…your code
Presentation transcript:

Troubleshooting Service Broker Brian Gale Troubleshooting Service Broker

Troubleshooting Service Broker Brian Gale Troubleshooting Service Broker

SQL Summit Annual International Conference November 6 -9 | Seattle, WA 2 Days of Pre-Cons 200+ sessions over 3 days Over 5,000 SQL Professionals Evening Networking Activities

Please Support Our Sponsors

Let’s Not Distract Others Please silent your phone We can chat later Please don’t snore

WHO AM I Brian Gale DBA for the past 7 years at Vecima Networks Inc First time SQL Saturday presenter and 3rd time doing a SQL presentation Contact info: Twitter - @gh0ce Linkedin – https://www.linkedin.com/in/brianga

WHAT IS SERVICE BROKER? Microsoft definition – SQL Server Service Broker provides native support for messaging and queuing applications in the SQL Server Database Engine. This makes it easier for developers to create sophisticated applications that use the Database Engine components to communicate between databases. Developers can use Service Broker to easily build distributed and reliable applications.

WHAT IS SERVICE BROKER? Service Broker allows: - Asynchronous queries - Cross database communication - Cross instance communication - Cross server communication - Ordered delivery of messages - Ensured delivery of messages

DEFINITIONS Message – a piece of data you want to move across databases Message Type – definition of what a message may look like Contract – controls who can send each message type Queue – a place to store messages Endpoint – a listener for conversations Route – define the path to the remote SQL instance Service – binds a contract to a queue Conversation – what ties all of the above together

DEFINITIONS - ANALOGY Message – the information you want to get across Message Type – conversation topic Contract – set of rules for what each participant is allowed to talk about Queue – your minds Endpoint – your telephone Route – phone number Service – keeps you on topic Conversation – the talking

DEMO 1 Set up service broker, explain the setup steps, show that it works

WHERE WOULD YOU USE THIS? In-house CDC like system ETL system that needs some near real-time data Offsite data duplication

WHERE THINGS CAN GO WRONG Can’t decrypt certificates Endpoint not listening Route pointing to wrong endpoint Queue disabled Poisoned messaging

DEMO 2 Bad certificate due to database restore

CAN’T DECRYPT CERTIFICATE Happens when you restore from LIVE to TEST How to resolve: Regenerate the master key Alternate method: 1 – drop all certificates 2 – drop master key 3 – create master key 4 – re-create all certificates

WHERE THINGS CAN GO WRONG Can’t decrypt certificates Endpoint not listening Route pointing to wrong endpoint Queue disabled Poisoned messaging

POISON MESSAGE Definition – a message that cannot be processed Causes: message contains data that cannot be processed deadlock Resolution: get the bad message and discard it fix the data so the message can be processed Deadlock is rarely the cause of poison message unless you have retry set to 1

DEMO 3 Queue disabled and poison messaging

DISABLED QUEUE Cause: poison message intentionally disabled Fix: fix poison message and turn queue back on turn queue back on if appropriate

DATABASE OWNERSHIP Rarely happen Difficult to troubleshoot using profiler Fix – Change the database owner

EASY WAY The easy way to check things is: SQL Server Event Log DMV’s This is also a “Demo” slide

DMV DMV’s: sys.transmission_queue – holds potential errors sys.conversation_endpoints – status of conversations sys.dm_broker_connections – information about network connections

WHICH METHOD TO USE SQL LOG METHOD: - use this if production systems are down and downtime is expensive - if you don’t care about what is happening in the background - you are pretty sure you know what is wrong but want to verify PROFILER METHOD: - if you want to see what is actually going on - Log didn’t give you accurate or enough information - presentations

MY CHECKLIST Depends on the issue, but normally a process similar to: SQL Event Log on all affected servers sys.transmission_queue on all affected servers sys.conversation_endpoints on all affected servers sys.dm_broker_connections on all affected servers profiler Other times I may do that in reverse order.

Q&A

USEFUL LINKS Troubleshoot Service Broker Problems: http://www.sqlteam.com/article/how-to-troubleshoot-service-broker-problems Service Broker Troubleshooting: https://www.mssqltips.com/sqlservertip/1197/service-broker-troubleshooting/ Troubleshooting Service Broker (script): http://www.sqlservercentral.com/scripts/Maintenance+and+Management/31867/ My blog: https://sqlserverinablog.wordpress.com/