# S294LANG.def: Collects Oracle Language Information # $Id: S294LANG.def,v 1.8 2009/02/06 18:22:54 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/S294LANG.def,v 1.8 2009/02/06 18:22:54 mschenke Exp $ # # Change History # 20090206 DEM Encode file names. =head1 NAME S294LANG - Collects Oracle Language Information =head1 DESCRIPTION This module collects information about Oracle language products. The following reports can be generated and are regrouped in C: =cut echo tput('bold'),'Processing LANG module ...',tput('off') # Initialization var $ORACLE_HOME = getSetting('ORACLE_HOME','') var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' toc '1:Oracle Languages' # Load the common macros run library() =head2 Precompiler Versions Collects Oracle precompiler versions. =cut macro precomp_versions {var ($pgm,$prd) = @arg import $ORACLE_HOME if isWindows() var $cmd = catFile($ORACLE_HOME,'bin',concat($pgm,'.exe')) else var $cmd = catFile($ORACLE_HOME,'bin',$pgm) if testFile('x',$cmd) {report $pgm write '---+',$prd var ($lin) = grepCommand(lastCommand(),'Release','f') if $lin {write '' write $lin write '' } else write 'Error encountered when executing ',encode($cmd) toc '3:[[',getFile(),'][rda_report][',$prd,']]' } } debug ' Inside LANG module, gathering precompiler versions' pretoc '2:Precompiler Versions' call precomp_versions('proc','Pro*C/C++ Version') call precomp_versions('procob','Pro*COBOL Version') call precomp_versions('profor','Pro*FORTRAN') unpretoc =head2 Library Versions For Windows, it collects Oracle OCI and precompiler library versions. =cut macro write_version {var ($dir,$dll) = @arg if !$pre {import $ORACLE_HOME var $pre = concat('^',quote($ORACLE_HOME),'\b') } loop $fil (grepDir($dir,$dll,'ir')) {var %inf = getVersionInfo($fil) if %inf {report concat('ver_',$fil) write '---+ Version Information of ',encode($fil) loop $key (keys(%inf)) write '|*',$key,' *|',$inf{$key},' |' toc '3:[[',getFile(),'][rda_report][',encode(replace($fil,$pre,'$OH')),']]' } } } if isWindows() {debug ' Inside LANG module, gathering library versions' pretoc '2:Library Versions' var $dir = catDir($ORACLE_HOME,'oci','lib') call write_version($dir,'^oraocci\d+\.dll$') var $dir = catDir($ORACLE_HOME,'bin') call write_version($dir,'^oci.dll$') call write_version($dir,'^ociw32.dll$') call write_version($dir,'^oraclient\d+\.dll$') call write_version($dir,'^ocijdbc\d+\.dll$') unpretoc } =head2 appl_analysis - Application Analysis Collects application information such as bit architecture. =head2 link_analysis - Linking Information For UNIX, it collects application dynamic linking information. =head2 core_analysis - Core Dump Analysis For UNIX, it analyzes core dumps present in the application directory structure. =cut if getSetting('LANG_ANALYZE') var $app = getSetting('LANG_APPL_PATH') if $app {debug ' Inside LANG module, getting application information' if isWindows() {pretoc '2:Application Information' call write_version(dirname($app),concat('^',quote(basename($app)),'$')) unpretoc } elsif isUnix() {pretoc '2:Application Information' if testFile('f',$app) {# Application analysis report appl_analysis var $arg = quote($app,'x') var $cmd = join(' ','file',$arg) write '---+!! Executable Information' write '---## Using: ',encode($cmd) call writeCommand($cmd) write $TOP toc '3:[[',getFile(),'][rda_report][Executable Information]]' # Link analysis var $osn = getOsName() if match($osn,'solaris') var $cmd = join(' ','ldd',$arg) elsif match($osn,'hpux') var $cmd = join(' ','chatr',$arg) elsif match($osn,'aix') var $cmd = join(' ','dump -Hv',$arg) elsif match($osn,'linux') var $cmd = join(' ','ldd',$arg) else var $cmd = undef if $cmd {report link_analysis write '---+!! Shared Libraries Linked to the Application' write '---## Using: ',encode($cmd) call writeCommand($cmd) write $TOP toc '3:[[',getFile(),'][rda_report][Linking Information]]' } } unpretoc } if and(getSetting('LANG_CORE_ANALYZE'),isUnix()) {debug ' Inside LANG module, analyzing core dumps' var @dmp = grepDir(dirname($app),'(^core\.\d+$|core$)','dr') if @dmp {# Include the core analyzer run COREinfo() # When a debugger is found, analyze the core dumps if can_analyze_core() {var $dbg = last report core_analysis write '---+!! Core Dump Stack Trace Extraction' write '---## Using: ',$dbg write $TOC call analyze_core(@dmp) toc '3:[[',getFile(),'][rda_report][Core Dump Analysis]]' } } } } =head2 Network Trace Files Collects the Network trace files. =cut var ($net) = grepDir(getEnv('TNS_ADMIN',\ catDir($ORACLE_HOME,'network','admin')),\ 'sqlnet.ora','fip') if grepFile($net,'^\s*TRACE_DIRECTORY_CLIENT','i') var $dir = value(last) if !$dir var $dir = catDir($ORACLE_HOME,'network','admin') if grepFile($net,'^\s*TRACE_FILE_CLIENT','i') var $pat = concat(value(last),'\w+\.trc$') else var $pat = 'cli_\w+\.trc$' pretoc '2:Network Trace Files' call sort_files(3,100,grepDir($dir,$pat,'ip')) unpretoc =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.5: Saravanan Gurunathan. =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