# DSCVinfo.def: Collects Generic Oracle Discoverer Information # $Id: DSCVinfo.def,v 1.5 2009/08/08 18:23:07 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/DSCVinfo.def,v 1.5 2009/08/08 18:23:07 mschenke Exp $ # # Change History # 20090707 DEM Collect database information. =head1 NAME DSCVinfo - Collects Generic Oracle Discoverer Information =head1 DESCRIPTION This module collects generic Oracle Discoverer information. =cut # Initialization var ($AS11) = @arg import $DISCOVERER_HOME,$ORACLE_HOME,$TOC,$TOP,$VER var $DISCO_INFRA = getSetting('DISCO_INFRA',1) var $DISCO_INFRA_LOGIN = getSetting('DISCO_INFRA_LOGIN') var $DISCO_INFRA_SID = getSetting('DISCO_INFRA_SID') var $DISCO_EUL = getSetting('DISCO_EUL',1) var $DISCO_EUL_LOGIN = getSetting('DISCO_EUL_LOGIN') var $DISCO_EUL_SID = getSetting('DISCO_EUL_SID') # Load the common macros run DBinfo() # Collect information from the infrastructure database if $DISCO_INFRA {if hasSqlPassword($DISCO_INFRA_LOGIN,$DISCO_INFRA_SID) var $pwd = undef else var $pwd = askPassword(\ concat('Enter ',$DISCO_INFRA_LOGIN,'@',$DISCO_INFRA_SID,' user password:')) # Switch the context var $log = setSqlLogin($DISCO_INFRA_LOGIN,$pwd,$DISCO_INFRA_SID,\ getSetting('DISCO_INFRA_SYSDBA',0)) var $try = setSqlFailure(0) =head2 portlet - Active Discoverer Portlets Collects active Discoverer portlets information from the infrastructure database. =cut if !testSql() {debug ' Inside DSCV module, getting Active Discoverer Portlets' report portlet var $TTL = '---+!! Active Discoverer Portlets' var @TTL = ('',\ '---+ PTM5_SCHEDULE Information',\ '---+ PTM5_CACHE Information') var ($HDR[1],$col1) = getSqlColumns('RDA','DISCOVERER5','PTM5_SCHEDULE') call clearSqlColumns('RDA') call setSqlColumns('RDA','cch_error_msg',\ "REPLACE(cch_error_msg,CHR(10),'%BR%')") var ($HDR[2],$col2) = getSqlColumns('RDA','DISCOVERER5','PTM5_CACHE') call clearSqlColumns('RDA') if $col1 {set $sql {SELECT :1 " FROM discoverer5.ptm5_schedule; } } if $col2 {append $sql {PROMPT ___Macro_separator(2)___ "SELECT :2 " FROM discoverer5.ptm5_cache; } } call separator(1) call writeSql(bindSql($sql,$col1,$col2)) call separator(0,'Active Discoverer Portlets') } # Restore the previous context call setSqlLogin($log) call setSqlFailure($try) } # Collect EUL information if $DISCO_EUL {if hasSqlPassword($DISCO_EUL_LOGIN,$DISCO_EUL_SID) var $pwd = undef else var $pwd = askPassword(\ concat('Enter ',$DISCO_EUL_LOGIN,'@',$DISCO_EUL_SID,' user password:')) # Switch the context var $log = setSqlLogin($DISCO_EUL_LOGIN,$pwd,$DISCO_EUL_SID,\ getSetting('DISCO_EUL_SYSDBA',0)) var $try = setSqlFailure(0) =head2 eulversion - EUL Version Collects End User Layer (EUL) version information. =cut if !testSql() {debug ' Inside DSCV module, getting EUL version' report eulversion prefix {write '---+ EUL Version' write '|*Release*|*Version Minimum Code Version*|*EUL Timestamp*|' } set $sql {SELECT '|' || " ver_release || ' |' || " ver_min_code_ver || ' |' || " ver_eul_timestamp || ' |' " FROM eul5_versions; } call writeSql($sql) if isCreated(true) toc '2:[[',getFile(),'][rda_report][EUL Version]]' =head2 eulmode - EUL Mode Collects End User Layer (EUL) mode. =cut debug ' Inside DSCV module, getting EUL mode' report eulmode prefix {write '---+ EUL Mode' write '|*Mode*|' } set $sql {SELECT '|' || " DECODE(COUNT(1),0,'Standard EUL','Application Mode EUL') || ' |' " FROM eul5_app_params " WHERE app_type = 'SP' " AND app_id = 1016; } call writeSql($sql) if isCreated(true) toc '2:[[',getFile(),'][rda_report][EUL Mode]]' } # Restore the previous context call setSqlLogin($log) call setSqlFailure($try) } =head2 check_discoverer - Discoverer Status Runs the checkdiscoverer script. =cut if !$AS11 {debug ' Inside DSCV module, running checkdiscoverer command' report check_discoverer if isUnix() {var $pgm = catCommand($DISCOVERER_HOME,'util','checkdiscoverer.sh') var $cmd = concat($pgm,' 2>&1') } elsif isWindows() {var $pgm = catCommand($DISCOVERER_HOME,'util','checkdiscoverer.bat') var $cmd = concat($pgm,' -nopause 2>&1') } else var $pgm = undef if testFile('fr',$pgm) {write '---+!! Discoverer Status' write '---## Using: ',encode($cmd) if !writeCommand($cmd) write '** Error running checkdiscoverer command **%BR%' write $TOP toc '2:[[',getFile(),'][rda_report][Discoverer Status]]' } } =head2 exe_versions - Executable Versions Gathers Oracle Discoverer executable versions. =cut debug ' Inside DSCV module, getting executable versions' report exe_versions prefix {write '---+!! Executable Versions' write '|*File*|*Version*|' } loop $fil (grepDir(catDir($ORACLE_HOME,'bin'),'^dis51(ws|pr)','ip')) {next !testFile('fr',$fil) call loadString($fil,$VER) loop $lin (getLines()) {var (undef,$ver) = split(':',$lin,2) write '|',encode($fil),' |',$ver,' |' } } if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Executable Versions]]' } =head2 lib_versions - Library Versions Gathers Oracle Discoverer library versions. =cut if isWindows() var $dir = catDir($ORACLE_HOME,'bin') elsif isUnix() var $dir = catDir($DISCOVERER_HOME,'lib') else var $dir = undef if $dir {debug ' Inside DSCV module, getting library versions' report lib_versions prefix {write '---+!! Library Versions' write '|*File*|*Version*|' } loop $fil (grepDir($dir,'\.(dll|so)$','ip')) {next !testFile('fr',$fil) call loadString($fil,$VER) loop $lin (getLines()) {var (undef,$ver) = split(':',$lin,2) write '|',encode($fil),' |',$ver,' |' } } if isCreated(true) {write $TOP toc '2:[[',getFile(),'][rda_report][Library Versions]]' } } =begin credits =over 10 =item RDA 4.4: Gurmakh Dev, Steve Fitzgerald. =item RDA 4.10: John Whitaker. =item RDA 4.15: Greg Cook, Andrew Salt. =back =end credits =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