Thanks, Daniel....the script is a big help....I had started doing something
similar but using java ....after seeing your script I think it makes more
sense doing it in perl.
Manas.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 12, 2001 7:26 AM
Subject: RE: DB2EUG: Formatting snapshot/event monitor outputs:DB2/AIX
> Manas,
>
> I use a perl script to bring the snapshot-output for tables and
tablespaces
> into a comma delimited format:
>
> db2_all db2 get snapshot for tables on <DB_NAME> |
fmt_table_tablespace >
> file1.del
> db2_all db2 get snapshot for tablespaces on <DB_NAME> |
fmt_table_tablespace >
> file1.del
>
>
> Quick and dirty, but it works.
>
> Hope this help
>
> Daniel
>
> [EMAIL PROTECTED]
>
> -----Original Message-----
> From: manas.dasgupta [mailto:[EMAIL PROTECTED]]
> Sent: Mittwoch, 11. April 2001 21:50
> To: db2eug
> Subject: DB2EUG: Formatting snapshot/event monitor outputs:DB2/AIX
>
>
> I am currently working on setting up a process of extracting performance
> data from DB2/AIX (snapshot and event monitors) and putting them in tables
> so that we have a record of DB2 activity that we can query against.
> I was wondering if anyone had done similar work parsing through
> snapshot/event monitor output and would like to share scripts or have any
> advice or pointers on this topic.
>
> Thanks,
> Manas.
>
>
>
> =====
> To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
> For other info (and scripts), see
http://people.mn.mediaone.net/scottrmcleod
>
>
----------------------------------------------------------------------------
----
> #!/usr/bin/perl
> # table o.k.
> # tablespace o.k.
>
> $cDelimiter = "";
>
> switch: while (<STDIN>) {
> next if /^\s*(#|$)/;
>
#___________________________________________________________________________
__________
> # skip unimportant header , table related
>
#___________________________________________________________________________
__________
>
> next if /^\s*Table Snapshot/;
> next if /^\s*Tablespace Snapshot/;
> next if /Table List/;
> next if /^\s*Number of accessed tables/;
> next if /^\s*Number of accessed tablespaces/;
> next if /SQL1611W/;
> next if /^\s*Last reset timestamp/; # only for tablespace
> next if /db2 get snapshot for/;
>
>
#___________________________________________________________________________
__________
> # header for table and tablespace
>
#___________________________________________________________________________
__________
>
> /First database connect timestamp/ && do { s/.*=\s(.*)\/(.*)\/(.*)
(.*)\s*/$3-$2-$1-$4/; $szPrefix = $_; next switch; };
> /Snapshot timestamp/ && do { s/.*=\s(.*)\/(.*)\/(.*)
(.*)\s*/$3-$2-$1-$4/; $szPrefix = $szPrefix . "," . $_; next switch; };
> /Database name/ && do { s/.*=\s(.*)\s*/$1/;
$szPrefix = $szPrefix . "," . $_; next switch; };
> /Database path/ && do { s/.*=\s(.*)\s*/$1/;
$szPrefix = $szPrefix . "," . $_; next switch; };
> /Input database alias/ && do { s/.*=\s(.*)\s*/$1/;
$szPrefix = $szPrefix . "," . $_; next switch; };
>
>
#___________________________________________________________________________
__________
> # group change tablespace
>
#___________________________________________________________________________
__________
>
> /Tablespace name/ && $cDelimiter !~ /^$/ && do { printf "\n" ; };
> /Tablespace name/ && do {
> $cDelimiter=",";
> printf "%s" , $szPrefix;
> };
>
>
#___________________________________________________________________________
__________
> # group change table
>
#___________________________________________________________________________
__________
>
> /Table Schema/ && $cDelimiter !~ /^$/ && do { printf "\n" ; };
> /Table Schema/ && do {
> $cDelimiter=",";
> printf "%s" , $szPrefix;
> };
>
>
> /Table Name/ && do { tr/,/./ ; };
>
> s/.*?=\s(.*)\s*/$1/;
> printf "%s%s" , $cDelimiter, $_;
>
> }
>
> printf "%s\n",$szOutputBuffer;
>
>
=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod