Wednesday, December 19, 2012

ps & event monitor

AIX Command 

  • >ps -ef 
                -e all process except kernal process                 
                -f  full list
    >grep (Global Regular Express Print)
    > egrep
    >fgrep
   >sort
    >head -5 file =  head -n 5 file
    > tail -n 10 file , tail -n +10 file | pg


DB2 Event Monitor

__ 1. Set event monitors

~db2inst1/sqllib/db2profile
echo "set event monitors for ls db"
db2 connect to mydb user mydb_usr using password
echo "make sure cleaned up"
db2 drop event monitor x1mon

db2 update monitor switches using bufferpool on lock on uow on sort on table on statement on timestamp on
db2 reset monitor all
db2 "create event monitor x1mon for statements, deadlocks, database, tables, connections, \\
    transactions write to file '/tmp/x1mon'"
db2 "set event monitor x1mon state 1"

Note: make sure permissions of the /tmp/x1mon dir is accessible by db2 owner

__ 2. Run your app, say, for 10 minutes (so long it is enough to execution the code paths you want)
__ 3. Set them OFF

~db2inst1/sqllib/db2profile
echo "generate event monitor data"
db2 set event monitor x1mon state 0
db2evmon -path /tmp/x1mon > /tmp/x1mon.out

echo "drop event monitors for ls db"
db2 drop event monitor x1mon
db2 get snapshot for dbm > /tmp/x1snapshot.txt
db2 get snapshot for all on mydb>> /tmp/x1snapshot.txt
db2 update monitor switches using bufferpool off lock off uow off sort off table off statement off t
imestamp off
db2 terminate

Look into /tmp/x1mon.out for details. 
Monitor SwitchDBM ParameterInformation Provided
BUFFERPOOLDFT_MON_BUFPOOLNumber of reads and writes, time taken
LOCKDFT_MON_LOCKLock wait times, deadlocks
SORTDFT_MON_SORTNumber of heaps used, sort performance
STATEMENTDFT_MON_STMTStart/stop time, statement identification
TABLEDFT_MON_TABLEMeasure of activity (rows read/written)
UOWDFT_MON_UOWStart/end times, completion status
TIMESTAMPDFT_MON_TIMESTAMPTimestamps

Word:
paper plate
forks and spoons
napkins

savory  -- salty  / sweet


No comments:

Post a Comment