Wednesday, July 16, 2008

Displaying cpu usage separately for each processor ....

Didn't know this until someone asked me how to display the cpu usage for each CPU. Found 'mpstat':

mpstat -P ALL
Linux 2.6.18-92.1.6.el5xen (foo.domain.com) 07/16/2008

04:28:28 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
04:28:28 PM all 0.02 0.00 0.01 0.01 0.00 0.00 0.00 99.95 135.16
04:28:28 PM 0 0.03 0.00 0.02 0.04 0.00 0.00 0.00 99.91 44.19
04:28:28 PM 1 0.01 0.00 0.01 0.00 0.00 0.00 0.00 99.97 29.24
04:28:28 PM 2 0.01 0.00 0.01 0.00 0.00 0.00 0.00 99.97 29.23
04:28:28 PM 3 0.01 0.00 0.01 0.00 0.00 0.00 0.00 99.97 32.50

Nice.

Wednesday, July 02, 2008

ICQ blocking unofficial clients (what is ICQ?) ...

Thought it was humorous to hear that ICQ was blocking unofficial clients. It's been awhile since I used ICQ and didn't think anyone used it anymore. But even funnier: there are official ICQ clients??

Figuring out which column nulls are being inserted into ....

Actually see this kind of error a lot at work:

DB2 SQL error: SQLCODE: -407, SQLSTATE: 23502, SQLERRMC: TBSPACEID=2, TABLEID=1301, COLNO=0

If you see this error, you can just run the following sql to find out which table and column the null was being inserted into:

SELECT C.TABSCHEMA, C.TABNAME,
C.COLNAME
FROM SYSCAT.TABLES AS T,
SYSCAT.COLUMNS AS C
WHERE T.TBSPACEID = n1
AND T.TABLEID = n2
AND C.COLNO = n3
AND C.TABSCHEMA = T.TABSCHEMA
AND C.TABNAME = T.TABNAME

where the values from the error are replaced for n1, n2 and n3. This is actually from the DB2 V9.5 docs.