/bin
# chmod u+x kfed.sh
# kfed.sh
- This will generate kfed output files in /tmp.
. /tmp/kfed_DH.out, /tmp/kfed_FS.out, /tmp/kfed_BK.out, /tmp/kfed_FD.out and /tmp/kfed_DD.out
Configuring the Script
Perl interpreter should be installed on the server - perl executable comes with Unix or Linux as default.
$ which perl
/usr/bin/perl
If perl executable is not found /usr/bin directory, the one in $ORACLE_HOME/perl/bin can be used.
$ export PATH=$ORACLE_HOME/perl/bin:$PATH
Running the Script
Save the perl script. at end of this note as "kfed.pl" and change the permission for execution.
# chmod u+x kfed.pl
# kfed.pl kfed_DH.out | sort -t ' ' -k 2.3 > kfed.out
Caution
This script. is provided for
educational purposes only and not supported by Oracle Support Services. It has been
tested internally, however, and works as documented. We do not guarantee that it
will work for you, so be sure to test it in your environment before relying on it.
Proofread this script. before using it! Due to the differences in the way
text editors, e-mail packages and operating systems handle text formatting
(spaces, tabs and carriage returns), this script. may not be in an
executable state when you first receive it. Check over the script. to
ensure that errors of this type are corrected.
Script
#!/usr/bin/perl
# kfed.pl
# Input kfed_DH.out or kfed_BK.out
# Usage : kfed.pl kfed_DH.out | sort -t ' ' -k 2.3
use warnings;
use strict;
#Device Name String
my $deviceM = "^\/dev\/";
#my $deviceM = "^asm";
#my $deviceM = "^\/u02";
my $device ="NOASMDEVICE" ;
my $dskname ;
my $dsknum ;
my $grpname ;
my $fgname ;
my $hdrsts;
my $grptyp;
my $f1b1locn;
my $asmlabel;
my $dsksize;
my $vf=0;
my ($crestmphi, $crestmplo, $c_secs, $c_mins, $c_hour, $c_days, $c_mnth, $c_year ) ;
my ($secs, $mins, $hour, $days, $mnth, $year );
my @fields ;
my @temp;
my @temp1;
my $num_args;
$num_args = $#ARGV + 1;
die "Usage: kfed.pl kfed_DH.out | sort -t ' ' -k 2.3 | more " if ($num_args != 1);
#Print Header
printf "%-30s %-15s %-8s %-15s %-15s %-15s %-10s %-8s %-2s %-14s\n" ,
"1.Device" ,"2.GroupName", "3.DN#(Size)", "4.DiskName", "5.ASMLabel", "6.FailGroup" ,
"7.H_Staus" , "8.Rdancy", "F1(V)" , "Creation Time" ;
while (<>) {
# To remove \r\n from dos format
s/^\s+//; s/\s+$// ;
if ( $_ =~ /$deviceM/ ) {
if ( $device =~ /NOASMDEVICE/ ) {
$device = $_ ;
next;
}
elsif ( $device && $grpname )
{
printf "%-30s %-15s %04d(%s) %-15s %-15s %-15s %-10s %-8s %-2s(%3s) %s%s \n" ,
$device, $grpname, $dsknum, $dsksize, $dskname, $asmlabel, $fgname ,
$hdrsts , $grptyp, $f1b1locn,$vf, $crestmphi, $crestmplo ;
$device = $_ ;
$grpname="";
next ;
} else {
printf "%-30s %-15s \n" , $device , "ZZZ - NO ASM DEVICE" ;
$device = $_ ;
next;
}
}
if ( $_ =~ /dskname/) {
@fields = split /\s+/, $_ ;
$dskname = $fields[1];
}
elsif ( $_ =~ /dsknum/ ) {
@fields = split /\s+/, $_ ;
$dsknum = $fields[1];
}
elsif ( $_ =~ /grpname/ ) {
@fields = split /\s+/, $_ ;
$grpname = $fields[1];
}
elsif ( $_ =~ /fgname/ ) {
@fields = split /\s+/, $_ ;
$fgname = $fields[1];
}
elsif ( $_ =~ /f1b1locn/ ) {
@fields = split /\s+/, $_ ;
$f1b1locn = $fields[1];
}
elsif ( $_ =~ /dsksize/ ) {
@fields = split /\s+/, $_ ;
$dsksize = $fields[1];
}
elsif ( $_ =~ /vfstart/ ) {
@fields = split /\s+/, $_ ;
$vf = $fields[1];
}
elsif ( $_ =~ /provstr/ ) {
@fields = split /:/, $_ ;
@temp = split /;/, $fields[1];
$asmlabel = $temp[0];
$asmlabel =~ s/^\s+//; $asmlabel =~ s/\s+$// ;
if ( $asmlabel eq "ORCLDISK" ) { $asmlabel = "N/A" }
else { $asmlabel =~ s/ORCLDISK//; };
}
elsif ( $_ =~ /hdrsts/ ) {
@fields = split /\s+/, $_ ;
@temp = split /_/, $fields[4];
$hdrsts = $temp[1];
}
elsif ( $_ =~ /grptyp/ ) {
@fields = split /\s+/, $_ ;
@temp = split /_/, $fields[4];
$grptyp = $temp[1];
}
elsif ( $_ =~ /crestmp.hi/ ) {
@fields = split /:/, $_ ;
@temp = split /\s+/, $fields[2];
@temp1 = split /=/, $temp[1]; $hour = $temp1[1];
@temp1 = split /=/, $temp[2]; $days = $temp1[1];
@temp1 = split /=/, $temp[3]; $mnth = $temp1[1];
@temp1 = split /=/, $temp[4]; $year = $temp1[1];
#$year = 0x7db ;
$c_year = sprintf( "%d", hex($year) );
$c_mnth = sprintf( "%02d", hex($mnth) );
$c_days = sprintf( "%02d", hex($days) );
$c_hour = sprintf( "%02d", hex($hour) );
$crestmphi = sprintf ( "%s/%s/%s %s", $c_year, $c_mnth, $c_days, $c_hour );
}
elsif ( $_ =~ /crestmp.lo/ ) {
@fields = split /:/, $_ ;
@temp = split /\s+/, $fields[2];
@temp1 = split /=/, $temp[3]; $secs = $temp1[1];
@temp1 = split /=/, $temp[4]; $mins = $temp1[1];
#$year = 0x7db ;
$c_mins = sprintf( "%02d", hex($mins) );
$c_secs = sprintf( "%02d", hex($secs) );
$crestmplo = sprintf ( ":%s:%s", $c_mins, $c_secs);
}
}
if ( $device && $grpname )
{
printf "%-30s %-15s %04d(%s) %-15s %-15s %-15s %-10s %-8s %-2s(%3s) %s%s \n" ,
$device, $grpname, $dsknum, $dsksize, $dskname, $asmlabel, $fgname ,
$hdrsts , $grptyp, $f1b1locn,$vf, $crestmphi, $crestmplo ;
}
Script. Output
$ kfed.pl /tmp/kfed_DH.out | sort - t ' ' -k 2.3 > /tmp/kfed.out
-
Check kfed.out if there is any missing disks from the diskgroup in
question and work with System administrator team to find them.
- Check kfed.out if there is any duplicated disks in terms of disk number from the diskgroup in question, see note - 1299866.1.
- Or upload /tmp/kfed.out for Oracle support's review.
1.Device 2.GroupName
3.DN#(Size) 4.DiskName 5.ASMLabel 6.FailGroup 7.H_Staus
8.Rdancy F1(V) Creation Time
/u02/oradata/asm_disk10 DATA
0000(647) DATA_0000 N/A F2
FORMER NORMAL 0 ( 0) 2012/03/01 15:21:18
/u02/oradata/asm_disk11
DATA 0001(2000) DATA_0001 N/A F1
MEMBER NORMAL 731( 0) 2011/06/14 20:48:55
/u02/oradata/asm_disk12
DATA 0002(2000) DATA_0002 N/A F1
MEMBER NORMAL 0 ( 0) 2011/06/14 20:48:55
/u02/oradata/asm_disk13
DATA 0003(2000) DATA_0003 N/A F1
MEMBER NORMAL 0 ( 0) 2011/06/14 20:48:55
/u02/oradata/asm_disk14
DATA 0004(2000) DATA_0004 N/A F1
MEMBER NORMAL 0 ( 0) 2011/06/14 20:48:55
/u02/oradata/asm_disk18
DATA 0005(718) DATA_0005 N/A F2
FORMER NORMAL 0 ( 0) 2012/03/01 15:21:18
/u02/oradata/asm_disk35
DATA 0006(2000) DATA_0006 N/A F2
MEMBER NORMAL 0 ( 0) 2012/03/01 15:36:36
/u02/oradata/asm_disk36
DATA 0007(2000) DATA_0007 N/A F2
MEMBER NORMAL 0 ( 0) 2012/03/01 15:36:36
/u02/oradata/asm_disk29
DATA 0010(2000) DATA_0010 N/A F1
MEMBER NORMAL 0 ( 0) 2012/02/08 21:30:20
/u02/oradata/createAsmDisk1.sh ZZZ - NO ASM DEVICE
/u02/oradata/asm_test ZZZ - NO ASM DEVICE
/u02/oradata/afiedt.buf ZZZ - NO ASM DEVICE
/u02/oradata/tmp-OCR_NEW.ocr ZZZ - NO ASM DEVICE
/u02/oradata/createAsmDisk.sh ZZZ - NO ASM DEVICE
References
NOTE:1299866.1 - V$ASM_DISK view shows some disk header status as IGNORED and group number as "0".
NOTE:946213.1
- How To Add Back An ASM Disk or Failgroup (Normal or High Redundancy)
After A Transient Failure Occurred (On Release 10.2. or 10.1)?