Troubleshooting – Using relog to append .blg files

Troubleshooting – Using relog to append .blg files

Tempo de leitura: 4 minutos

Hi et all,

It’s me again, today we are going to talk about how to use a relog command line in a professional way. Why am I doing this blog post?  Because I needed to analyze a couple of .blg files to figure out a root cause of a customer issue on my daily basis and received a log of .blgs files from them, however, they sent me them separately and asked by an overall about all days captured.

PS – If you don’t know what blgs are, please, referral to Performance Monitor documentation.

As an Ex LATAM PFE at Microsoft, I really enjoyed the Performance Monitor tool to understand how an environment is a behavior before taking any action. One thing that I like this tool the most is because it is VERY lightweight to the environment and provides me a LOT of insight. If you still don’t know how to use it and what else you could use to troubleshooting your SQL Server environment or if you want to be recognized and become a master upon it, I created a Portuguese course called Expert Database From Zero To Hero.

Getting back to our problem, think we are working on a customer issue and he sends to you some .blg files to start your analysis, and then, after a while, he sends the “rest” of their gathered data to be appended into your initial logs.

Imagine you have these files have sent initially (first part of logs)

How could we merge all files into a single .blg file? Pretty use using relog you can do this in a very straightforward way like this:

syntax: 

What is this approach to a problem? In a scenario where there are a lot and a massive number of files, it certainly will take long to end up and in the end, you really won’t look at ALL performance counters in analysis or use them to create a report in excel, for instance. In addition, you still must marry this file up with the upcoming one that might mess up!

Before proceeding let’s look at our second part of .blg files sent out by this customer

What am I supposed to do to have this problem sorted out?

First I pull them out from their original folder onto a folder name “ALLBLGs” just to make easy to work with them and run this command to generate a .txt file with all counters in a .txt format

syntax: 

PS – I just needed to a single file, because this one has all counters.

Once the command above it’s done, go to the .txt file and leave within it the only counters that you really desire to work with. In my case, I left the buffer manager counters.

Save this file to be used as a kind of “template” of what counters you WANT TO USE.  In order to generate a single filtered out .blg file based on this template, use this command below:

syntax:

PS – I just used few files to do a demo, but look at we have only the counters specified in our .txt file within ALL.blg file.

If you want to transform this .blg file into a .csv and create your own reports, I also created a blog post teaching how to do this.

Reference:

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/relog

Happy troubleshooting – TC

Deixe uma resposta

%d blogueiros gostam disto: