# BIr11.def: Defines Common Macros for Oracle Business Intelligence 11g # $Id: BIr11.def,v 2.7 2012/01/03 13:34:41 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/BIr11.def,v 2.7 2012/01/03 13:34:41 mschenke Exp $ # # Change History # 20120103 MSC Change the copyright notice. =head1 NAME BIr11 - Defines Common Macros for Oracle Business Intelligence 11g =head1 DESCRIPTION This persistent submodule regroups macros that are common to Oracle Business Intelligence Enterprise Edition 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_bi_generic','collect_bi_instance',\ 'collect_bi_repo_list') # Load the common macros run library() =head2 S This macro collects Oracle Business Intelligence Enterprise Edition version and its executable. =cut macro collect_bi_generic {var ($dir) = @arg debug ' Inside BI module, getting version information' var $nam = 'version.txt' var $fil = catFile($dir,$nam) if testFile('f',$fil) {report bi_version write '---+ Display of ',encode($nam),' File' write '---## Information Taken from ',encode($fil) var $flg = writeFile($fil) if !$flg {write '**',encode($nam),' not readable.**%BR%\ May be file permission problems.%BR%\ Permissions are:%BR%' call statFile('b',$fil) write 'User: ',id(),'%BR%' } toc '2:[[',getFile(),'][rda_report][Version Information]]' } debug ' Inside BI module, listing Oracle BI Server executables' report bi_server_bin var $dir = catDir($dir,'server','bin') prefix write '---+ List of Files in ',encode($dir) call statDir('an',$dir) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Executable List]]' } =head2 S This macro collects Oracle Business Intelligence Enterprise Edition instance information which includes configuration files, log files, DMS dump, and its repositories. =cut macro collect_bi_instance {var ($abr,$top,\%cmp,\%rep) = @arg import $BI_AGE,$BI_TAIL,$TOP # Collect the instance files debug ' - Getting Oracle Business Intelligence configuration and log files' loop $key (keys(%cmp)) {var ($typ,$cmp) = split('\|',$key,2) next !match($typ,'^OracleBI(ClusterController|JavaHost|PresentationServices|\ Scheduler|Server)Component$',true) debug ' - ',$cmp,' component' call setAbbr(concat($abr,'_c_',$cmp)) pretoc "2:'",$cmp,"' ",\ replace(replace($typ,'^OracleBI'),'Component$'),' Component' # Collect the configuration files pretoc '3:Configuration Files' call sort_files(4,$BI_TAIL,\ grepDir(catDir($top,'config',$typ,$cmp),'\.(INI|xml)$','dir')) unpretoc # Collect the log files pretoc '3:Log Files' if match($typ,'^OracleBIJavaHostComponent$',true) var @tbl = grepDir(catDir($top,'diagnostics','logs',$typ,$cmp),\ '^(jhost0\.log\.|jh.*\.log$)',concat('ipm',$BI_AGE)) elsif match($typ,'^OracleBIPresentationServicesComponent$',true) var @tbl = grepDir(catDir($top,'diagnostics','logs',$typ,$cmp),\ '^sawlog.*\.log$',concat('ipm',$BI_AGE)) else var @tbl = grepDir(catDir($top,'diagnostics','logs',$typ,$cmp),'log$','dir') call sort_files(4,$BI_TAIL,@tbl) unpretoc # Collect the DMS dump if $cmp{$key} {report dms_metrics var ($opmnctl) = grepDir(catDir($top,'bin'),'^opmnctl(\.(bat|exe))?$','fip') var $cmd = concat(quote($opmnctl,'x'),' @instance:',$dsc,\ ' metric op=query PROCESS_UID=',$cmp{$key},\ ' dmsarg="format=raw&nountype=opmn_process" 2>&1') prefix {write '---+ Display of DMS Dump Metrics' write '---## Using: ',encode($cmd) } call writeCommand($cmd) if isCreated(true) {write $TOP toc '3:[[',getFile(),'][rda_report][DMS Dump]]' } } # Collect the repositories next !match($typ,'^OracleBIServerComponent$',true) var @fil = () loop $str (keys(%rep)) {var ($dir,$nam,$rep) = split('\|',$str,3) if and(compare('eq',$dir,basename($top)),compare('eq',$nam,$cmp)) var @fil = (@fil,catFile($top,'bifoundation',$typ,$cmp,'repository',$rep)) } if @fil run BIinfo(3,@fil) unpretoc } call setAbbr($abr) } =head2 S This macro collects Oracle Business Intelligence Enterprise Edition repository names chosen by the user. =cut macro collect_bi_repo_list {var (\%rep) = @arg var $rep = getSetting('BI_REPOSITORY','All') if compare('eq',$rep,'All') {loop $itm (split('\|',getSetting('BI_REPOSITORY_LIST',''))) {next compare('eq',$itm,'None') if match($itm,'^InsDir:(.*?),Comp:(.*?),Repo:(.*)$') {var ($loc,$cmp,$nam) = (last) var $rep{join('|',$loc,$cmp,$nam)} = true } } } elsif !compare('eq',$rep,'None') {if match($rep,'^InsDir:(.*?),Comp:(.*?),Repo:(.*)$') {var ($loc,$cmp,$nam) = (last) var $rep{join('|',$loc,$cmp,$nam)} = true } } } =head1 SEE ALSO L, L =begin credits =over 10 =item RDA 4.16: Greg Cook, Daniel Mortimer, Andrew Salt. =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