Edit D:\app\Administrator\product\11.2.0\dbhome_1\sysman\admin\scripts\db\sgapid.pl
1; sub trim { my $string = shift(@_); $string =~ s/\s//g; return $string; } sub TRACE { if ($debug) { open(LOG, ">>$tracefile"); print LOG localtime(time). " - "; print LOG @_; print LOG "\n"; close(LOG); } } sub getsgapid { my $emdhome = $_[0]; my $conn = $_[1]; TRACE("emdhome = ".$emdhome); TRACE("conn = ".$conn); $pidvalcmddir = $emdhome."/bin"; chdir($pidvalcmddir) || die "Cannot chdir $pidvalcmddir: $!"; if($NT) { open(BUFP, "nmcbufp ".$conn."|"); $pidval = <BUFP>; close(BUFP); } else { open(BUFP, "./nmcbufp \'".$conn."\'|"); $pidval = <BUFP>; close(BUFP); } TRACE("nmcbufp result : $pidval"); $rpdival = ""; if(!($pidval =~ m/ERROR/)) { $pidval = substr($pidval, 4); if($NT) { $nmupmLine = `$emdhome/bin/nmupm procinfo $pidval`; if ($nmupmLine =~ m/em_result/) { $rpidval = $pidval; } } else { open(PS_F, "ps -ef| egrep -i nmccollector|"); while (<PS_F>) { chomp; ($uid,$pid,$ppid,$restOfLine) = split; $pidline1 = trim($pid); $pidline2 = trim($pidval); if ($pidline1 eq $pidline2) { $rpidval = $pidval; break; } } close(PS_F); } } TRACE("final result : $rpidval"); return $rpidval; }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de