# # $Header: EmcaUtil.pm 08-apr-2008.14:09:41 rsamaved Exp $ # # # Copyright (c) 2003, 2008, Oracle. All rights reserved. # # NAME # EmcaUtil.pm - Utility Perl Module for EMCTL # # DESCRIPTION # # NOTES # # MODIFIED (MM/DD/YY) # rsamaved 04/08/08 - # kramarat 04/03/08 - # ssanklec 03/14/08 - Creation sub getSIDDBNameMapping { my $oracleHome = $_[0]; my $oracleSid = $_[1]; chomp($oracleHome); chomp($oracleSid); my $myFile = "$oracleHome/sysman/config/emca.map"; open(FILE, $myFile) or return ; #die "Can not read file($myFile)"; my @linesRead = ; #parse with ":" and get dbunique name, file will have line sid : dbUniquename foreach $_ (@linesRead) { $_ =~ s/ //g; my ($sid,$unique_name) = split(/:/, $_); if ($sid eq $oracleSid) { return $unique_name; } } return; } 1;