Code signing for mere mortals

Well, turns out code signing is pretty complex, so I'm writing this blog post as a guide for my future self. I hope he will appreciate, and perhaps some of you may find it useful as well. The need for code signing There is a lot of malware out there, we all know it, so you'd better be careful with what you download and install on your computer. Browsers try to help with that and will warn you when you download a suspicious piece of software: [Read More]

Recipe 10: Writing Events to InfluxDB

Welcome to the last recipe of this Extended Events cookbook! You will find the first blog post of the series here and you can browse all recipes with the xesmarttarget tag on this blog. The problem The TIG software stack (Telegraf, InfluxDB, Grafana) is a very powerful combination of software tools that can help you collect, store and analyze data that has a time attribute. In particular, InfluxDB is a time series database, built with sharding, partitioning and retention policies in mind. [Read More]

Recipe 9: Capturing Queries and Plans

Welcome to a new recipe of this Extended Events cookbook! You will find the first blog post of the series here and you can browse all recipes with the xesmarttarget tag on this blog. The problem In the previous recipe we used XESmartTarget to analyze a workload and we could characterize it by application/login/database. Now let’s take one more step: let’s capture all the queries and their plans and add query_hash and query_plan_hash to the analysis table. [Read More]

Recipe 8: Analyzing a Workload

Welcome to a new recipe of this Extended Events cookbook! You will find the first blog post of the series here and you can browse all recipes with the xesmarttarget tag on this blog. The problem The idea comes from a blog post by Brent Ozar about "How to Find Out Whose Queries are Using The Most CPU". Brent uses the Resource Governor to detect who's using the CPU. That's an interesting approach, but you can do the same more efficiently with XESmartTarget. [Read More]

Recipe 7: Finding Unused Tables

Welcome toa new recipe of this Extended Events cookbook! You will find the first blog post of the series here and you can browse all recipes with the xesmarttarget tag on this blog. The problem The previous recipe showed you how to capture data from Extended Events sessions, summarize it in memory and then save it to a table in SQL Server, merging with any existing rows. This comes extremely handy when the events are not useful individually, but when the story is told by the aggregation of all the events. [Read More]

Recipe 6: Auditing Successful Logins

Welcome to a new recipe of this Extended Events cookbook! You will find the first blog post of the series here and you can browse all recipes with the xesmarttarget tag on this blog. The problem Sometimes you are not interested in the individual events captured by a session, but you want to extract some information from a series of events, by grouping and aggregating them. This is the case of events that happen very often, like, logon events, that can help you validate your story. [Read More]

Recipe 5: Killing blocking SPIDs

Welcome to the latest recipe of this Extended Events cookbook! You will find the first blog post of the series here and you can browse all recipes with the xesmarttarget tag on this blog. The problem In the previous recipe, you learned how to notify when specific events occur, using the EmailResponse. Notifications are appropriate when user intervention is required, but when the system can resolve the issue automatically it's better to avoid notifying users of the issue altogether. [Read More]

Recipe 4: Sending Alerts via Email

Welcome to the latest recipe of this Extended Events cookbook! You will find the first blog post of the series here and you can browse all recipes with the xesmarttarget tag on this blog. The problem In the previous recipe, you learned how to combine multiple Responses together and how to control their output, using filters and Expression Columns. Armed with this knowledge, you can now tackle the most complex problems, using all the available Response types. [Read More]

Recipe 3: Merging and manipulating events

Welcome to the third recipe of this Extended Events cookbook! You will find the first blog post of the series here and you can browse all recipes with the xesmarttarget tag on this blog. The problem In the previous recipe, we wrote event data to a table in the database and each event used field and action names to map to the column names in the table. The same information (the text of the command) was stored in two separate columns, depending on the event type: [Read More]

Recipe 2: Writing Extended Events to a table

Welcome to the second recipe of this Extended Events cookbook! You will find the first blog post of the series here and you can browse all recipes with the xesmarttarget tag on this blog. The problem This time, you want capture all the queries executing on your server and save the Extended Events data to a table in SQL Server. One of the things you cannot achieve easily with the standard targets in Extended Events is writing to a database table. [Read More]