oraracdba
Technical User
- Apr 8, 2009
- 2
All, While I have been tinkering my awk skills are not that great.
I have a file that has TOP information and I need to do some merging of lines and get a fixed header among other things.
The first thing I want to do is concatenate the TOP line with the UARG line. There is always a TOP but not always a UARG
The other is I want to map the T001,T002,… to a time. As defined in the file.
Any help would be greatly appreciated.
ZZZZ,T0002,09:05:29,07-APR-2009
UARG,+Time,PID,PPID,COMM,THCOUNT,USER,GROUP,FullCommand – would like to be fixed as a header but appended to the line below.
TOP,+PID,Time,%CPU,%Usr,%Sys,Threads,Size,ResText,ResData,CharIO,%RAM,Paging,Command,WLMclass – would to be fixed as the header
TOP,0229502,T0002,7.69,6.73,0.96,14,81860,0,81760,1128698,1.023,176,emagent,Unclassified
UARG,T0002,0229502, 708708,emagent , 14 , oracle,oinstall,/opt/app/oracle/product/10.2.0/em/agent10g/bin/emagent
TOP,0262272,T0002,2.62,1.26,1.37,1,107868,128672,20604,7,1.867,1,oracle,Unclassified
UARG,T0002,0262272, 1,oracle , 1 , oracle,oinstall,ora_lmd0_CCBFS8
TOP,0077990,T0002,2.49,1.55,0.94,1,106008,36976,18804,0,0.698,1,oracle,Unclassified
UARG,T0002,0077990, 1,oracle , 1 , oracle,oinstall,asm_lms0_+ASM8
TOP,0323626,T0002,1.75,1.28,0.46,51,116756,11632,102804,58851,1.431,89,crsd.bin,Unclassified
UARG,T0002,0323626, 651654,crsd.bin, 51 , root, system,/opt/crs/oracle/product/crs/bin/crsd.bin reboot
TOP,0897102,T0002,0.93,0.61,0.32,24,38148,376,37712,22106,0.476,2,ocssd.bin,Unclassified
UARG,T0002,0897102, 434470,ocssd.bin, 24 , oracle,oinstall,/opt/crs/oracle/product/crs/bin/ocssd.bin
TOP,0344220,T0002,0.75,0.72,0.03,1,107416,128672,20152,30287,1.861,0,oracle,Unclassified
UARG,T0002,0344220, 1,oracle , 1 , oracle,oinstall,ora_lmon_CCBFS8
TOP,0807292,T0002,0.73,0.52,0.21,1,105272,128672,18008,7,1.835,0,oracle,Unclassified
UARG,T0002,0807292, 1,oracle , 1 , oracle,oinstall,ora_lck0_CCBFS8
TOP,1032540,T0002,0.50,0.39,0.10,1,23664,3544,20036,14326,0.295,193,PatrolAgent,Unclassified
UARG,T0002,1032540, 1,PatrolAgent, 1 , patrol, patrol,PatrolAgent
TOP,0881010,T0002,0.30,0.17,0.13,1,107784,128672,20520,0,1.866,0,oracle,Unclassified
UARG,T0002,0881010, 1,oracle , 1 , oracle,oinstall,ora_lms0_CCBFS8
TOP,0741424,T0002,0.26,0.00,0.26,14,508,4,508,0,0.006,0,syncd,Unclassified
UARG,T0002,0741424, 1,syncd , 14 , root, system,/usr/sbin/syncd 60
TOP,0348312,T0002,0.26,0.12,0.14,1,19608,3408,16192,122,0.245,11,bgsagent,Unclassified
UARG,T0002,0348312, 1,bgsagent, 1 , patrol, patrol,/usr/adm/best1_default/bgs/bin/bgsagent -m MetricTable.mgt -b /usr/adm/best1_default
TOP,0999906,T0002,0.24,0.11,0.13,1,768,228,580,57,0.010,249,sh,Unclassified
UARG,T0002,0999906, 1,sh , 1 , root, system,/bin/sh /etc/init.cssd fatal
I have a file that has TOP information and I need to do some merging of lines and get a fixed header among other things.
The first thing I want to do is concatenate the TOP line with the UARG line. There is always a TOP but not always a UARG
The other is I want to map the T001,T002,… to a time. As defined in the file.
Any help would be greatly appreciated.
ZZZZ,T0002,09:05:29,07-APR-2009
UARG,+Time,PID,PPID,COMM,THCOUNT,USER,GROUP,FullCommand – would like to be fixed as a header but appended to the line below.
TOP,+PID,Time,%CPU,%Usr,%Sys,Threads,Size,ResText,ResData,CharIO,%RAM,Paging,Command,WLMclass – would to be fixed as the header
TOP,0229502,T0002,7.69,6.73,0.96,14,81860,0,81760,1128698,1.023,176,emagent,Unclassified
UARG,T0002,0229502, 708708,emagent , 14 , oracle,oinstall,/opt/app/oracle/product/10.2.0/em/agent10g/bin/emagent
TOP,0262272,T0002,2.62,1.26,1.37,1,107868,128672,20604,7,1.867,1,oracle,Unclassified
UARG,T0002,0262272, 1,oracle , 1 , oracle,oinstall,ora_lmd0_CCBFS8
TOP,0077990,T0002,2.49,1.55,0.94,1,106008,36976,18804,0,0.698,1,oracle,Unclassified
UARG,T0002,0077990, 1,oracle , 1 , oracle,oinstall,asm_lms0_+ASM8
TOP,0323626,T0002,1.75,1.28,0.46,51,116756,11632,102804,58851,1.431,89,crsd.bin,Unclassified
UARG,T0002,0323626, 651654,crsd.bin, 51 , root, system,/opt/crs/oracle/product/crs/bin/crsd.bin reboot
TOP,0897102,T0002,0.93,0.61,0.32,24,38148,376,37712,22106,0.476,2,ocssd.bin,Unclassified
UARG,T0002,0897102, 434470,ocssd.bin, 24 , oracle,oinstall,/opt/crs/oracle/product/crs/bin/ocssd.bin
TOP,0344220,T0002,0.75,0.72,0.03,1,107416,128672,20152,30287,1.861,0,oracle,Unclassified
UARG,T0002,0344220, 1,oracle , 1 , oracle,oinstall,ora_lmon_CCBFS8
TOP,0807292,T0002,0.73,0.52,0.21,1,105272,128672,18008,7,1.835,0,oracle,Unclassified
UARG,T0002,0807292, 1,oracle , 1 , oracle,oinstall,ora_lck0_CCBFS8
TOP,1032540,T0002,0.50,0.39,0.10,1,23664,3544,20036,14326,0.295,193,PatrolAgent,Unclassified
UARG,T0002,1032540, 1,PatrolAgent, 1 , patrol, patrol,PatrolAgent
TOP,0881010,T0002,0.30,0.17,0.13,1,107784,128672,20520,0,1.866,0,oracle,Unclassified
UARG,T0002,0881010, 1,oracle , 1 , oracle,oinstall,ora_lms0_CCBFS8
TOP,0741424,T0002,0.26,0.00,0.26,14,508,4,508,0,0.006,0,syncd,Unclassified
UARG,T0002,0741424, 1,syncd , 14 , root, system,/usr/sbin/syncd 60
TOP,0348312,T0002,0.26,0.12,0.14,1,19608,3408,16192,122,0.245,11,bgsagent,Unclassified
UARG,T0002,0348312, 1,bgsagent, 1 , patrol, patrol,/usr/adm/best1_default/bgs/bin/bgsagent -m MetricTable.mgt -b /usr/adm/best1_default
TOP,0999906,T0002,0.24,0.11,0.13,1,768,228,580,57,0.010,249,sh,Unclassified
UARG,T0002,0999906, 1,sh , 1 , root, system,/bin/sh /etc/init.cssd fatal