# DClang.ctl:294:Collects Oracle Language Information # $Id: DClang.ctl,v 1.3 2013/10/30 07:18:23 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/DB/DClang.ctl,v 1.3 2013/10/30 07:18:23 RDA Exp $ # # Change History # 20130422 MSC Improve the validation. =head1 NAME DB:DClang - Collects Oracle Language Information =head1 DESCRIPTION This module collects information about Oracle language products. The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing DB.LANG module ...',tput('off') # Initialization var $CORE_ANALYZE = ${B_CORE_ANALYZE} var $ORACLE_HOME = ${SET.RDA.BEGIN.D_ORACLE_HOME:''} var $MOD = cond(isUnix(),'fx','fr') var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' toc '1:Oracle Languages' # Load the common macros run RDA:library() =head2 Precompiler Versions Collects Oracle precompiler versions. =cut macro precomp_versions {var ($pgm,$prd) = @arg import $MOD,$ORACLE_HOME if or(isWindows(),isCygwin()) var $cmd = catFile($ORACLE_HOME,'bin',concat($pgm,'.exe')) else var $cmd = catFile($ORACLE_HOME,'bin',$pgm) if ?testFile($MOD,$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 loop $fil (grepDir($dir,$dll,'ir')) {var $inf = getVersionInfo($fil) if $inf {output F,concat('ver_',$bas = basename($fil)) prefix write '---+ Version Information of ',encode($fil) loop $key (keys($inf)) write '|*',$key,' *|',$inf->{$key},' |' if isCreated(true) toc '3:[[',getFile(),'][rda_report][',encode(catSymbol($fil)),']]' } } } if or(isWindows(),isCygwin()) {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 $CORE_ANALYZE var $app = ${F_APPL_PATH} if $app {debug ' Inside LANG module, getting application information' if or(isWindows(),isCygwin()) {pretoc '2:Application Information' call write_version(dirname($app),concat('^',verbatim(basename($app)),'$')) unpretoc } elsif isUnix() {pretoc '2:Application Information' if ?testFile('f',$app) {# Application analysis report appl_analysis var $arg = quote($app) 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($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 OS: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, 2016, Oracle and/or its affiliates. All rights reserved. =head1 TRADEMARK NOTICE Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. =cut