# S370SOA.def: Collects Oracle SOA Information # $Id: S370SOA.def,v 1.5 2009/08/05 12:43:47 mschenke Exp $ # ARCS: $Header: /u02/webapps/workbench/cvs/RDA_4/src/scripting/lib/modules/S370SOA.def,v 1.5 2009/08/05 12:43:47 mschenke Exp $ # # Change History # 20090731 KRA Improve AS 11g SOA install inventory finding. =head1 NAME S370SOA - Collects Oracle SOA 11g Information =head1 DESCRIPTION This module collects diagnostic information for Oracle SOA 11g or later. The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing SOA module ...',tput('off') # Initialization var $DOMAIN = catDir(getSetting('WLS_DOMAIN','')) var $ORACLE_HOME = catDir(getSetting('SOA_ORACLE_HOME','')) var $SOA_AUTO = getSetting('SOA_DB_AUTO',1) var $SOA_JDK = catDir(getSetting('SOA_JDK',catDir($ORACLE_HOME,'jdk'))) var $SOA_LOCAL = getSetting('SOA_LOCAL') var $TAIL = getSetting('RDA_TAIL',1000) var $CFGTOOLLOGS_HOME = catDir($ORACLE_HOME,'cfgtoollogs') var $CLONE_HOME = catDir($ORACLE_HOME,'clone') var $INSTALL_HOME = catDir($ORACLE_HOME,'install') var $SYSMAN_HOME = catDir($ORACLE_HOME,'sysman') var $OH = quote($ORACLE_HOME) var $OH1 = concat('^',$OH,'[\\\/]') var $OH2 = concat('^',$OH,'\b') var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle SOA' # Load the common macros run DBinfo() run INSTinfo() run library() =head1 ORACLE HOME COLLECTIONS =head2 error - SOA Error Indicates that the specified Oracle home does not contain Oracle SOA information. =cut # Indicate SOA error macro dsp_error {echo ' Error: The specified Oracle home does not contain SOA information' report error write '** Error: The specified Oracle home does not contain files related to \ Oracle SOA 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][SOA 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 SOA Suite 11g|\ SOA 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,'soa')) call dsp_error() } =head2 rep_info - Repository Information Collects the repository information from the Oracle SOA 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('SOA_SYSDBA')) var $env = cond(getSetting('SOA_SWITCH'),setSqlSid($sid)) var $try = setSqlFailure(0) # Test the database connection call testSql() # Return the previous context return (true,$old,$env,$try) } # Get the SID from config file var $flg = false var $usr = uc(getSetting('SOA_LOGIN','SYSTEM')) if $SOA_AUTO {# Get the database connection details var $sid = undef loop $fil (catFile($DOMAIN,'config','jdbc','mds-owsm-jdbc.xml'),\ catFile($DOMAIN,'config','jdbc','OraSDPMDataSource-jdbc.xml'),\ catFile($DOMAIN,'config','jdbc','SOADataSource-jdbc.xml')) {next !testFile('r',$fil) var $top = xmlLoadFile($fil) if xmlFind($top,'jdbc-data-source/jdbc-driver-params') {var ($xml) = (last) if xmlFind($xml,'properties/property/value') {next !match(xmlData(last),concat('^',quote($usr),'$'),true) var $sid = replace(xmlData(xmlFind($xml,'url')),'^.*@') if match($sid,'^[\w\-\.]+:{1}\d+/{1}.*$') {# Pattern for service name, eg: hostname:port/service var $sid = replace($sid,'/','::') } elsif match($sid,'ldap',true) {echo tput('reverse'),'Warning:' echo "RDA does not support database connection using LDAP. Run the setup \ again in\012advanced mode to provide the connection details. You \ can use the\012following command:" echo ' -SCRP -p advanced SOA',tput('off') var ($SOA_LOCAL,$flg) = (true) break } var ($flg,$old,$env,$try) = set_db($usr,$sid) break } } } } elsif $SOA_LOCAL var $flg = true elsif getSetting('SOA_SID') var ($flg,$old,$env,$try) = set_db($usr,last) else var ($SOA_LOCAL,$flg) = (true) # Collect the repository information if $flg {debug ' Inside SOA module, gathering the repository information' report rep_info var $TTL = '---+!! SOA Repository Information' var @DBG = ('',\ ' - Getting tablespace information',\ concat(' - Getting free space in default tablespaces for ',$usr),\ concat(' - Getting extents of default tablespaces for ',$usr),\ concat(' - Getting total number of invalid objects for ',$usr),\ concat(' - Getting list of invalid objects for ',$usr),\ ' - Getting total number of rows in Cube_Instance table',\ ' - Getting total number of rows in Cube_Scope table',\ ' - Getting total number of rows in Dlv_Message table',\ ' - Getting total number of rows in Dlv_Subscription table',\ ' - Getting total number of rows in Audit_Trail table',\ ' - Getting total number of rows in Audit_Details table',\ ' - Getting total number of rows in Test_Details table',\ ' - Getting total number of rows in Document_Ci_Ref table',\ ' - Getting total number of rows in Native_Correlation table',\ ' - Getting total number of rows in Xml_Document table',\ ' - Getting total number of rows in Attachment table',\ ' - Getting total number of rows in Attachment_Ref table',\ ' - Getting total number of rows in Ci_Indexes table') var @TTL = ('',\ '---+ Tablespace Information',\ concat('---+ Free Space in Default Tablespaces for ',$usr),\ concat('---+ Extents of Default Tablespaces for ',$usr),\ concat('---+ Total Number of Invalid Objects for ',$usr),\ concat('---+ List of Invalid Objects for ',$usr),\ '---+ Number of Rows in Cube_Instance Table',\ '---+ Number of Rows in Cube_Scope Table',\ '---+ Number of Rows in Dlv_Message Table',\ '---+ Number of Rows in Dlv_Subscription Table',\ '---+ Number of Rows in Audit_Trail Table',\ '---+ Number of Rows in Audit_Details Table',\ '---+ Number of Rows in Test_Details Table',\ '---+ Number of Rows in Document_Ci_Ref Table',\ '---+ Number of Rows in Native_Correlation Table',\ '---+ Number of Rows in Xml_Document Table',\ '---+ Number of Rows in Attachment Table',\ '---+ Number of Rows in Attachment_Ref Table',\ '---+ Number of Rows in Ci_Indexes Table') var @HDR = ('',\ '|*Username*|*Created*|*Default Tablespace*|*Temp Tablespace*|',\ '|*Default Tablespace*|*Free Tablespace (MiB)*|',\ '|*Tablespace Name*|*Initial Extent*|*Next Extent*|*Pct Increase*|\ *Allocation Type*|*Segment Space Management*|\ *Extent Management*|',\ '| *Count*|',\ '|*Owner*|*Object Name*|*Object Type*|*Status*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|',\ '| *Count*|') set $sql {SELECT '|' || " username || ' |' || " TO_CHAR(created,'DD-Mon-YYYY HH24:MI:SS') || ' |' || " default_tablespace || ' |' || " temporary_tablespace || ' |' " FROM dba_users " WHERE username = ':1'; "PROMPT ___Macro_separator(2)___ "SELECT '|' || " tablespace_name || ' | ' || " SUM(bytes) / 1048576 || '|' " FROM dba_free_space " WHERE tablespace_name IN ( " SELECT default_tablespace " FROM dba_users " WHERE username = ':1') " GROUP BY tablespace_name " ORDER BY tablespace_name; "PROMPT ___Macro_separator(3)___ "SELECT '|' || " tablespace_name || ' | ' || " initial_extent || '| ' || " next_extent || '| ' || " pct_increase || '|' || " allocation_type || ' |' || " segment_space_management || ' |' || " extent_management || ' |' " FROM dba_tablespaces " WHERE tablespace_name IN ( " SELECT default_tablespace " FROM dba_users " WHERE username = ':1') " ORDER BY tablespace_name; "PROMPT ___Macro_separator(4)___ "SELECT '| ' || " COUNT(*) || '|' " FROM all_objects " WHERE status = 'INVALID' " AND owner = ':1'; "PROMPT ___Macro_separator(5)___ "SELECT '|' || " owner || ' |' || " object_name || ' |' || " object_type || ' |' || " status || ' |' " FROM all_objects " WHERE status = 'INVALID' " AND owner = ':1'; "PROMPT ___Macro_separator(6)___ "SELECT '| ' || " COUNT(*) || '|' " FROM cube_instance; "PROMPT ___Macro_separator(7)___ "SELECT '| ' || " COUNT(*) || '|' " FROM cube_scope; "PROMPT ___Macro_separator(8)___ "SELECT '| ' || " COUNT(*) || '|' " FROM dlv_message; "PROMPT ___Macro_separator(9)___ "SELECT '| ' || " COUNT(*) || '|' " FROM dlv_subscription; "PROMPT ___Macro_separator(10)___ "SELECT '| ' || " COUNT(*) || '|' " FROM audit_trail; "PROMPT ___Macro_separator(11)___ "SELECT '| ' || " COUNT(*) || '|' " FROM audit_details; "PROMPT ___Macro_separator(12)___ "SELECT '| ' || " COUNT(*) || '|' " FROM test_details; "PROMPT ___Macro_separator(13)___ "SELECT '| ' || " COUNT(*) || '|' " FROM document_ci_ref; "PROMPT ___Macro_separator(14)___ "SELECT '| ' || " COUNT(*) || '|' " FROM native_correlation; "PROMPT ___Macro_separator(15)___ "SELECT '| ' || " COUNT(*) || '|' " FROM xml_document; "PROMPT ___Macro_separator(16)___ "SELECT '| ' || " COUNT(*) || '|' " FROM attachment; "PROMPT ___Macro_separator(17)___ "SELECT '| ' || " COUNT(*) || '|' " FROM attachment_ref; "PROMPT ___Macro_separator(18)___ "SELECT '| ' || " COUNT(*) || '|' " FROM ci_indexes; } call separator(1) call writeSql(bindSql($sql,$usr)) call separator(0,'Repository Information') } # Restore the previous context if !$SOA_LOCAL {if defined($env) call setSqlSid($env) call setSqlLogin($old) call setSqlFailure($try) } =head2 Install and Configuration Gathers the Oracle Application Server configuration and installation files. =cut debug ' Inside SOA 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($CLONE_HOME,'\.log','dir'),\ grepDir($INSTALL_HOME,'\.(ini|log)','dir')) unpretoc if testDir('d',catDir($ORACLE_HOME,'diagnostics')) {debug ' Inside SOA module, gathering diagnostics information' pretoc '2:Diagnostics' call sort_files(3,$TAIL,\ grepDir(lastDir(),'\.((conf|ini|xml|properties|err)$|log)|\~','dir')) unpretoc } =head2 product_info - SOA Product Information Gathers the product information if Oracle SOA is installed in a separate Oracle home. =cut if getSetting('SOA_DISTINCT_HOME') {debug ' Inside SOA module, processing Product Information (can take time)' report product_info write '---+!! SOA Oracle Home Product Information' write $TOC write '---+ Files in SOA Oracle Home' call statDir('an',$ORACLE_HOME) write $TOP var $fil = catFile($ORACLE_HOME,'inventory','ContentsXML','comps.xml') if testFile('fr',$fil) call inventory_details($fil,getSetting('SOA_INTERIM')) toc '2:[[',getFile(),'][rda_report][SOA Product Information]]' } =head2 jdk_info - JDK Information Checks for the available JDK and reports its version. =cut debug ' Inside SOA module, gathering jar files' report jdk_info prefix {write '---+!! JDK Information' write $TOC } var @tbl = grepDir($SOA_JDK,'^java(\.exe)?$','inr') loop $cmd (@tbl) {if testFile('fx',$cmd) {write '---++ JDK Location: ',encode(replace($cmd,$OH2,'$OH')) 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 JDK found.**' } 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 SOA 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,$OH2) write '---++ ',encode(replace($jar,$OH2,'$OH')) 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]]' =head2 SYSMAN Gathers SYSMAN information. =cut debug ' Inside SOA module, gathering SYSMAN information' pretoc '2:SYSMAN' call sort_files(3,$TAIL,grepDir($SYSMAN_HOME,'\.(log|properties|xml)','inr'),\ grepDir(catDir($SYSMAN_HOME,'config'),'^[^\.]','pn'),\ grepDir(catDir($SYSMAN_HOME,'log'),'^[^\.]','pn')) unpretoc 2 =head1 SEE ALSO L, L, L =begin credits =over 10 =item RDA 4.14: Greg Cook, Andrew Salt. =back =end credits =head1 COPYRIGHT NOTICE Copyright (c) 2002-2009, Oracle. All rights reserved. =head1 TRADEMARK NOTICE Oracle, JD Edwards, PeopleSoft, and Siebel are registered trademarks of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. =cut