- 论坛徽章:
- 145
|
回复 1# heijieweb
$ perl get_crs_stat.pl
ora.DATA.dg
ora.LISTENER.lsnr
$ cat crs_stat
NAME=ora.DATA.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on xdb1
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE
STATE=ONLINE on xdb1
$ cat get_crs_stat.pl
use strict;
use warnings;
my @aCrs;
my $sCnt = -1;
my @aCrs_stat =`cat crs_stat`; # modify by yourself
foreach(@aCrs_stat){
next if(m/^\s+$/);
s/^\s+|\s+$//g;
my($sItem, $sValue) = split "=";
++$sCnt if($sItem eq "NAME");
$aCrs[$sCnt]->{$sItem} = $sValue;
}
print "$aCrs[0]->{'NAME'}\n";
print "$aCrs[1]->{'NAME'}\n";
|
|