# EXAcfg.def: Assists Exadata Collection Setup # $Id: EXAcfg.def,v 1.5 2012/01/03 13:34:41 mschenke Exp $ # ARCS: $Header: /home/cvs/cvs/RDA_4/src/scripting/lib/modules/EXAcfg.def,v 1.5 2012/01/03 13:34:41 mschenke Exp $ # # Change History # 20120103 MSC Change the copyright notice. =head1 NAME EXAcfg - Assists Exadata Collection Setup =head1 DESCRIPTION This module provides associated logic for the setup of the Exadata collections. =cut #------------------------------------------------------------------------------ # Section init: Module initialization #------------------------------------------------------------------------------ section init #------------------------------------------------------------------------------ # Section chk_cells: Check which cells are present #------------------------------------------------------------------------------ section chk_cells # Determine the associate setup prefix var ($pre,@cel) = (${AUX.PREFIX}) # Detect the cells loop $lin (grepFile('/etc/oracle/cell/network-config/cellip.ora',\ '^cell=\".*?\"')) {if match($lin,'^cell=\"(.*?)\"') {var ($cel) = last call push(@cel,$cel) } } # Customize the setup if @cel {var ${AUX.dft} = 1 var ($cnt,$flg,@all,@dft,@itm,%sel) = (0,true) # Analyze the previous requests var $val = getSetting(concat($pre,'_CELLS'),'*') if compare('eq',$val,'*') var $flg = false else {loop $cel (split('\|',$val)) var $sel{lc($cel)} = 1 } # Generate temporary settings loop $cel (@cel) {call push(@all,$cel) call push(@itm,incr($cnt),$cel) if and($flg,exists($sel{lc($cel)})) call push(@dft,$cel) } call setTempSetting('TMP_ALL_CELLS',join('|',@all)) call setTempSetting('TMP_DFT_CELLS',cond($flg,join('|',@dft),'*')) call setTempSetting('TMP_ITM_CELLS',join('|',@itm)) } #------------------------------------------------------------------------------ # Section chk_nodes: Check which nodes are present #------------------------------------------------------------------------------ section chk_nodes # Determine the associate setup prefix var ($crs,$pre,@nod) = (undef,${AUX.PREFIX}) # Detect the nodes run CRSinit(\$crs) if testDir('d',$crs) {if loadCommand(concat(catCommand($crs,'bin',${AS.EXE:'crsctl'}),\ ' status server')) {loop $lin (grepLastFile('^NAME=')) {var $nod = value($lin) next compare('eq',$nod,${RDA.NODE}) call push(@nod,join(".",$nod,${RDA.DOMAIN})) } } } # Customize the setup if @nod {var ${AUX.dft} = 1 var ($cnt,$flg,@all,@dft,@itm,%sel) = (0,true) # Analyze the previous requests var $val = getSetting(concat($pre,'_NODES'),'*') if compare('eq',$val,'*') var $flg = false else {loop $nod (split('\|',$val)) var $sel{lc($nod)} = 1 } # Generate temporary settings loop $nod (@nod) {call push(@all,$nod) call push(@itm,incr($cnt),$nod) if and($flg,exists($sel{lc($nod)})) call push(@dft,$nod) } call setTempSetting('TMP_ALL_NODES',join('|',@all)) call setTempSetting('TMP_DFT_NODES',cond($flg,join('|',@dft),'*')) call setTempSetting('TMP_ITM_NODES',join('|',@itm)) } =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