# S328WC.def: Collects Oracle WebCenter Suite Information # $Id: S328WC.def,v 2.12 2012/08/29 13:51:19 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/S328WC.def,v 2.12 2012/08/29 13:51:19 mschenke Exp $ # # Change History # 20120828 KRA Extend installation type detection. =head1 NAME S328WC - Collects Oracle WebCenter Suite 11g Information =head1 DESCRIPTION This module collects diagnostic information for Oracle WebCenter Suite 11g or later. The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing WC module ...',tput('off') # Initialization var $AGE = getSetting('WC_LOG_AGE',5) var $DOMAIN = getSetting('WC_DOM_REQ_DOMAIN','') var $ORACLE_HOME = getSetting('WC_ORACLE_HOME','') var $TAIL = getSetting('RDA_TAIL',1000) var $WC_AUTO = getSetting('WC_DB_AUTO',1) var $WC_JDK = getSetting('WC_JDK',catDir($ORACLE_HOME,'jdk')) var $WC_LOCAL = getSetting('WC_LOCAL') var $CFGTOOLLOGS_HOME = catDir($ORACLE_HOME,'cfgtoollogs') var $INSTALL_HOME = catDir($ORACLE_HOME,'install') var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle WebCenter Suite' # Load the common macros run DBinfo() run INSTinfo() run library() run WLSlib() # Set the current target call setCurrent(addTarget('OH_WC',{ORACLE_HOME=>$ORACLE_HOME})) =head1 ORACLE HOME COLLECTIONS =head2 abbr - Abbreviations Displays the RDA abbreviations defined for the Oracle home collection. =cut debug ' Inside WC module, collecting defined abbreviations' report abbr prefix {write '---+ Oracle Home Abbreviations' write '|*Abbreviation*|*Location*|' } var %hsh = getSymbols() loop $key (keys(%hsh)) write '|',$key,' |',catDir(@{$hsh{$key}}),' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Abbreviations]]' =head2 error - WebCenter Error Indicates that the specified Oracle home does not contain Oracle WebCenter Suite information. =cut # Indicate WebCenter error macro dsp_error {echo ' Error: The specified Oracle home does not contain WebCenter \ information' report error write '** Error: The specified Oracle home does not contain files related to \ Oracle WebCenter 11g or later.**%BR%' write '%BR%' if @arg {write '|*Oracle Home*|',encode($arg[0]),' |' write '|*Install Name*|',$arg[1],' |' write '|*Install Version*|',$arg[2],' |' } toc '2:[[',getFile(),'][rda_report][WebCenter Error]]' } # Validate the profile type var $flg = true var $fil = catFile($ORACLE_HOME,'inventory','ContentsXML','comps.xml') if testFile('fr',$fil) {if xmlFind(xmlLoadFile($fil),'PRD_LIST/TL_LIST/COMP') {var ($xml) = (last) var $ver = xmlValue($xml,'VER') var $dsc = xmlData(xmlFind($xml,'EXT_NAME')) if !and(match($dsc,'^(Oracle WebCenter Portal Suite 11g|\ Oracle WebCenter Suite 11g|\ Webcenter Application Server 11g)',true),\ match($ver,'^11\.')) {call dsp_error($ORACLE_HOME,$dsc,$ver) var $flg = false } } } if $flg {if !testDir('d',catDir($ORACLE_HOME,'webcenter')) call dsp_error() } =head2 rep_info - Repository Information Collects the repository information from the Oracle WebCenter Suite database. =cut # Define a database connection macro macro set_db {var ($usr,$sid) = @arg # Determine the user password if compare('eq',$usr,'/') var ($usr,$pwd) = ('','') elsif hasSqlPassword($usr,$sid) var $pwd = undef else var $pwd = askPassword(concat('Enter ',$usr,'@',$sid,' user password:')) # Change the database context var $old = setSqlLogin($usr,$pwd,$sid,getSetting('WC_SYSDBA')) var $env = cond(getSetting('WC_SWITCH'),setSqlSid($sid)) var $try = setSqlFailure(0) # Test the database connection if testSql() return (false,$old,$env,$try) else return (true,$old,$env,$try) } # Get the SID from config file var $flg = false if $WC_AUTO {# Get the database connection details var $sid = undef var $fil = first(grepDir(\ catDir($DOMAIN,'config','jdbc'),'WebCenterDS-.*-jdbc\.xml$','fip')) if testFile('r',$fil) {var $top = xmlLoadFile($fil) if xmlFind($top,'jdbc-data-source/jdbc-driver-params') {var ($xml) = (last) if xmlFind($xml,'properties/property|name *="^user$"') {var $usr = xmlData(xmlFind(last,'value')) var $sid = field('@',1,xmlData(xmlFind($xml,'url'))) if match($sid,'^[\w\-\.]+:\d+\/') {# Pattern for service name, eg: hostname:port/service var $sid = replace($sid,'/','::') var ($flg,$old,$env,$try) = set_db($usr,$sid) } elsif match($sid,'ldap',true) {echo tput('reverse'),'Warning:' echo "RDA does not support database connection using LDAP. Run the setup \ again in advanced mode to provide the connection details." echo tput('off') var ($WC_LOCAL,$flg) = (true) } } } } } elsif $WC_LOCAL var $flg = true elsif getSetting('WC_SID') {var ($sid) = last var $usr = uc(getSetting('WC_LOGIN','SYSTEM')) var ($flg,$old,$env,$try) = set_db($usr,$sid) } else var ($WC_LOCAL,$flg) = (true) # Collect the repository information if $flg {debug ' Inside WC module, gathering the repository information' report rep_info var $TTL = '---+!! Oracle WebCenter Repository Information' var @TTL = ('',\ '---+ Version',\ '---+ Version Registry') var @HDR = ('',\ '|*Version*|*Label*|*DB Platform*|',\ '|*Component Id*|*Component Name*|*MRC Name*|*MR Name*|*MR Type*|\ *Owner*|*Version*|*Status*|*Upgraded*|*Start Time*|*Modified*|') set $sql {SELECT '|' || " version || ' |' || " label || ' |' || " db_platform || ' |' " FROM wc_repository_version; "PROMPT ___Macro_separator(2)___ "SELECT '|' || " comp_id || ' |' || " comp_name || ' |' || " mrc_name || ' |' || " mr_name || ' |' || " mr_type || ' |' || " owner || ' |' || " version || ' |' || " status || ' |' || " upgraded || ' |' || " start_time || ' |' || " modified || ' |' " FROM schema_version_registry; } call separator(1) call writeSql($sql) call separator(0,'Repository Information') } # Restore the previous context if !$WC_LOCAL {if defined($env) call setSqlSid($env) call setSqlLogin($old) call setSqlFailure($try) } =head2 product_info - Product Information Gathers the product information if Oracle WebCenter Suite is installed in a separate Oracle home. =cut if getSetting('WC_DISTINCT_HOME') {debug ' Inside WC module, processing Product Information (can take time)' report product_info write '---+!! WebCenter Oracle Home Product Information' write $TOC write '---+ Files in WebCenter Oracle Home' call statDir('an',$ORACLE_HOME) write $TOP call inventory_details(catDir($ORACLE_HOME,'inventory'),\ getSetting('WC_INTERIM')) toc '2:[[',getFile(),'][rda_report][Product Information]]' } =head2 Install and Configuration Gathers the Oracle Fusion Middleware configuration and installation files. =cut debug ' Inside WC module, gathering installation and configuration information' pretoc '2:Installation and Configuration' call sort_files(3,$TAIL,\ grepDir($CFGTOOLLOGS_HOME,'\.(ini|log|properties|xml)','dir'),\ grepDir($INSTALL_HOME,'\.(ini|log)','dir')) unpretoc if testDir('d',catDir($ORACLE_HOME,'diagnostics')) {debug ' Inside WC module, gathering diagnostics information' pretoc '2:Diagnostics' call sort_files(3,$TAIL,\ grepDir(lastDir(),'\.((conf|ini|xml|properties|err)$|log)|\~','dir')) unpretoc } =head2 Manifest Information Gathers the Oracle home manifest information. =cut debug ' Inside WC module, getting Oracle home manifest information \ (can take time)' pretoc '2:Manifest Information' call dsp_manifest(3,$ORACLE_HOME) unpretoc =head2 Extended Spaces Information Gathers the Extended Spaces manifest information. =cut debug ' Inside WC module, getting Extended Spaces manifest information' pretoc '2:Extended Spaces Information' pretoc '3:Manifest Information' call dsp_manifest(4,\ [catFile($ORACLE_HOME,'archives','applications','webcenter.ear')]) unpretoc 2 =head2 jdk_info - JDK Information Checks for the available Java Development Kit and reports its version. =cut debug ' Inside WC module, gathering jar files' report jdk_info prefix {write '---+!! JDK Information' write $TOC } var @tbl = grepDir($WC_JDK,'^java(\.exe)?$','inr') loop $cmd (@tbl) {if testFile('fx',$cmd) {write '---++ JDK Location: ',encode(catSymbol($cmd)) call statFile('p',$cmd) var $cmd = quote($cmd,'x') write '---++++!! JDK Version' call writeCommand(concat($cmd,' -version 2>&1')) write '---++++!! JDK Full Version' call writeCommand(concat($cmd,' -fullversion 2>&1')) write $TOP } } if !hasOutput(true) {write '---+ JDK information' write '**No java executable found inside the JDK directory structure.**' } toc '2:[[',getFile(),'][rda_report][JDK Information]]' =head2 jdk_libs - Java Libs Gathers information about all C<*.jar> files located in the common directory. For each Jar file, the report collects file information and the output from C. =cut debug ' Inside WC module, gathering Java libs information' report java_libs prefix {write '---+!! Information about Java Libs' write '%TOC3-2%' } var $cmd = findCommand('cksum') loop $jar (grepDir(catDir($ORACLE_HOME,'j2ee','home'),'\.jar$','inr'),\ grepDir(catDir($ORACLE_HOME,'jlib'),'\.jar$','inr'),\ grepDir(catDir($ORACLE_HOME,'lib'),'\.jar$','inr'),\ grepDir(catDir($ORACLE_HOME,'jdbc','lib'),'\.(jar|zip)$','dir')) {if testFile('f',$jar) {if match($jar,concat('^',quote($ORACLE_HOME),'\b')) write '---++ ',encode(catSymbol($jar)) else write '---++ ',encode($jar) call statFile('p',$jar) if $cmd {write '---++++!! cksum: (checksum size filename)' call writeCommand(concat($cmd,' ',quote($jar,'x'))) } write $TOP } } if isCreated(true) toc '2:[[',getFile(),'][rda_report][Java Libs]]' =head1 UNIVERSAL CONTENT MANAGEMENT COLLECTIONS =head2 Configuration Files Collects Content Server-related configuration files from a Oracle WebCenter Suite 11g installation. =cut if testDir('d',catDir($ORACLE_HOME,'ucm')) {debug ' Inside WC module, collecting UCM-related configuration files' pretoc '2:Universal Content Management' pretoc '3:Configuration Files' call sort_files(4,0,\ catFile($ORACLE_HOME,'ucm','admin','bin','intradoc.cfg'),\ catFile($ORACLE_HOME,'ucm','admin','config','config.cfg'),\ catFile($ORACLE_HOME,'ucm','bin','intradoc.cfg'),\ catFile($ORACLE_HOME,'ucm','config','config.cfg'),\ catFile($ORACLE_HOME,'ucm','config','jps-config.xml'),\ catFile($ORACLE_HOME,'ucm','config','license.cfg'),\ catFile($ORACLE_HOME,'ucm','config','system-jazn-data.xml')) unpretoc =head2 Log Files Collects Content Server-related log files from a Oracle WebCenter Suite 11g installation. =cut debug ' Inside WC module, collecting UCM-related log files' pretoc '3:Log Files' call sort_files(4,$TAIL,\ catFile($ORACLE_HOME,'ucm','etc','idcServerNT.log'),\ catFile($ORACLE_HOME,'ucm','etc','history'),\ catFile($ORACLE_HOME,'ucm','etc','log'),\ catFile($ORACLE_HOME,'ucm','etc','pid'),\ grepDir(catDir($ORACLE_HOME,'ucm','weblayout','groups','secure','logs'),\ '\.htm$',concat('dirm',$AGE))) unpretoc 2 } =head1 COMMON HOME INFORMATION Includes the reports generated by the IREQ module about the common home. =cut toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Common Product Home")%' toc '%INCLUDE("',${CUR.GROUP},'_IREQ_WC_CH.toc")%' toc '%POP2%' =head1 ORACLE WEBLOGIC SERVER DOMAIN COLLECTIONS Includes all reports collected for the specified Oracle WebLogic Server domain. =cut toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Oracle WebLogic Server Overview")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_WC_TOP.toc")%' toc '%POP2%' toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Oracle WebLogic Server Domain")%' toc '%INCLUDE("',${CUR.GROUP},'_WREQ_WC_DOM.toc")%' toc '%POP2%' unpretoc # Restore the default target call setCurrent() =head1 SEE ALSO L, L, L, L, L, L =begin credits =over 10 =item RDA 4.14: Greg Cook, Andrew Salt. =item RDA 4.21: Pramod Vasista. =item RDA 4.23: Pramod Vasista. =item RDA 4.24: Greg Cook, Andrew Salt. =item RDA 4.26: Pramod Vasista. =item RDA 4.29: Meraj Mohammed. =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