Page 1 of 1
Administering Locks - INODE question
Posted: Wed Oct 05, 2005 7:33 am
by ArndW
I know there must be a better solution, but I can't find it. I have a device and an inode (coming from the LIST.READU command) and I want to find the actual file associated with that; the only method I know is to use "find -inum {inode number}" but that actually has to search and can take minutes or longer in a big filesystem.
Does anyone know of a single UNIX command to get the file name & path from an inode number?
Thanks in advance,
Posted: Wed Oct 05, 2005 4:48 pm
by ray.wurlod
There's an even better way.
Run ACCOUNT.FILE.STATS ALL LOCAL in your project. This collects all sorts of file tuning statistics, but also records the device number and inode.
So you can then construct a query such as:
Code: Select all
SELECT DISTINCT FILEINODE FMT '10R', FILENAME FMT '56T' FROM STAT.FILE ORDER BY 1;
and voila! you have your map.
Posted: Thu Oct 06, 2005 12:57 am
by ArndW
Ray - that's an awesome idea, I hadn't thought of that! That will save time on inode searches (since files not in the VOC won't be found it will still have to look). Doing a "find" on this large system takes about 45 minutes; but goes go faster when limited to just one device.
I am writing a program to use LIST.READU and PORT.STATUS to give a more cleartext picture of system status and locks and these busy systems. I wish I hadn't thrown away my code years ago, I wrote something similar for Oxford Health, who had several thousand concurrent users and lots of lock problems.
Posted: Thu Oct 06, 2005 4:45 pm
by ray.wurlod
Well you'd better take on board the INTERNAL keyword for these commands, which captures the output into a dynamic array - no need to parse.
I always SETFILE to my directory-based hashed files, so this (and other things) will work ok. And O/S files don't get locked by and large (except by OpenSeq), so that's probably not an issue.