# DEVr11.ctl: Defines Common Macros for Oracle Developer 11g # $Id: DEVr11.ctl,v 1.13 2015/02/20 15:30:24 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/DEVr11.ctl,v 1.13 2015/02/20 15:30:24 RDA Exp $ # # Change History # 20150220 KRA Improve list management. =head1 NAME OFM: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 use Type # 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 OFM:DEVlib() run RDA:library() =head2 S This macro gathers Oracle Forms and Oracle Reports installation files and the directory contents information. It collects the toolkit F file, application architecture, and environment variables information. It collects the owner and group permissions of the files used by Oracle Forms. =cut macro collect_dev_generic {import $FORMS_HOME,$ORACLE_HOME,$REPORTS_HOME report app_arch prefix write '---+ Application Architecture' if or(${RDA.B_WINDOWS},${RDA.B_CYGWIN}) {if ?testFile('f',catFile($ORACLE_HOME,'bin','rw.dll')) write '**Architecture: ',nvl(file(last,true),'N/A'),'**' } elsif ${RDA.B_UNIX} {if ?testFile('f',catFile($ORACLE_HOME,'bin','frmweb')) write '**Architecture: ',nvl(file(last,true),'N/A'),'**' } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Application Architecture]]' report env write '---+ Important Environment Variables' write '|*Variable*|*Value*|' loop $key ('DISPLAY','REPORTS_DEFAULT_DISPLAY','TNS_ADMIN') write '|',$key,' |',getEnv($key),' |' toc '2:[[',getFile(),'][rda_report][Environment Variables]]' if ?testDir('d',$FORMS_HOME) {report frm_perms write '---+ Oracle Forms File Permissions' loop $pth ($FORMS_HOME,findDir($FORMS_HOME,'^\.+$','vr')) call statDir('an',$pth) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Forms File Permissions]]' } 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 # Get uifont.ali file contents if or(isWindows(),isCygwin()) {pretoc '2:Toolkit' if ?testFile('r',catFile($ORACLE_HOME,'tools','common','uifont.ali')) call get_file(last,0,'tk_',3) 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' report rep_j2ee_perms prefix write '---+ Oracle Reports J2EE File Permissions' call statDir('an',catDir($REPORTS_HOME,'j2ee')) if isCreated(true) toc '3:[[',getFile(),'][rda_report][Reports J2EE File Permissions]]' # Get reports/conf directory contents var $dir = catDir($REPORTS_HOME,'conf') if ?testFile('r',catFile($dir,'cgicmd.dat')) {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')) } unpretoc } =head2 S This macro collects Oracle Developer-related start 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 ($pre,$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' 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 setPrefix(concat($pre,'_c_',$cmp)) var $cnt = 0 loop $fil (\ catFile($cfg,$typ,$cmp,'guicommon','tk','admin','uifont.ali'),\ catFile($cfg,$typ,$cmp,'guicommon','tk','admin','uiprint.txt'),\ catFile($cfg,$typ,$cmp,'guicommon','tk','admin','uiscreenprint.txt'),\ catFile($cfg,$typ,$cmp,'tools','common','uifont.ali')) {if ?testFile('r',$fil) call get_file($fil,0,sprintf('tk_d%02d_',incr($cnt)),3) } var $cnt = 0 loop $fil (grepDir(catDir($cfg,$typ,$cmp,'guicommon','tk','admin'),\ 'Tk2Motif.rgb','r',1)) call get_file($fil,0,sprintf('tk_d%02d_',incr($cnt)),3) var $cnt = 0 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,sprintf('tk_d%02d_',incr($cnt)),3) } } unpretoc # Restore the prefix call setPrefix($pre) # 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 OFM 11g' write '' if ${RDA.B_UNIX} {# Set the required environment var $bkp = setContext({TERM => 'vt220',\ 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),' help=yes 2>/dev/null'),'\S','f') write '' write $TOP } # Restore the previous environment call restoreContext($bkp) } elsif or(${RDA.B_CYGWIN},${RDA.B_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. Collects the configuration parameters active per section by parsing F file. =cut macro collect_forms_instance {var ($pre,$top,\%cmp) = @arg import $DEV_AGE,$DEV_FRM_URL,$TAIL debug ' - Getting Oracle Forms configuration and log files' pretoc '2:Oracle Forms' # Report Forms application URL used if length($DEV_FRM_URL) {report frm_url write '---+ Forms Application URL' write '**URL used for starting forms application: ',$DEV_FRM_URL,'**%BR%' write '**Note:** Parameters set in the URL may override ``formsweb.cfg`` \ parameters depending on the setting \ ``RESTRICTEDURLPARAMS`` (refer %MOS_DOC:245941.1% for \ details).' toc '3:[[',getFile(),'][rda_report][Forms Application URL]]' } # Collect instance related configuration and log files var @dft = () 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 setPrefix(concat($pre,'_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 # Get formsweb.cfg configuration parameters call write_forms_web(4,\ catFile($top,'config',$typ,$cmp,'server','formsweb.cfg')) # 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 setPrefix($pre) } =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. It uses the Windows registry to include the printer device information. =cut macro collect_reports_instance {var ($pre,$top,\%cmp) = @arg import $TAIL pretoc '2:Oracle Reports' # Collect the generic files call cat_report(catDir($top,'reports'),'reports_install.properties') # Collect the component-related files var $dir = catDir($top,'config','ReportsBridgeComponent') loop $nam (grepDir($dir,'^[^\.]','n')) {if ?testDir('d',catDir($dir,$nam)) call push(@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 setPrefix(concat($pre,'_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 prefix call setPrefix($pre) # 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),' -findAll 2>&1')) if isCreated(true) toc '3:[[',getFile(),'][rda_report][Reports Diagnostic Tool Results]]' } # Collect the printer device information if or(isWindows(),isCygwin()) call get_printer_devices(3) 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. =item RDA 4.31: Roelof Van Suilichem. =item RDA 8.00: Adriana Dominguez. =item RDA 8.05: Adriana Dominguez. =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