# DEVr11.def: Defines Common Macros for Oracle Developer 11g # $Id: DEVr11.def,v 2.14 2012/01/03 13:34:41 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/DEVr11.def,v 2.14 2012/01/03 13:34:41 mschenke Exp $ # # Change History # 20120103 MSC Change the copyright notice. =head1 NAME DEVr11 - Defines Common Macros for Oracle Developer 11g =head1 DESCRIPTION This persistent submodule regroups macros that are common to Oracle Developer in Oracle Fusion Middleware 11g. The following macro is available: =cut # Make the module persistent and share macros keep $KEEP_BLOCK,@SHARE_MACROS var @SHARE_MACROS = ('collect_dev_generic','collect_dev_instance',\ 'collect_forms_instance','collect_reports_instance') # Load the common macros run DEVlib() run library() =head2 S This macro gathers Oracle Forms and Oracle Reports installation files and the directory contents information. It uses the Windows registry to include the printer device information. =cut macro collect_dev_generic {import $FORMS_HOME,$ORACLE_HOME,$REPORTS_HOME pretoc '2:Installation Files' var $dir = catDir($ORACLE_HOME,'inventory','Components21') call get_install($dir,'oracle.','reports.core') call get_install($dir,'oracle.','reports.builder') call get_install($dir,'oracle.','developer.forms.compiler') call get_install($dir,'oracle.','developer.forms.builder') unpretoc # List forms/java directory contents pretoc '2:Oracle Forms' call get_forms_java_directory($FORMS_HOME) # Get forms/server directory contents call sort_files(3,0,\ grepDir(catDir($FORMS_HOME,'server'),'(\.cfg$|\.conf$|\.env$|\.htm$|\ \.properties$|\.xml)','ipn')) unpretoc # Get reports configuration pretoc '2:Oracle Reports' var $dir = catDir($REPORTS_HOME,'conf') if testFile('r',catFile($dir,'cgicmd.dat')) {# Get reports/conf directory contents var $dir = catDir($ORACLE_HOME,'reports','conf') call sort_files(3,0,\ grepDir($dir,'\.conf$|^(cgicmd.dat|distribution.xsl|proxyinfo.xml|\ rwserver.install|rwserver.template|rwservlet.properties)$',\ 'ipn')) } if or(isWindows(),isCygwin()) call get_printer_devices(3) unpretoc } =head2 S This macro collects Oracle Developer-related startup scripts, toolkit files (such as F, F, and F), reports the syntax integrity of the collected F files using the F command for UNIX and the F command for Windows, and reports the version. =cut macro collect_dev_instance {var ($abr,$top,\%cmp) = @arg import $ORACLE_HOME,$TOC,$TOP debug ' - Getting Oracle Developer startup scripts, toolkit files and version' # Oracle Forms/Reports startup scripts pretoc '2:Startup Scripts' call sort_files(3,0,\ grepDir(catDir($top,'bin'),'\.(sh|bat)$','ip'),\ grepDir(catDir($top,'config','reports','bin'),'\.(sh|bat)$','ip')) unpretoc # Oracle Forms/Reports toolkit files pretoc '2:Toolkit' macro find_file {loop $fil (@arg) {if testFile('r',$fil) {call get_file($fil,0,'tk_',3) return $fil } } return undef } var ($cfg,@dft,@uif) = (catDir($top,'config')) if !grep(%cmp,'^DeJvmRuntime(Info)?|FRComponent$','i') var @dft = ('FRComponent|frcommon') loop $key (keys(%cmp),@dft) {var ($typ,$cmp) = split('\|',$key,2) next !match($typ,'^DeJvmRuntime(Info)?|FRComponent$',true) if match($typ,'^DeJvmRuntime(Info)?$',true) {var $typ = 'FRComponent' if match($cmp,'^dejvm$',true) var $cmp = 'frcommon' } debug ' - ',$cmp,' component' call setAbbr(concat($abr,'_c_',$cmp)) loop $fil (\ catFile($cfg,$typ,$cmp,'guicommon','tk','admin','uiprint.txt'),\ catFile($cfg,$typ,$cmp,'guicommon','tk','admin','uiscreenprint.txt')) {if testFile('r',$fil) call get_file($fil,0,'tk_',3) } if find_file(catFile($cfg,$typ,$cmp,'guicommon','tk','admin','uifont.ali'),\ catFile($cfg,$typ,$cmp,'tools','common','uifont.ali')) var @uif = (@uif,last) var $cnt = 0 loop $fil (grepDir(catDir($cfg,$typ,$cmp,'guicommon','tk','admin'),\ 'Tk2Motif.rgb','r',1)) {incr $cnt call get_file($fil,0,sprintf('tk_d%02d_',$cnt),3) } loop $fil (\ catFile($cfg,$typ,$cmp,'guicommon','tk','admin','PPD','default.ppd'),\ catFile($cfg,$typ,$cmp,'guicommon','tk','admin','PPD','datap462.ppd'),\ catFile($cfg,$typ,$cmp,'guicommon','tk','admin','PPD','screenprinter.ppd')) {if testFile('r',$fil) call get_file($fil,0,'tk_',3) } } unpretoc # Restore the abbreviation call setAbbr($abr) # Check the syntax of collected uifont.ali files if @uif {if isUnix() var $pgm = catFile($ORACLE_HOME,'bin','mfontchk') elsif or(isWindows(),isCygwin()) var $pgm = catFile($ORACLE_HOME,'bin','fnchk.exe') else var $pgm = undef if testFile('fx',$pgm) {var $pgm = lastCommand() macro need_batch {import $ORACLE_HOME if or(${RDA.CYGWIN},${RDA.WINDOWS}) {loop $fil ('frmcmp.exe','rwrun.exe') {if testFile('r',catFile($ORACLE_HOME,'bin',$fil)) {var $inf = getVersionInfo(lastFile(),true) var $ver = replace($inf->{'FileVersion'},',\s*','.',true) return compare('valid',$ver,'11.1.2') } } } return false } report uifont if need_batch() {loop $uif (@uif) {var $out = getTemp('out') var $cmd = concat($pgm,' ',quote($uif,'x'),' -batch -log ',\ quote($out,'x'),' 2>&1') prefix {if !isCreated() write '---+!! Syntax Integrity of uifont.ali' write '---## Using: ',encode($cmd) } call command($cmd) call writeFile($out) call unlinkTemp('out') } } else {loop $uif (@uif) {var $cmd = concat($pgm,' ',quote($uif,'x'),' 2>&1') prefix {if !isCreated() write '---+!! Syntax Integrity of uifont.ali' write '---## Using: ',encode($cmd) } call writeCommand($cmd) } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Syntax Integrity of uifont.ali]]' } } # Oracle Forms/Reports versions report versions write '---+!! Versions' write $TOC write '%BR%' write '' write 'ORACLE_HOME=',$ORACLE_HOME write 'ORACLE_INSTANCE=',$top write 'This install is part of FM 11g' write '' if ${RDA.UNIX} {# Set the required environment var $u_t = setEnv('TERM','vt220') var $o_t = setEnv('ORACLE_TERM','vt220') # Extract the product versions var %hsh = ('Forms', catFile($top,'bin','frmcmp_batch.sh'),\ 'Reports',catFile($top,'config','reports','bin','rwrun.sh')) loop $nam (keys(%hsh)) {next !testFile('x',$fil = $hsh{$nam}) write '---+ Current Runtime Version of Oracle ',$nam write '---## Using: ',encode($fil),' help=yes' write '' write grepCommand(concat(quote($fil,'x'),' help=yes'),'\S','f') write '' write $TOP } # Restore the previous environment call setEnv('TERM',$u_t) call setEnv('ORACLE_TERM',$o_t) } elsif or(${RDA.CYGWIN},${RDA.WINDOWS}) {var %hsh = ('Forms', catFile($ORACLE_HOME,'bin','frmcmp.exe'),\ 'Reports',catFile($ORACLE_HOME,'bin','rwrun.exe')) loop $nam (keys(%hsh)) {next !testFile('r',$fil = $hsh{$nam}) write '---+ Current Runtime Version of Oracle ',$nam write '---## Information Extracted from ',encode($fil) var $inf = getVersionInfo($fil) write '' write replace($inf->{'FileVersion'},',\s*','.',true) write '' write $TOP } } # Determine latest patch applied var $dir = catDir($ORACLE_HOME,'lib') prefix write '---+ List of librw files to see PRE_patch suffix' call statFile('b',reverse(grepDir($dir,'^librw','inr'))) if hasOutput(true) write $TOP # Determine base installed version prefix write '---+ Installed Version' var $dir = catDir($ORACLE_HOME,'inventory','Components21') loop $nam ('oracle.developer.forms.compiler',\ 'oracle.developer.forms.builder') {var $cmp = catDir($dir,$nam) next !testDir('d',$cmp) write '---## Using $ORACLE_HOME/inventory/Components21/',$nam,\ ' to determine initially installed version' call statDir('n',$cmp) break } loop $nam ('oracle.reports.core','oracle.reports.builder') {var $cmp = catDir($dir,$nam) next !testDir('d',$cmp) write '---## Using $ORACLE_HOME/inventory/Components21/',$nam,\ ' to determine initially installed version' call statDir('n',$cmp) break } if hasOutput(true) write $TOP toc '2:[[',getFile(),'][rda_report][Versions]]' # Collect EM related files pretoc '2:Oracle Enterprise Manager' var $dir = catDir($top,'EMAGENT',concat('emagent_',basename($top)),'sysman') call sort_files(3,0,catFile($dir,'emd','agntstmp.txt'),\ catFile($dir,'emd','targets.xml'),\ grepDir(catDir($dir,'log'),'^\.+$','pv')) unpretoc } =head2 S This macro collects Oracle Forms-related configuration and log files. =cut macro collect_forms_instance {var ($abr,$top,\%cmp) = @arg import $DEV_AGE,$TAIL debug ' - Getting Oracle Forms configuration and log files' var @dft = () pretoc '2:Oracle Forms' if !grep(%cmp,'^((DeJvm|Forms)Runtime(Info)?|(Forms|FR)Component)$','i') var @dft = ('FormsComponent|forms','FRComponent|frcommon') loop $key (keys(%cmp),@dft) {var ($typ,$cmp) = split('\|',$key,2) next !match($typ,'^((DeJvm|Forms)Runtime(Info)?|(Forms|FR)Component)$',true) if match($typ,'^FormsRuntime(Info)?$',true) var $typ = 'FormsComponent' elsif match($typ,'^DeJvmRuntime(Info)?$',true) {var $typ = 'FRComponent' if match($cmp,'^dejvm$',true) var $cmp = 'frcommon' } debug ' - ',$cmp,' component' call setAbbr(concat($abr,'_c_',$cmp)) pretoc "3:'",$cmp,"' Forms Component" # Get Forms files pretoc '4:Forms Files' call get_file(catFile(\ $top,'config',$typ,$cmp,'admin','resource','US','fmrweb.res'),0,'res_',5) unpretoc # Get Forms server files pretoc '4:Forms Server Files' call get_file(catFile($top,'config',$typ,$cmp,'registry','oracle','forms',\ 'registry','Registry.dat'),\ 0,'reg_',5) unpretoc # Collect the configuration files pretoc '4:Configuration Files' call sort_files(5,$TAIL,\ grepDir(catDir($top,'config',$typ,$cmp,'server'),\ '(\.cfg$|\.conf$|\.env$|\.htm$|\.properties$|\.xml)','ipn'),\ catFile($top,'config',$typ,$cmp,'tools','jvm','jvmcontrollers.cfg')) unpretoc # Collect the log files pretoc '4:Log Files' call sort_files(5,$TAIL,\ grepDir(catDir($top,'diagnostics','logs',$typ,$cmp),'\.log$','dir')) # Get forms/trace directory contents var ($dir,%fil) = (catDir($top,$typ,$cmp,'trace')) call find_files(\%fil,$dir,'^\.+$',5,0,concat('irvtm',$DEV_AGE),'trc_') # Get forms/trace directory contents analysis summary call dump_summary(5,\%fil) unpretoc 2 } unpretoc call setAbbr($abr) } =head2 S This macro collects Oracle Reports-related configuration and log files. It lists the files in F directory. It collects the Reports Diagnostic Tool results. =cut macro collect_reports_instance {var ($abr,$top,\%cmp) = @arg import $TAIL pretoc '2:Oracle Reports' var $dir = catDir($top,'config','ReportsBridgeComponent') loop $nam (grepDir($dir,'^[^\.]','n')) {if testDir('d',catDir($dir,$nam)) var @tmp = (@tmp,join('|','ReportsBridgeComponent',$nam)) } loop $key (keys(%cmp),@tmp,'ReportsToolsComponent|ReportsTools') {var ($typ,$cmp) = split('\|',$key,2) next !match($typ,'^(Reports(Bridge|Server|Tools))Component$',true) var ($txt) = last debug ' - ',$cmp,' component' call setAbbr(concat($abr,'_c_',$cmp)) pretoc "3:'",$cmp,"' ",$txt,' Component' # Collect the configuration files pretoc '4:Configuration Files' call sort_files(5,$TAIL,\ grepDir(catDir($top,'config',$typ,$cmp),'\.(conf|properties|xml)$','dir')) unpretoc # Collect the log files pretoc '4:Log Files' call sort_files(5,$TAIL,\ grepDir(catDir($top,'diagnostics','logs',$typ,$cmp),'\.log$','dir')) unpretoc 2 } # Restore the report abbreviation call setAbbr($abr) # List of files in $OI/reports/server directory report repsvrfile prefix write '---+!! List of Files in $OI/reports/server Directory' call statDir('at',catDir($top,'reports','server')) if isCreated(true) toc '3:[[',getFile(),'][rda_report][$OI/reports/server Files]]' # Collect the Reports Diagnostic Tool results report rwdiag var $bin = catDir($top,'config','reports','bin') var ($cmd) = grepDir($bin,'^rwdiag(\.bat|\.sh)?$','ip') if $cmd {prefix {write '---+ Reports Diagnostic Tool Results' write '---## Using: ',encode($cmd),' -findAll 2>&1' } call writeCommand(concat(quote($cmd,'x'),' -findAll 2>&1')) if isCreated(true) toc '3:[[',getFile(),'][rda_report][Reports Diagnostic Tool Results]]' } unpretoc } =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.19: Roelof Van Suilichem. =item RDA 4.25: Adriana Dominguez. =item RDA 4.26: Sudha Chandrasekaran, Adriana Dominguez. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002, 2012, 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