# DCinfra.ctl:201:Collects Oracle Fusion Middleware Infrastructure 12c Info. # $Id: DCinfra.ctl,v 1.5 2015/09/25 00:35:35 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/DCinfra.ctl,v 1.5 2015/09/25 00:35:35 RDA Exp $ # # Change History # 20150924 MSC Eliminate trailing spaces. =head1 NAME OFM:DCinfra - Collects Oracle Fusion Middleware Infrastructure 12c Information =head1 DESCRIPTION This module collects Oracle Fusion Middleware Infrastructure 12c-related information. The module covers Oracle Fusion Middleware Infrastructure 12c and later. The following reports can be generated and are regrouped under C: =head1 REPORTS =cut echo tput('bold'),'Processing OFM.INFRA module ...',tput('off') # Initialization var $ORACLE_HOME = ${D_ORACLE_HOME/P:''} var $TAIL = ${DFT.N_TAIL:1000} var $TOC = '%TOC%' var $TOP = '[[#Top][Back to top]]' pretoc '1:Infrastructure 12c' # Load the common macros run DB:DBinfo() run RDA:INVinfo() run RDA:library() =head1 ORACLE HOME COLLECTIONS =head2 abbr - Abbreviations Displays the RDA abbreviations defined for the Oracle Fusion Middleware Infrastructure home collection. =cut debug ' Inside INFRA module, collecting defined abbreviations' report abbr prefix {write '---+ Oracle Fusion Middleware Infrastructure Home Abbreviations' write '|*Abbreviation*|*Location*|' } var %hsh = getSymbols() loop $key (keys(%hsh)) write '|',$key,' |',$hsh{$key},' |' if isCreated(true) toc '2:[[',getFile(),'][rda_report][Abbreviations]]' =head2 rep_info - Repository Information Collects the repository information from the Oracle Fusion Middleware Infrastructure database. =cut if ${I_DB} {# Set the database context call setDbTarget(last) # Collect the repository information debug ' Inside INFRA module, gathering the repository information' report rep_info if testDb() {echo '' echo tput('bold'),'The database is not accessible.',tput('off') if getDbMessage() {echo last write '---+ Oracle Fusion Middleware Infrastructure Repository Information' write 'Database not accessible (',getDbMessage(),')' toc '2:[[',getFile(),'][rda_report][Repository Information]]' } echo '' } else {var $TTL = '---+!! Oracle Fusion Middleware Infrastructure Repository \ Information' var @TTL = ('',\ '---+ Schema Users',\ '---+ Schema Registry',\ '---+ SOAINFRA Cube') var @HDR = ('',\ '|*User Name*|*Created*|',\ '|*Component Id*|*Component Name*|*Version*|*Status*|\ *Upgraded*|',\ '|*Composite Name*|*Component Name*|*Component Type*|*State*|\ *No of Cube Inst*|') set $sql {# SQL1 "SELECT '|' || " username || ' |' || " created || ' |' " FROM all_users " WHERE username LIKE '%_MDS' " OR username LIKE '%_IAU' " OR username LIKE '%_IAU_%' " OR username LIKE '%_WLS' " OR username LIKE '%_STB' " OR username LIKE '%_UMS' " OR username LIKE '%_UCSCC' " OR username LIKE '%_OPSS' " OR username LIKE '%_SOAINFRA' " ORDER BY created "/ "# MACRO separator(2) "# SQL2 "SELECT '|' || " comp_id || ' |' || " comp_name || ' |' || " version || ' |' || " status || ' |' || " upgraded || ' |' " FROM schema_version_registry " ORDER BY comp_id,comp_name "/ "# MACRO separator(3) "# SQL3 "SELECT '|' || " composite_name || ' |' || " component_name || ' |' || " componenttype || ' |' || " (CASE WHEN state=1 THEN 'OPEN AND RUNNING' " WHEN state=2 THEN 'OPEN AND SUSPENDED' " WHEN state=3 THEN 'OPEN AND FAULTED' " WHEN state=4 THEN 'CLOSED AND PENDING' " WHEN state=5 THEN 'CLOSED AND COMPLETED' " WHEN state=6 THEN 'CLOSED AND FAULTED' " WHEN state=7 THEN 'CLOSED AND CANCELLED' " WHEN state=8 THEN 'CLOSED AND ABORTED' " WHEN state=9 THEN 'CLOSED AND STALE' " WHEN state=10 THEN 'NON-RECOVERABLE' " ELSE '' END) || ' | ' || " COUNT(*) || '|' " FROM dev.cube_instance " GROUP BY composite_name,component_name,componenttype,state " ORDER BY COUNT(*) DESC "/ } call separator(1) call writeDb($sql) call separator(0,'Repository Information') } } =head2 product_info - Product Information Gathers the product information. =cut if ?testDir('d',catDir($ORACLE_HOME,'inventory')) {debug ' Inside INFRA module, getting product information (can take time)' report product_info title '---+!! Product Information' title '---## From ',encode($ORACLE_HOME),' ' title $TOC prefix write '---+ Files in Infrastructure Oracle Home' call statDir('an',$ORACLE_HOME) if hasOutput(true) write $TOP call inventory_details(lastDir(),true) if isCreated() toc '2:[[',getFile(),'][rda_report][Product Information]]' } =head2 Configuration Files Gathers the Oracle Fusion Middleware Infrastructure configuration files. =cut debug ' Inside INFRA module, gathering configuration files' pretoc '2:Configuration Files' var $dir = catDir($ORACLE_HOME,'oracle_common') call sort_files(3,0,\ grepDir(catDir($dir,'rcu','config'),'\.(properties|xml)$','np'),\ grepDir(catDir($dir,'rcu','integration','iau'),'\.xml$','np'),\ grepDir(catDir($dir,'rcu','integration','opss'),'\.xml$','np')) unpretoc =head2 Log Files Gathers the Oracle Fusion Middleware Infrastructure log files. =cut debug ' Inside INFRA module, gathering log files' pretoc '2:Log Files' var @tbl = () loop $pth (findDir(catDir($dir,'rcu','log'),'^logdir\.','np')) call push(@tbl,grepDir($pth,'\.log$','np')) call sort_files(3,$TAIL,@tbl) unpretoc =head1 ORACLE WEBLOGIC SERVER DOMAIN COLLECTIONS It includes all reports produced by the L module for the specified Oracle WebLogic Server domains. =cut # Analyze the domain requests var %tbl = () loop $req (${CUR.O_SETUP}->search('^WREQ_OFM_INFRA_DOM')) {var $dom = $req->get_first('I_DOMAIN') if ?$dom->get_first('I_WL_HOME') var $tbl{last->get_oid,$req->get_oid} = $dom->get_first('T_DOMAIN_NAME') else var $tbl{'WH',$req->get_oid} = $dom->get_first('T_DOMAIN_NAME') } # Include the table of content files produced by WREQ loop $oid (keys(%tbl)) {if $orp = compare('eq',$oid,'WH') toc '%PUSH("0: * Orphan Domains")%' toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:Oracle WebLogic Server Overview")%' toc '%INCLUDE("OFM_WREQ_OFM_INFRA_',$oid,'_TF.toc")%' toc '%POP2%' loop $tid (keys($tbl = $tbl{$oid})) {toc '%PUSH("%SPLIT%")%' toc '%PUSH("1+:',"'",$tbl->{$tid},"'",' Domain")%' toc '%INCLUDE("OFM_',$tid,'_TF.toc")%' toc '%POP2%' } if $orp toc '%POP%' } unpretoc =head1 SEE ALSO L, L, L, L =begin credits =over 10 =item RDA 8.04: Daniel Mortimer. =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