package RDA::Upgrade; # $Id: Upgrade.pm,v 1.53 2009/08/07 23:36:59 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/RDA/Upgrade.pm,v 1.53 2009/08/07 23:36:59 mschenke Exp $ # # Change History # 20090805 MSC Upgrade to build 090807. =head1 NAME RDA::Upgrade - Package Used to Manage Upgrades. =head1 SYNOPSIS require RDA::Upgrade; =head1 DESCRIPTION The following method is available: =cut use strict; BEGIN { use Exporter; } # Define the global public variables use vars qw($VERSION); $VERSION = sprintf("%d.%02d", q$Revision: 1.53 $ =~ /(\d+)\.(\d+)/); # Define the global private variables my %tb_mod = ( S000INI => '090807', S010CFG => '061121', S100OS => '090805', S110PERF => '080208', S120NET => '080804', S200DB => '090503', S204LOG => '090807', S206RSRC => '061127', S250BEE => '080430', S260OMS => '071106', S300IAS => '080804', S310J2EE => '080419', S342OVD => '071023', S360CRID => '080521', S373BPEL => '080509', S390DSCV => '090807', S400RAC => '061121', S400RACD => '061110', S402ASM => '090807', S405DG => '081103', S410GRID => '090503', S420AGT => '080208', S430DBC => '070905', S440EM => '070905', S919LOAD => '090330', ); # Report the module version number sub Version { $VERSION; } =head2 S This method updates the setup information. =cut sub setup { my ($agt) = @_; my ($bld, $flg); # Determine the current setup build $bld = $agt->get_setting('RDA_BUILD'); $bld = '000000' unless $bld && $bld =~ m/^\d{6}$/; # Set temporarily the auto-configure flag $flg = $agt->set_info('yes', 1); # Upgrade the setup configuration if ($bld lt '060124') { my ($val); # Move the opatch setting if (defined($val = $agt->del_setting('OPATCH_DIR'))) { $agt->upd_module('S000INI'); $agt->set_current('S130INST'); $agt->set_setting('OPATCH_DIR', $val, 'D', 'OPatch directory'); $agt->set_current; } } if ($bld lt '051123') { my $tbl = {}; # Upgrade DB settings if ($agt->is_configured('S200DB')) { # Move settings to the INI module _get_value($agt, $tbl, qw(SQL_ACCESS SQL_ATTEMPTS SQL_COMMAND SQL_ERROR SQL_FORK SQL_TIMEOUT SQL_TRACE)); $agt->setup('S200DB'); _set_temp($agt, $tbl); # Actualize DB settings after the module split unless ($agt->is_configured('S201DBA') || $agt->is_configured('S204LOG') || $agt->is_configured('S205BR')) { $agt->setup('S201DBA'); $agt->setup('S204LOG'); $agt->setup('S205BR'); } } # Upgrade INI settings $agt->setup('S000INI') if $agt->is_configured('S000INI'); } if ($bld lt '051202') { foreach my $mod ($agt->get_modules()) { if ($mod =~ m/^(S[2-4]\d{2}[A-Za-z]\w*)\.(ctl|def)$/i && $agt->get_setting("$1_SETTINGS")) { $agt->set_current($1); $agt->set_setting("$1_TITLE", 'Oracle Product Settings', 'T', 'Title for a setting report section'); } } $agt->set_current; } if ($bld lt '060206') { my $str; # Convert the OCS modules if ($agt->is_configured('S240MAIL')) { $agt->ren_module('S240MAIL','S241MAIL'); $agt->set_temp_setting('OCS_AGE', $agt->get_setting('EMAIL_AGE')); $agt->set_temp_setting('OCS_TAIL1', $agt->get_setting('EMAIL_TAIL')); } if ($agt->is_configured('S322ECM')) { $agt->ren_module('S322ECM', 'S248CONT'); $agt->set_temp_setting('CONTENT_IN_USE', $agt->get_setting('ECM_IN_USE')); $agt->set_temp_setting('OCS_TAIL1', $agt->get_setting('ECM_TAIL1')); $agt->set_temp_setting('OCS_TAIL2', $agt->get_setting('ECM_TAIL2')); } $agt->setup('S241MAIL') if $agt->is_configured('S241MAIL'); $agt->setup('S248CONT') if $agt->is_configured('S248CONT'); if ($str = $agt->get_setting('SQL_PASSWORD_ECM_REPOS_USER')) { $agt->set_current('S999END'); $agt->del_setting('SQL_PASSWORD_ECM_REPOS_USER'); $agt->set_setting('SQL_PASSWORD_CONTENT_REPOS_USER', $str, 'T', "Password for 'CONTENT_REPOS_USER'"); $agt->set_current; } } if ($bld lt '061003') { # Configure the LOAD module if ($agt->is_configured('S909RDSP')) { $agt->set_temp_setting('NO_LOAD', $agt->get_setting('NO_EXTRA')); $agt->setup('S909RDSP'); $agt->setup('S919LOAD'); } } if ($bld lt '061004') { my $tbl = {}; # Split RAC module if ($agt->is_configured('S400RAC')) { _get_value($agt, $tbl, qw(CLUSTER_FACTOR CLUSTER_HANG_CHECK CLUSTER_PARALLEL CLUSTER_REPEAT CLUSTER_SLEEP)); $agt->setup('S400RAC'); _set_temp($agt, $tbl); $agt->setup('S400RACD'); } } if ($bld lt '061127') { my $tbl = {}; # Move the LDAP settings if ($agt->is_configured('S241MAIL')) { $agt->set_temp_setting('OCS_IN_USE', $agt->get_setting('EMAIL_SERVER_IN_USE')); _get_value($agt, $tbl, qw(LDAP_HOST LDAP_PORT LDAP_DOMAIN)); $agt->setup('S241MAIL'); _set_temp($agt, $tbl); $agt->setup('S240OCS'); } } if ($bld lt '071008') { # Rename the OLAP/OES module if ($agt->is_configured('S210OLAP')) { $agt->ren_module('S210OLAP', 'S215OES'); $agt->set_temp_setting('EXPRESS_IN_USE', $agt->get_setting('OLAP_IN_USE')); $agt->setup('S215OES'); $agt->setup('S210OLAP'); } } if ($bld lt '080804') { # Split the NET module if ($agt->is_configured('S120NET')) { my %old = ( ONET_IN_USE => 'DATABASE_INSTALLED', ONET_LOG_SIZE => 'NETWORK_LOG_SIZE', ONET_TRACE_AGE => 'NETWORK_TRACE_AGE', ONET_TRACE_SIZE => 'NETWORK_TRACE_SIZE', ); foreach my $key (keys(%old)) { $agt->set_temp_setting($key, $agt->get_setting($old{$key})); } $agt->setup('S122ONET'); } } # Update individual modules foreach my $mod (sort keys(%tb_mod)) { $agt->setup($mod) if $bld lt $tb_mod{$mod} && $agt->is_configured($mod); } # Restore the auto-configure flag $agt->set_info('yes', $flg); # Indicate that the setup must be saved 1; } sub _get_value { my $agt = shift; my $tbl = shift; my $val; foreach my $key (@_) { $tbl->{$key} = $val if defined($val = $agt->get_setting($key)); } } sub _set_temp { my $agt = shift; my $tbl = shift; foreach my $key (keys(%$tbl)) { $agt->set_temp_setting($key, $tbl->{$key}); } } 1; __END__ =head1 SEE ALSO L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L, L =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut