JAS-MIN


13.12.2024
by Kamil Stawiarski

Not having Diagnostic Pack sucks. But event if you have it, it is not that obvious that you will be able to visualize properly the data and perform a meaningful analyze. That’s why I have created JAS-MIN!

A little background:

In my work I often have to analyze customer’s databases in order to understand overall database performance condition. Most of my customers don’t have Enterprise Edition and even if they do, it’s really hard to get remote access over VPN to database server or to install any agent or event ask to run a simple script on a database.

Usually customers just send me about 666 STATSPACK or AWR reports to analyze them and create some report about the condition of the database. For years I developed a lot of small shell and Python scripts to analyze those reports. Unfortunately security teams got more suspicious lately and they are even blocking the ability to send me complete STATSPACK or AWR reports.

Because of that I thought about creating a tool that could anonymize those reports by creating a simple JSON file that could contain only statistics like wait event names, instance stats, SQL_IDs and no other data that could potentially lead to any security issues.

I was introducing this tool at SOUC Database Circle 2024 and I remember that I didn’t have a name for the tool, so Patrick Jolliffe asked if I could name it Jasmine, because our friend (Jasmin Fluri – one of the SOUC founders) – was standing with us. I thought: JSON-AWR-Statspack Miner… JAS-MIN! Yes, that works!

So that’s how JAS-MIN was born and introduced – but since then she evolved and can do some awesome stuff.

So here it is: https://github.com/ora600pl/jas-min

How to use it? It’s pretty simple:

Install RUST: https://www.rust-lang.org/tools/install

Download JAS-MIN:

Compile it:

And JAS-MIN is ready to be used!

JAS-MIN can run as a server and provide JSON files to Graphana or some other tool, but to be honest – you don’t need it anymore so don’t get attached to this functionality.

The basic usage is parsing directory full of STATSPACK or AWR reports – by default JAS-MIN recognizes two types of files:

  • *.txt – STATSPACK files
  • *.html – AWR files

You can generate a set of statspack files with gen_statspack_reps.sh script and set of AWR scripts using awr-generator.sql written by @flashdba

Of course you need at least a week of reports to make something useful out of it.

Let’s use jas-min with default parameters (it takes around 21s to parse almost 922M of HTML data – 415 files – on my laptop):

At the beginning of the output report you will notice something like this:

JAS-MIN is developed to analyze performance spikes, but what does it mean? By default she analyzes the factor of DB CPU divided by DB Time and if the result is lower than 0.666, she considers it as a performance spike.

Why? Well, we can say that DB Time in s/s is like the average number of active sessions per second on your database. There are smarter people than me that can explain it and here is one of the presentations that does it well: https://www.slideshare.net/jberesni/db-time-average-active-sessions-and-ash-math-oracle-performance-fundamentals-228654679#2

So JAS-MIN is taking average active sessions (DB Time s/s) and divides it by DB CPU (s/s) to check what is the proportion – the bigger the proportion (smaller ratio), the more sessions should wait on some foreground wait events.

So JAS-MIN in the first section is telling you what are the spikes that she is taking under consideration – from each spike JAS-MIN is interpreting top wait events and top SQLs from SQLs ordered by Elapsed Time to plot them in the chart.

You can adjust the ratio like this:

You could also filter out only DB Times than are larger than X:

The next section is "Correlations"

Be aware that JAS-MIN is using Pearson correlation coefficient between DB Time and wait events, SQLs elapsed time and instance statistics.

Remember that correlation is not causation!

Correlation simple means that two variables are changing in time in the same way. In our performance analysis it just simply tells you, that you have to consider taking a closer look at some wait events or SQLs – it helps you to start your investigation but it won’t give you a straight answer – it would be to easy 😉

Wait event correlation example:

In RED I’m marking correlations that are higher than 0.4. You can see here also statistics about averages and standard deviations.

Next you can see correlation of SQL_IDs with DB Time plus correlation of that SQL ID with particular wait events:

And again you can see some additional statistics about SQLs. For example 12ku2fn8y62z7 is executing on average only 0.98s but it executes 7319.59 times per snap and there was STDDEV = 10846.86 which basically means that this SQL is executing a lot and there was a time when it was executed more times than usual.

The last section is about instance statistics correlation:

When you see something like this, you could expect that there might be some logon storm going on the database.

After displaying a report, JAS-MIN uses Plotly to plot some interactive charts – you can download a sample chart here:

It looks like this:

If someone wants your help with analyzing AWR or STATSPACK reports and they don’t want to send you whole reports, they could use JAS-MIN to produce a JSON file (which is the created by JAS-MIN in the same location as CWD and is named like DIRECTORY_NAME.json)

Than you could use JAS-MIN just to analyze the file itself:

The tool is being developed by Radosław Kut and I right now and we are open to suggestions about some bugs you find or new features 🙂

Together Gianni Ceresa we are working on creating something much more useful that could help you to find some patterns or anomalies and what could help you in finding performance problems much easier.

We won’t fix them for you tho 😉

You can learn more about JAS-MIN in my (or Radosław) next blog posts on many conferences we are going to attend next year 😀

We hope you will find this tools useful as a quick start for performance troubleshooting – especially if you have only STATSPACK.

Cheers! 🍻


Contact us

Database Whisperers sp. z o. o. sp. k.
al. Jerozolimskie 200, 3rd floor, room 342
02-486 Warszawa
NIP: 5272744987
REGON:362524978
+48 508 943 051
+48 661 966 009
info@ora-600.pl

Newsletter Sign up to be updated