Reputation: 584
I use hibernate and my database may be quite different, MySQL, MSSQL, Oracle. I need to monitor database load and/or performance to get the state of database in real time. Availability of the database is quite easy to check, but I doubt it is really useful if you want to know how loaded the database in the current moment.
Is there a way to do it? May be there are some useful alternatives?
Upvotes: 1
Views: 339
Reputation: 4657
All the databases you mentioned provide some kind of statistics and performance counters via SQL interface. Under the hood, however, they are completely different and use different, proprietary concepts. Each database provides different performance counters and also a different way of reading them. Without knowing the internals those numbers will look completely meaningless to you. To understand them you have to understand how that particular database works, and this can mean many years of study for each database separately. It's called a "DBA career". None of those databases has a concept of "how loaded" it is, and you will have to make that conclusion based on tens (possibly hundreds) of counters that you see as relevant in your case. Still, regardless of how you try and which counters you use for your calculation of "loadedness", a value of 10 for MSSQL will never be same as value of 10 for Oracle. To make things even worse, database internals (and thus also performance counters) change drastically between versions.
Bottom line: there is no common denominator, and there can never be. Trying to compare them is like comparing apples and oranges.
That said, each of them has its own tools for monitoring and optimization.
Upvotes: 2