Translate a UNIX User ID to a Real Name

This short script is helpful when you're looking at the OnLine logfile trying to find out why something strange has happened. In the logfile, OnLine will tell you that a certain PID (process identifier) owned by a certain user has caused a problem. For example, the following two lines appeared in a logfile just before the database aborted and crashed:

11:42:24 Process Aborted Abnormally: pid=26630 user=129 us=e0002bf0 flags=l
11:42:24 Process Aborted Abnormally (latch): pid=26630 user=129 flags=l

Here, a backend, process ID #26630, was killed by user #129 at 11:42 while holding a latch, causing the system to abort. To find the name of user 129, run the following script, called username:

 INFORMIX 73> ...

Get Informix DBA Survival Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.