# DCowsm.ctl:372:Collects Oracle Web Services Manager Information # $Id: DCowsm.ctl,v 1.8 2015/07/03 12:04:44 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/DCowsm.ctl,v 1.8 2015/07/03 12:04:44 RDA Exp $ # # Change History # 20150703 MSC Improve the documentation. =head1 NAME OFM:DCowsm - Collects Oracle Web Services Manager Information =head1 DESCRIPTION This module collects the Oracle Web Services Manager-related information. The following reports can be generated and are regrouped under C: =cut echo tput('bold'),'Processing OFM.OWSM module ...',tput('off') # Initialization var $ORACLE_HOME = ${D_ORACLE_HOME/P:''} if ?testFile('f',catFile($ORACLE_HOME,upDir(),'registry.xml')) var $OFM11 = true var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Oracle Web Services Manager' =head2 rep_info - Repository Information Collects the repository information from the Oracle Web Services Manager database. =cut # Set the database context call setSqlTarget(${I_DB}) # Test the database connection debug ' Inside OWSM module, gathering the repository information' report rep_info if testSql() {echo '' echo tput('bold'),'The schema containing the OWSM repository is not \ accessible.',tput('off') echo tput('bold'),'Therefore RDA cannot collect repository information.',\ tput('off') if getSqlMessage() {echo last write '---+ Oracle Web Services Manager Repository Information' write 'Database not accessible (',getSqlMessage(),')' toc '2:[[',getFile(),'][rda_report][Repository Information]]' } echo '' } elsif ?$OFM11 {prefix {write '---+!! Oracle Web Services Manager Repository Information' write $TOC write '---+ Version Registry' write '|*Component Id*|*Component Name*|*Version*|*Status*|*Upgraded*|' } set $sql {SELECT '|' || " comp_id || ' |' || " comp_name || ' |' || " version || ' |' || " status || ' |' || " upgraded || ' |' " FROM schema_version_registry; } call writeSql($sql) if isCreated(true) toc '2:[[',getFile(),'][rda_report][Repository Information]]' } else {var $TTL = '---+!! Oracle Web Services Manager Repository Information' var @DBG = ('',\ ' - Getting tablespace information',\ ' - Getting free space in default tablespaces for ORAWSM',\ ' - Getting extents of default tablespaces for ORAWSM',\ ' - Getting total number of invalid objects for ORAWSM',\ ' - Getting list of invalid objects for ORAWSM',\ ' - Getting total number of rows in Policy_Manager_Objects \ table',\ ' - Getting total number of rows in Messagelogs table',\ ' - Getting total number of rows in Log_Objects table',\ ' - Getting total number of rows in Policy_Set table',\ ' - Getting total number of rows in Policies table',\ ' - Getting total number of rows in Pipelines table',\ ' - Getting total number of rows in Policy_Set_Objects table',\ ' - Getting list of objects for ORAWSM') var @TTL = ('',\ '---+ Tablespace Information',\ '---+ Free Space in Default Tablespaces for ORAWSM',\ '---+ Extents of Default Tablespaces for ORAWSM',\ '---+ Total Number of Invalid Objects for ORAWSM',\ '---+ List of Invalid Objects for ORAWSM',\ '---+ Number of Rows in Policy_Manager_Objects Table',\ '---+ Number of Rows in Messagelogs Table',\ '---+ Number of Rows in Log_Objects Table',\ '---+ Number of Rows in Policy_Set Table',\ '---+ Number of Rows in Policies Table',\ '---+ Number of Rows in Pipelines Table',\ '---+ Number of Rows in Policy_Set_Objects Table',\ '---+ List of Objects for ORAWSM') 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*|',\ '|*Object Type*|*Object Name*|*Status*|') set $sql {SELECT '|' || " username || ' |' || " TO_CHAR(created,'DD-Mon-YYYY HH24:MI:SS') || ' |' || " default_tablespace || ' |' || " temporary_tablespace || ' |' " FROM dba_users " WHERE username = 'ORAWSM'; "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 = 'ORAWSM') " 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 = 'ORAWSM') " ORDER BY tablespace_name; "PROMPT ___Macro_separator(4)___ "SELECT '| ' || " COUNT(*) || '|' " FROM all_objects " WHERE status = 'INVALID' " AND owner = 'ORAWSM'; "PROMPT ___Macro_separator(5)___ "SELECT '|' || " owner || ' |' || " object_name || ' |' || " object_type || ' |' || " status || ' |' " FROM all_objects " WHERE status = 'INVALID' " AND owner = 'ORAWSM'; "PROMPT ___Macro_separator(6)___ "SELECT '| ' || " COUNT(*) || '|' " FROM policy_manager_objects; "PROMPT ___Macro_separator(7)___ "SELECT '| ' || " COUNT(*) || '|' " FROM messagelogs; "PROMPT ___Macro_separator(8)___ "SELECT '| ' || " COUNT(*) || '|' " FROM log_objects; "PROMPT ___Macro_separator(9)___ "SELECT '| ' || " COUNT(*) || '|' " FROM policy_set; "PROMPT ___Macro_separator(10)___ "SELECT '| ' || " COUNT(*) || '|' " FROM policies; "PROMPT ___Macro_separator(11)___ "SELECT '| ' || " COUNT(*) || '|' " FROM pipelines; "PROMPT ___Macro_separator(12)___ "SELECT '| ' || " COUNT(*) || '|' " FROM policy_set_objects; "PROMPT ___Macro_separator(13)___ "SELECT '|' || " object_type || ' |' || " object_name || ' |' || " status || ' |' " FROM all_objects " WHERE owner = 'ORAWSM' " ORDER BY object_type,object_name; } call separator(1) call writeSql($sql) call separator(0,'Repository Information') } =for stopwords coresv owsm =head2 coresv - $OH/owsm/lib/coresv*.jar Files Lists the F files present in the F<$ORACLE_HOME/owsm/lib> directory. =cut if !?$OFM11 {# Initialization var $TAIL = ${DFT.N_TAIL:1000} var $OWSM_HOME = catDir($ORACLE_HOME,'owsm') # Load the common macros run DB:DBinfo() run RDA:library() debug ' Inside OWSM module, getting the list of coresv jar files' report coresv prefix write '---+ List of coresv jar files from OH/owsm/lib directory' call statFile('b',\ grepDir(catDir($ORACLE_HOME,'owsm','lib'),'^coresv.*\.jar$','p')) if isCreated(true) toc '2:[[',getFile(),'][rda_report][$OH/owsm/lib/coresv*.jar Files]]' =head2 Configuration Files Gathers Oracle Web Services Manager-related configuration files. =cut debug ' Inside OWSM module, collecting the configuration files' pretoc '2:Configuration Files' call sort_files(3,$TAIL,\ grepDir(catDir($OWSM_HOME,'bin'),\ '(install|coresv|agent|manageUserGroups)\.properties','p'),\ catFile($OWSM_HOME,'config','gateway',\ 'gateway-config-installer.properties'),\ catFile($OWSM_HOME,'config','serveragent',\ 'serveragent-config-installer.properties'),\ grepDir(catDir($OWSM_HOME,'config','ccore'),\ '(ui-config-installer|monitorui-config-installer|\ policyui-config-installer)\.properties','p'),\ grepDir(catDir($OWSM_HOME,'config','coreman'),\ '(collector-config-installer|monitor-config-installer)\ \.properties','p'),\ catFile($OWSM_HOME,'config','clientagent',\ 'clientagent-config-installer.properties'),\ catFile($OWSM_HOME,'config','policymanager',\ 'policymanager-config-installer.properties')) unpretoc =head2 Log Files Gathers Oracle Web Services Manager-related log files. =cut debug ' Inside OWSM module, collecting the log files' pretoc '2:Log Files' # Get the instance list var ($dir,@tbl) = (${GRP.J2EE.D_TOP:catDir($ORACLE_HOME,'j2ee')}) if ?testFile('r',catFile($ORACLE_HOME,'opmn','conf','opmn.xml')) {var $top = xmlLoadFile(last,xmlDisable(xmlParser(),'DR')) loop $xml (xmlFind($top,\ 'opmn/process-manager/ias-instance/ias-component/process-type \ module-id="OC4J"')) call push(@tbl,xmlValue($xml,'id')) } else var @tbl = ('home') # Collect log files loop $ins (@tbl) call sort_files(3,$TAIL,\ grepDir(catDir($dir,$ins,'log'),'^(ccore|coreman|gateway|policymanager|\ serveragent)\.log$','dir')) unpretoc } =head1 COMMON HOME INFORMATION Includes the reports generated by the L module about the common home. =cut else {toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Common Product Home")%' toc '%INCLUDE("OFM_IREQ_OFM_OWSM_CH_TF.toc")%' toc '%POP2%' =head1 ORACLE WEBLOGIC SERVER DOMAIN COLLECTIONS Includes the Oracle WebLogic reports generated by the L module. =cut toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Oracle WebLogic Server Overview")%' toc '%INCLUDE("OFM_WREQ_OFM_OWSM_WH_TF.toc")%' toc '%POP2%' toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Oracle WebLogic Server Domain")%' toc '%INCLUDE("OFM_WREQ_OFM_OWSM_DOM_TF.toc")%' toc '%POP2%' } unpretoc =head1 SEE ALSO L, L, L, L =begin credits =over 10 =item RDA 4.10: Sunil Hingorani, Allan Jackson. =item RDA 4.17: Miguel Hernandez. =item RDA 4.20: Miguel Hernandez. =item RDA 8.00: Yogesh Sontakke. =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