Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Sar Loader Script?
Thanks! I'm going to check this out.
> #!/usr/local/bin/perl
> # file - sar-d.pl
> $sar_out = "/tmp/sar.out";
> $sar_dat = ">/tmp/sar.dat";
> # a file suitable for SQLLDR is created as /tmp/sar.dat
> system("sar -d > $sar_out");
> open(INP,$sar_out);
> open(OUT,$sar_dat);
> $line_cnt = 1;
> while (<INP>) {
> if ( ($line_cnt > 4) && (length($_) > 1) )
> {
> if ( (substr($_,0,1) ne " ") && (substr($_,0,1) ne "A") )
> {
> $timestamp = substr($_,0,8);
> #print "$timestamp\n";
> $input = $_;
> } else
> {
> $input = $timestamp . substr($_,8);
> }
> print OUT $input;
> }
> $line_cnt++;
> }
> close(INP);
> close(OUT);
> unlink($sar_out);
>
>> --
> --
> Charlie Mengler Maintenance Warehouse
> charliem_at_mwh.com 10641 Scripps Summit Ct
> 858-831-2229 San Diego, CA 92131
> HOME DEPOT - The Big Boy's Toy store!!!!!!!!!!!!!!!!!
>> To REMOVE yourself from this mailing list, send an E-Mail message
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Walter K INET: alden14004_at_yahoo.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Mon Feb 05 2001 - 15:31:32 CST