|
Blogs
MaxDB - Space odditiesRecently a customer came up with the assumption that there is space somehow missing from the database. As some of you may know, DBM GUI simply runs dbm- and SQL-commands in the background to gather the information. Getting the dataTo gather the filling level of the database the command in charge is "info_state".
If we investigate a bit deeper, we'll find that this command actually is a predefined SQL command that queries a view called "SYSDBM"."INFO_STATE" which is defined in the DBMVIEWS.py file as:
Easy to see: the storage related data are taken out of "SYSDD"."DATASTATISTICS". So let's check the "DATASTATISTICS" on my testsystem:
So far nothing impressing - there are about 452 MB used up in the data area. Check the freespace accountingNow the customer had his doubts and wanted to check against this value.
Comparing the two results shows quite some differences:
So where are the 4,13 MB in my system? In the case of the customer the difference was in the range of several hundred MB. Where is my freespace?The answer is simple but a bit surprising.
Here's why: Basically the value is internally created like this:
Getting the data the right waySo with the initial statement to check the used size we actually counted the LONG/LOB files twice.
As we see, much less deviation from the "DATASTATISTICS" now. But still, there is half a MB off for which we can assume that these belong to the CONVERTER.
With these information we can be pretty sure that there is no "deadwood" in this database. 'Deadwood' issues in MaxDB ?Should the deviation between the values from "DATASTATISTICS" and "FILES" be much larger, say several 100 MB as it looked initially like for the customer, then it may be time to run a CHECK DATA WITH UPDATE. This will rebuild the converter and the freeblock management and release pages that had been left over by the garbage collector. You may find messages like this one in the KNLDIAG after the CHECK DATA WITH UPDATE run:
Of course you may now ask: "Why does the garbage collector forget about those pages?". The garbage collector is a forgetful bastard...The reasons for that can be various. One of them is that currently, the garbage collector is not able to resume the cleanup of a file when it has been interrupted, say by a restart of the database. This is of obviously not so nice and I'm sure that this will be changed in the future, but usually it's not such a big issue, as the database instance are not restarted every now and then. I hope you liked this rather long and technical blog. Best regards, Lars Breddemann
| ||||||||||||||||||||||||||||||||