# DCodi.cfg: Collects Oracle Data Integrator Information # $Id: DCodi.cfg,v 1.17 2015/05/09 14:57:40 RDA Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_8/src/scripting/lib/collect/OFM/DCodi.cfg,v 1.17 2015/05/09 14:57:40 RDA Exp $ # # Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. # # Change history # 20150509 MSC Improve description consistency. ############################################################################### # Collect Oracle Data Integrator setup information ############################################################################### #------------------------------------------------------------------------------ # Module definition #------------------------------------------------------------------------------ col=${B_IN_USE} dsc='Collects Oracle Data Integrator Information' man='This module supports Oracle Data Integrator 10.1.3.4 or later only.' pre=RDA:DCbegin req=?B_REQ_WREQ:OFM:DCwreq rpt=B_IN_USE trg=?B_REQ_WREQ:OFM:DCwreq var=not_used # Flow:in_use,B_IN_USE exe=sdcl { "var ${B_REQ_WREQ/T} = undef "var @{AUX.var} = (cond(${PRF.B_TESTS},'in_use','B_IN_USE')) " "macro extract_logins "{var (\@tbl,$fil,$pre) = @arg " var $cnt = 0 " if ?testFile('fr',$fil) " {var $top = xmlLoadFile($fil,xmlDisable(xmlParser(),'BDEPR')) " loop $xml (xmlFind($top,'SnpsLogin/Object')) " {var ($num,$nam) = () " if xmlFind($xml,'Field name="ILogin"') " var $num = sprintf("%s%d",$pre,xmlData(last)) " if xmlFind($xml,'Field name="LoginName"') " var $nam = xmlData(last) " next !and(defined($num),defined($nam)) " call push(@tbl,$num) " var ${T_LOGIN_${VAR.num}/T} = $nam " incr $cnt " } " } " return $cnt "} " "macro grep_login "{var ($dir,$pat) = @arg " var ($off,$usr) = (0) " if ?testFile('f',$fil = catFile($dir,'bin',${AS.BAT:'odiparams'})) " {if match($fil,'\.bat$',true) " {if grepFile($fil,concat('^\s*set ',$pat,'\s*=\s*(.*?)\s*$'),'fi1') " var ($off,$usr) = (2,last) " } " elsif grepFile($fil,concat('^\s*',$pat,'\s*=\s*([\042\047])(.*?)\1'),'fi2') " var ($off,$usr) = (1,last) " elsif grepFile($fil,concat('^\s*',$pat,'\s*=\s*(.*?)\s*$'),'fi1') " var ($off,$usr) = (1,last) " } " return ($off,$usr) "} " "macro is_valid_domain "{var ($nam,$dir) = @arg " require testDir('d',$dir),\ " 'The specified WebLogic Server domain directory does not exist.' " require isAbsolute($dir),\ " 'The specified WebLogic Server domain directory is not an absolute path.' " require grepFile(catFile($dir,'config','config.xml'),\ " '^ "Cannot extract login from 'odiparams.sh'. ${VAR.wrn}",\ " 2 => "Cannot extract login from 'odiparams.bat'. ${VAR.wrn}",\ " 4 => "Cannot extract logins from 'snps_login_security.xml'. ${VAR.wrn}",\ " 5 => "Cannot extract logins from 'odiparams.sh' and \ " 'snps_login_security.xml'. ${VAR.err}",\ " 6 => "Cannot extract logins from 'odiparams.bat' and \ " 'snps_login_security.xml'. ${VAR.err}",\ " 8 => "Cannot extract logins from 'snps_login_work_12.xml' or \ " 'snps_login_work.xml'. ${VAR.wrn}",\ " 9 => "Cannot extract logins from 'odiparams.sh' and \ " 'snps_login_work.xml'. ${VAR.err}",\ " 10 => "Cannot extract logins from 'odiparams.bat' and \ " 'snps_login_work.xml'. ${VAR.err}") "var %STA = (\ " 1 => 1,\ " 2 => 1,\ " 4 => 1,\ " 5 => 2,\ " 6 => 2,\ " 8 => 1,\ " 9 => 2,\ " 10 => 2) "keep %ERR,%STA } #------------------------------------------------------------------------------ # Setting definitions #------------------------------------------------------------------------------ [in_use] typ=B dft=true dsc='Is Oracle Data Integrator information requested?' nam=B_IN_USE var=D_HOME [not_used] typ=B dft=false dsc='Is Oracle Data Integrator information requested?' nam=B_IN_USE [B_IN_USE] typ=B dft=${AUX.B_SELECTED} dsc='Is Oracle Data Integrator information requested?' hlp='Oracle Data Integrator collections can take a long time. Be selective in \ your request to reduce collection time.' inp='Do you want RDA to analyze Oracle Data Integrator (Y/N)?' var=true:D_HOME #------------------------------------------------------------------------------ # Determine ODI home #------------------------------------------------------------------------------ [D_HOME] typ=D dft=${ENV.ODI_HOME} dsc='ODI home directory' err='The directory does not exist' inp='Enter the full path of the ODI home directory' val=E var=exists:chk_install:\ not_used [chk_install] typ=T dft='NOODI' dsc='Check for valid ODI install' nam=- var=ODI11:B_DISTINCT_HOME,chk_home:\ ODI10:search_master:\ NOODI:bad_home,D_HOME exe=sdcl { "keep @itm "var @itm = () "if ?testDir('d',catDir(${D_HOME},'agent','bin')) " call push(@itm,'AGENT','Standalone Agent') "if ?nvl(testDir('d',catDir(${D_HOME},'studio','bin')),\ " testDir('d',catDir(${D_HOME},'client','odi','bin'))) " call push(@itm,'STUDIO','Studio') "if ?testDir('d',catDir(${D_HOME},upDir(),upDir(),'oracle_common')) " call push(@itm,'WLS','J2EE Agent') "elsif ?testDir('d',catDir(${D_HOME},upDir(),'oracle_common')) " call push(@itm,'WLS','J2EE Agent') "elsif ?testDir('d',catDir(${D_HOME},upDir(),upDir(),'utils')) " call push(@itm,'WLS','J2EE Agent') "elsif ?testDir('d',catDir(${D_HOME},upDir(),'utils')) " call push(@itm,'WLS','J2EE Agent') "if @itm " var ${AUX.dft} = 'ODI11' "elsif and(testDir('d',catDir(${D_HOME},'bin')),\ " testDir('d',catDir(${D_HOME},'lib'))) " var ${AUX.dft} = ${W_TYPE:'Oracle ODI installation type'} = 'ODI10' } [bad_home] typ=C dsc='Invalid ODI home directory' inp="${D_HOME} cannot be the ODI home directory.\n" vis=0 #------------------------------------------------------------------------------ # ODI 11g and later specific settings #------------------------------------------------------------------------------ [B_DISTINCT_HOME] typ=B dft=false dsc='Is Oracle Data Integrator installed in another Oracle home?' inp="Is Oracle Data Integrator installed in an Oracle home other than \ '${SET.RDA.BEGIN.D_ORACLE_HOME}' (Y/N)?" var=true:D_ORACLE_HOME,B_INTERIM:\ oracle_home [D_ORACLE_HOME] typ=D dsc='Data Integrator Oracle home' err='Warning: The specified directory does not -yet- exist' inp='Enter the Data Integrator Oracle home to be analyzed' val=W [B_INTERIM] typ=B dft=false dsc='Collect the file/directory list for the interim patches' inp='Do you want to collect the file and directory list for the interim \ patches in inventory (Y/N)?' lvl=6 [oracle_home] typ=D dft=${SET.RDA.BEGIN.D_ORACLE_HOME} dsc='Data Integrator Oracle home' nam=D_ORACLE_HOME [chk_home] typ=D alt=comment,not_used dft=(catDir(${D_ORACLE_HOME},'odi'),\ catDir(${D_ORACLE_HOME},'oracledi')) dsc='Oracle Data Integrator home' nam=- var=W_TYPE,B_HCVE_CHECKS [comment] typ=C dsc='Report bad Data Integrator Oracle home' inp="The specified Oracle Data Integrator directory does not exist or does \ not contain some related files. The collection is disabled.\n\n\ Hit 'Return' to continue" [W_TYPE] typ=M ask=false bef='Oracle Data Integrator installation type:' cas=false dft='^' dsc='Oracle ODI installation type' err='Not a valid menu item' inp='Select the installation type' itm=[@itm] syn=('AGENT'=>'A','STUDIO'=>'S','WLS'=>'W') val=E var=AGENT:search_master:\ STUDIO:search_work,decode_work_studio:\ WLS:D_DOMAIN_HOME,B_MASTER_DB_MSTR,B_WORK_DB_WORK [B_HCVE_CHECKS] typ=B dft=${PRF.B_HCVE_CHECKS} dsc='Are Oracle Fusion Middleware preinstallation checks requested?' inp='Do you want RDA to execute Oracle Fusion Middleware preinstallation \ checks (Y/N)?' lvl=6 #------------------------------------------------------------------------------ # Select master and technical repositories #------------------------------------------------------------------------------ [search_master] typ=N dsc='Master repository search error' nam=- var=0:loop_master:\ 1:bad_master,loop_master:\ 2:bad_master exe=sdcl { "var ($err,$hom,@tbl) = (0,${D_HOME}) "if compare('eq',${W_TYPE},'ODI10') " var ($off,$usr) = grep_login($hom,'ODI_SECU_USER') "else " var ($off,$usr) = grep_login(catDir($hom,'agent'),'ODI_MASTER_USER') "if length($usr) "{call push(@tbl,'MSTR') " var ${T_LOGIN_MSTR/T} = '[odiparams]' "} "else " var $err = $off "if compare('eq',${W_TYPE},'ODI10') "{if !extract_logins(\@tbl,catFile($hom,'bin','snps_login_security.xml'),'MSTR') " var $err = 4 "} "var @{W_MASTER_SET:'Master identifier set'} = @tbl "if ?$ERR{$err} " var ${T_MASTER_ERROR:'MASTER Repository search error'} = last "var ${AUX.dft} = nvl($STA{$err},$err) } [bad_master] typ=C dsc='Missing configuration file(s)' inp="${T_MASTER_ERROR:'Missing file(s)'}\n" vis=0 [loop_master] typ=L dft=@{W_MASTER_SET} dsc='Query each master repository' nam=-W_ID var=loop:master_login,chk_master,tech_export:\ exit:search_work,decode_work_dft [master_login] typ=T dft="${T_LOGIN_${W_ID}}" dsc="${W_ID} login" nam=T_LOGIN_${W_ID} [chk_master] typ=B dft=compare('eq',${W_ID},'MSTR') dsc='Information from odiparams?' # stopwords odiparams nam=- var=true:dft_master_db,dft_master_export:\ master_db,master_export [dft_master_db] typ=B dft="${B_MASTER_DB_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} master repository database details?" inp='Do you want RDA to connect to master repository database using odiparams \ connection details (Y/N)?' nam=B_MASTER_DB_${W_ID} [dft_master_export] typ=B dft="${B_MASTER_EXPORT_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} master repository export?" inp='Do you want to export master repository defined in odiparams (Y/N)?' nam=B_MASTER_EXPORT_${W_ID} [master_db] typ=B dft="${B_MASTER_DB_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} master repository database details?" inp="Do you want RDA to connect to master repository \ '${T_LOGIN_${W_ID}:${W_ID}}' database (Y/N)?" nam=B_MASTER_DB_${W_ID} [master_export] typ=B dft="${B_MASTER_EXPORT_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} master repository export?" inp="Do you want to export master repository \ '${T_LOGIN_${W_ID}:${W_ID}}' (Y/N)?" nam=B_MASTER_EXPORT_${W_ID} [tech_export] typ=B dft="${B_TECH_EXPORT_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} technical environment export?" inp='Do you want to export the technical environment of this master \ repository (Y/N)?' nam=B_TECH_EXPORT_${W_ID} #------------------------------------------------------------------------------ # Select work repositories #------------------------------------------------------------------------------ [search_work] typ=N dsc='Work repository search error' nam=-N_WORK exe=sdcl { "var ($err,$hom,@tbl) = (0,${D_HOME}) "if match(${W_TYPE},'^(AGENT|ODI10)$') "{if compare('eq',${W_TYPE},'ODI10') " var ($off,$usr) = grep_login($hom,'ODI_SECU_WORK_REP') " else " var ($off,$usr) = grep_login(catDir($hom,'agent'),'ODI_SECU_WORK_REP') " if length($usr) " {call push(@tbl,'WORK') " var ${T_LOGIN_WORK/T} = '[odiparams]' " } " else " var $err = $off "} "if match(${W_TYPE},'^(ODI10|STUDIO)$') "{if compare('eq',${W_TYPE},'ODI10') " var $fil = catFile($hom,'bin','snps_login_work.xml') " else " {if or(isWindows(),isCygwin()) " var $dir = catDir(${ENV.APPDATA},'odi','oracledi') " else " var $dir = catDir(${ENV.HOME},'.odi','oracledi') " var $fil = nvl(testFile('f',catFile($dir,'snps_login_work_12.xml')),\ " testFile('f',catFile($dir,'snps_login_work.xml'))) " } " if !extract_logins(\@tbl,$fil,'WORK') " var $err = 8 "} "var @{W_WORK_SET:'Work identifier set'} = @tbl "if ?$ERR{$err} " var ${T_WORK_ERROR:'Work Repository search error'} = last "var ${AUX.dft} = nvl($STA{$err},$err) } [decode_work_dft] typ=N dft=${N_WORK} dsc='Report missing configuration files' nam=- var=0:loop_work_dft:\ 1:bad_work,loop_work_dft:\ 2:bad_work [decode_work_studio] typ=N dft=${N_WORK} dsc='Report missing configuration files' nam=- var=0:loop_work_studio:\ 1:bad_work,loop_work_studio:\ 2:bad_work [bad_work] typ=C dsc='Missing configuration file(s)' inp="${T_WORK_ERROR:'Missing file(s)'}\n" vis=0 [loop_work_dft] typ=L dft=@{W_WORK_SET} dsc='Query each work repository' nam=-W_ID var=loop:work_login,chk_dft_work,log_export:\ exit:chk_log [loop_work_studio] typ=L dft=@{W_WORK_SET} dsc='Query each work repository' nam=-W_ID var=loop:work_login,chk_work:\ exit:chk_log [work_login] typ=T dft="${T_LOGIN_${W_ID}}" dsc="${W_ID} login" nam=T_LOGIN_${W_ID} [chk_dft_work] typ=B dft=compare('eq',${W_ID},'WORK') dsc='Information from odiparams?' nam=- var=true:dft_work_db,dft_work_export:\ work_db,work_export [chk_work] typ=B dft=compare('eq',${W_ID},'WORK') dsc='Information from odiparams?' nam=- var=true:dft_work_db:\ work_db [dft_work_db] typ=B dft="${B_WORK_DB_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} work repository database details?" inp='Do you want RDA to connect to work repository database using odiparams \ connection details (Y/N)?' nam=B_WORK_DB_${W_ID} [work_db] typ=B dft="${B_WORK_DB_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} work repository database details?" inp="Do you want RDA to connect to work repository \ '${T_LOGIN_${W_ID}:${W_ID}}' database (Y/N)?" nam=B_WORK_DB_${W_ID} [dft_work_export] typ=B dft="${B_WORK_EXPORT_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} work repository export?" inp='Do you want to export work repository defined in odiparams (Y/N)?' nam=B_WORK_EXPORT_${W_ID} [work_export] typ=B dft="${B_WORK_EXPORT_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} work repository export?" inp="Do you want to export work repository '${T_LOGIN_${W_ID}:${W_ID}}' (Y/N)?" nam=B_WORK_EXPORT_${W_ID} [log_export] typ=B dft="${B_LOG_EXPORT_${W_ID}}" dsc="${T_LOGIN_${W_ID}:${W_ID}} execution log export?" inp='Do you want to export the execution logs from this repository (Y/N)?' nam=B_LOG_EXPORT_${W_ID} var=true:set_log [set_log] typ=B dft=true dsc='Indicate whether RDA must collect execution logs' nam=-B_TMP_LOG #------------------------------------------------------------------------------ # Setting definitions for Oracle WebLogic Server #------------------------------------------------------------------------------ [D_DOMAIN_HOME] typ=D dft=${ENV.DOMAIN_HOME} dsc='Oracle WebLogic Server domain home' fmt='<',scalar(@dir = splitDir($dir)),1) "{loop $srv (findDir(catDir($dir,'servers'),'^[^\.]+$','n')) " {if ?testDir('d',catDir($dir,'servers',$srv,'logs')) " call push(@itm,$srv,$srv) " } " var ${T_TMP_NAM/T} = $nam = pop(@dir) " var @{T_TMP_ITM/T} = @itm " var ${I_DOMAIN:'Target associated with the domain'} = \ " nvl(findItem('DOM','D_DOMAIN_HOME',getShortPath($dir,true)),\ " defineTarget('DOM',{D_DOMAIN_ROOT=>$top = catNative(@dir,''),\ " T_DOMAIN_NAME=>$nam,\ " T_TITLE=>"Domain ${VAR.nam} (in ${VAR.top})"})) " var ${T_TOP_FOCUS:\ " 'Focus areas for Oracle WebLogic Server Middleware collection'} = \ " 'Generic' " var ${T_DOM_FOCUS:\ " 'Focus areas for Oracle WebLogic Server domain collection'} = \ " 'ExtSnmCfg,MinDomCfg,MinSrvCfg,NodDomCfg,NodDomLog,SrvErr' " var ${CTX.B_REQ_WREQ:\ " 'Does ODI require Oracle WebLogic request handler collection?'} = true "} } [B_MASTER_DB_MSTR] typ=B dft=false dsc='Master repository database details?' inp='Do you want RDA to get the master repository details from database (Y/N)?' var=true:set_wls_master [set_wls_master] typ=B nam=- exe=sdcl { "var @{W_MASTER_SET:'Master identifier set'} = ('MSTR') "var ${T_LOGIN_MSTR:'MSTR login'} = '[WEBLOGIC]' } [B_WORK_DB_WORK] typ=B dft=false dsc='Work repository database details?' inp='Do you want RDA to get the work repository details from database (Y/N)?' var=true:set_wls_work [set_wls_work] typ=B nam=- exe=sdcl { "var @{W_WORK_SET:'Work identifier set'} = ('WORK') "var ${T_LOGIN_WORK:'WORK login'} = '[WEBLOGIC]' } #------------------------------------------------------------------------------ # Select the log interval #------------------------------------------------------------------------------ [chk_log] typ=B dft=${B_TMP_LOG} dsc='Check if execution logs must be collected' nam=- var=true:T_BEGIN,T_END [T_BEGIN] typ=T dsc='Begin date' err='Invalid date format' inp="Enter the begin date (in a 'YYYY-MM-DD HH:MI:SS' format)" ref='^\d{4}-[01]\d-[0-3]\d [0-2]\d:[0-5]\d:[0-5]\d$' val=E [T_END] typ=T dsc='End date' err='Invalid date format' inp="Enter the end date (in a 'YYYY-MM-DD HH:MI:SS' format)" ref='^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$' val=E