Somewhere on your IBMi system, there is a 40GB object that nobody has touched in four years, and you are paying to back it up every single night.
You do not know which object it is. Let’s fix that.
SELECT OBJNAME, OBJTYPE, OBJSIZE,
LAST_USED_TIMESTAMP, DAYS_USED_COUNT
FROM TABLE(QSYS2.OBJECT_STATISTICS('YOURLIB', '*ALL'))
ORDER BY OBJSIZE DESC
FETCH FIRST 20 ROWS ONLY;
Point it at your biggest application library, and you get your twenty largest objects, sorted, with two columns most people never look at: LAST_USED_TIMESTAMP and DAYS_USED_COUNT.
Big and busy is fine. That is the system doing its job. What you are hunting for is big and idle. The work file some job created in 2021 and never cleaned up. The history table nobody archived. The save file somebody restored from and left sitting there.
Every one of those is disk you are paying for, save window you are spending, and recovery time you are adding, all for data that does no work.
Run it against your top three libraries this morning. I would bet money you find at least one object that makes you say “what on earth is that” (I had to change what I wanted to say to be able to post this) out loud.
You can loop OBJECT_STATISTICS across every library with ‘*ALL’, but start with the libraries you know are big. The wins are faster, and you will build the habit. The nice thing with *ALL, is you might find something in a library that you never look at.
If you find waste and can delete it, it will reduce the time that your backup takes, and if you ever restore, it will save time on the restore as well. You should definitely do this before every hardware migration to a new machine. You get a double time savings then, once on the save and the second on the restore. Buy me a beer the next time you see me at a conference as a thank you.
What did you find? Post the weirdest one. No object names, just the size and the story.
#IBMi #Power #SystemAdministration
Originally posted on LinkedIn. Join the conversation there.
Leave a Reply