# Apex.pm: Interface to Get APEX Configuration Information package RDA::Extern::Apex; # $Id: Apex.pm,v 2.6 2012/01/02 16:32:38 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/RDA/Extern/Apex.pm,v 2.6 2012/01/02 16:32:38 mschenke Exp $ # # Change History # 20120102 MSC Change the copyright notice. =head1 NAME RDA::Extern::Apex - Interface to Get APEX Configuration Information =head1 SYNOPSIS require RDA::Extern::Apex; =head1 DESCRIPTION The following method is available: =cut use strict; BEGIN { use Exporter; use RDA::Agent; } # Define the global public variables use vars qw($VERSION @ISA); $VERSION = sprintf("%d.%02d", q$Revision: 2.6 $ =~ /(\d+)\.(\d+)/); @ISA = qw(Exporter); # Define global constants my $FMT = '\\s*PlsqlDatabaseConnectString\\s*(.*)\\s+' .'(((Net)?ServiceName|SID|TNS)Format)'; # Report the module version number sub Version { $VERSION; } =head2 S This method extracts the details of all different database connections from the configuration file. It attempts to preserve collection indications provided in the previous setup run. It returns the database identifier list. =cut sub get_db_set { my ($agt, $cfg) = @_; my ($cnt, $fmt, $hst, $itm, $loc, $prt, $sid, $val, @set, @tb_sid, %tb_flg, %tb_dba, %tb_fmt, %tb_loc, %tb_usr); # Get the previous settings foreach $itm (split(/\|/, $agt->get_setting('APEX_DB_SET', ''))) { next unless $itm && ($sid = $agt->get_setting("APEX_SID_$itm")); $tb_flg{$sid} = $agt->get_setting("APEX_FLAG_$itm"); $tb_usr{$sid} = $agt->get_setting("APEX_USER_$itm"); $tb_dba{$sid} = $agt->get_setting("APEX_SYSDBA_$itm"); } # Extract database connection details from the configuration file if (open(IN, "<$cfg")) { while () { next if m/^