<sdp_diaglet platform="aix" product="DB11R2" set="A200DB11R2_aix" title="Oracle Database 11g R2 (11.2.0) Preinstall (AIX)" type="A">
<sdp_meta type="version" id="$Id: A200DB11R2_aix.xml,v 1.20 2012/07/27 09:38:46 mschenke Exp $" header="$Header: /home/cvs/cvs/RDA_4/src/scripting/lib/hcve/A200DB11R2_aix.xml,v 1.20 2012/07/27 09:38:46 mschenke Exp $" version="1.0"/>
<sdp_meta author="JCR" change="Improved aio_maxreqs check" date="20120706" type="history"/>
<sdp_content set="A200DB11R2_aix" title="Oracle Database 11g R2 (11.2.0) Preinstall (AIX)" type="check">
<sdp_group>

<sdp_rule id="A00010" mode="VERIFY" name="OS Certified?">
<sdp_command type="RDA"><![CDATA[import $OS_NAM,$OS_VER,$OS_LVL,$OS_BIT
var $BOOK = 'Oracle Database Installation Guide 11g Release 2 (11.2) for IBM AIX on POWER Systems (64-bit)'
call setHcveVariable('$BOOK')
var $osv = substr(field('\-',0,$OS_LVL),0,3)
var $lvl = concat(field('-',1,$OS_LVL),'.',field('-',2,command('oslevel -s')))
var ($cpu) = field('_',1,grepCommand('/usr/sbin/prtconf','Processor Type','if'))
if !match($cpu,'^POWER')
 return setHcveResult('processor is not POWER')
var ($bit) = command('/usr/bin/getconf HARDWARE_BITMODE')
if !?$bit
 return setHcveResult('/usr/bin/getconf not executable')
elsif !match($bit,'^(64|32)$')
 return('hardware bit not confirmed')
elsif expr('!=',$bit,64)
 return setHcveResult('hardware not 64-bit')
var $hwv = field('\D',0,substr($cpu,5))
if expr('<=',$hwv,6)
 return setHcveResult(cond(\
   and(expr('==',$osv,530),compare('valid',$lvl,'09.01')),'Certified',\
   and(expr('==',$osv,610),compare('valid',$lvl,'02.01')),'Certified',\
   and(expr('==',$osv,710),compare('valid',$lvl,'00.01')),'Certified',\
   'Not certified POWER5 or POWER6'))
if expr('==',$hwv,7)
 return setHcveResult(cond(\
   and(expr('==',$osv,530),compare('valid',$lvl,'11.02')),'Certified',\
   and(expr('==',$osv,610),compare('valid',$lvl,'04.03')),'Certified',\
   and(expr('==',$osv,710),compare('valid',$lvl,'00.01')),'Certified',\
   'Not certified POWER7'))
call setHcveResult(concat('[',$cpu,\
  '] is not certified with Oracle Database 11g R2'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the AIX operating system is certified with Oracle Database 11g R2.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Certified" result="PASSED"><![CDATA[The operating system is certified. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The operating system is not an AIX operating system certified with Oracle Database 11g R2 for the following reasons:
|*Return Value*|*Action*|
|OS not AIX|This system is not an AIX system. Use this ruleset on AIX systems only.|
|Not certified POWER5 or POWER6|Your operating system is not AIX 5L V5.3 TL 09 SP1 (5300-09-01), 64-bit kernel or later; or AIX 6.1 TL 02 SP1 (6100-02-01), 64-bit kernel or later; or AIX 7.1 TL 00 SP1 (7100-00-01), 64-bit kernel or later. You need to use a certified AIX operating system, refer to ${'BOOK}.|
|Not certified POWER7|Your operating system is not AIX 5L V5.3 TL 11 SP2 (5300-11-02), 64-bit kernel or later; or AIX 6.1 TL 04 SP3 (6100-04-03), 64-bit kernel or later; or AIX 7.1 TL 00 SP1 (7100-00-01), 64-bit kernel or later. You need to use a certified AIX operating system, refer to ${'BOOK} and article 282036.|
|... is not certified with Oracle Database 11g R2|The POWER platform is not POWER5, POWER6, or POWER7. You need to use a certified combination of platform and operating system.|]]>
</sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00015" mode="VERIFY" name="HARDWARE_BITMODE 64?">
<sdp_command type="RDA"><![CDATA[
if grepCommand('/usr/bin/getconf HARDWARE_BITMODE','64')
 call setHcveResult('is 64-bit')
else
 call setHcveResult('not 64-bit')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the HARDWARE_BITMODE is 64-bit.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="is 64-bit" result="PASSED"><![CDATA[The HARDWARE_BITMODE is 64-bit as required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The HARDWARE_BITMODE must be 64-bit to install Oracle Database 11g R2. Please take corrective actions.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00016" mode="VERIFY" name="System mode 64-bit?">
<sdp_command type="RDA"><![CDATA[
loop $cmd ('/usr/sbin/bootinfo -K',\
           '/usr/bin/getconf KERNEL_BITMODE')
{if grepCommand($cmd,'64','f')
  return setHcveResult('64-bit kernel enabled')
 next statCommand()
 return setHcveResult('not running in 64-bit mode')
}
return setHcveResult('command failure')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the system is running 64-bit.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="64-bit kernel enabled" result="PASSED"><![CDATA[The 64-bit kernel is enabled as required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|not running in 64-bit mode|The system is not running in 64-bit mode as required to install Oracle Database 11g R2. Run in 64-bit mode. Refer to ${'BOOK}.|
|command failure|The user may not have permission to execute ``bootinfo`` and ``getconf``. Ensure that the system mode is 64-bit. Refer to ${'BOOK}.|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00020" mode="VERIFY" name="User in /etc/passwd?">
<sdp_command type="RDA"><![CDATA[call setHcveResult(cond(\
  not(testFile('r','/etc/passwd')),\
    'Cannot read /etc/passwd',\
  grepFile('/etc/passwd',\
           concat('^',$usr = first(command('/usr/bin/id -nu')),':'),\
           'f'),\
    'userOK',\
    concat($usr,' not in /etc/passwd.')))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the user name of the user who runs this script is in the ``/etc/passwd`` file.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="userOK" result="PASSED"><![CDATA[The ``/etc/passwd`` file contains the user. No action is required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[
|*Return Value*|*Action*|
|Cannot read /etc/passwd|Ensure the user, who is currently logged on, can read the ``/etc/passwd`` file.|
|... not in /etc/passwd|Ensure that the ``/etc/passwd`` file contains the user, who is currently logged in.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00040" mode="VERIFY" name="Group in /etc/group?">
<sdp_command type="RDA"><![CDATA[call setHcveResult(cond(\
  not(testFile('r','/etc/group')),\
    'Cannot read /etc/group',\
  grepFile('/etc/group',concat('^',command('/usr/bin/id -ng'),':'),'f'),\
    'GroupOK',\
    'Group not in /etc/group'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the group to which the user belongs exists in the ``/etc/group`` file.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="GroupOK" result="PASSED"><![CDATA[The ``/etc/group`` file contains the group of the user. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[
|*Return Value*|*Action*|
|Cannot read /etc/group|Ensure the user, who is currently logged on, can read the ``/etc/group`` file.|
|Group not in /etc/group|Ensure that the group to which the user, who is currently logged on, belongs is in included in ``/etc/group``.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00050" mode="RECORD" name="Enter ORACLE_HOME">
<sdp_command default="$ORACLE_HOME" type="PROMPT" variable="$ORACLE_HOME"><![CDATA[Planned ORACLE_HOME location]]></sdp_command>
<sdp_description><![CDATA[This rule prompts the user for the planned Oracle home directory.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00060" mode="VERIFY" name="ORACLE_HOME Valid?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00050" minimum="PASSED|RECORD" result="FAILED"><![CDATA[Requires ORACLE_HOME.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $ORACLE_HOME
call setHcveResult(cond(\
  not(defined($ORACLE_HOME)),    'OHNotSpecified',\
  not(testDir('d',$ORACLE_HOME)),'OHnotvalid',\
  not(testDir('l',$ORACLE_HOME)),'OHexists',\
                                 'OHsymlink'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks for the Oracle home directory.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" maximum="N" minimum="OHexists|OHsymlink" result="PASSED"><![CDATA[The Oracle home directory exists. No action required]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[ALERT:
There is an issue with the Oracle home directory:
|*Return Value*|*Action*|
|OHnotvalid|Ensure that you provided the correct location or that this directory is created and then run this script again.|
|OHNotSpecified|No ``ORACLE_HOME`` value was provided for verification.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00070" mode="VERIFY" name="O_H Permissions OK?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00060" minimum="PASSED" result="FAILED" value="ORACLE_HOME must exist for this rule"><![CDATA[Requires an accessible ORACLE_HOME.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $ORACLE_HOME
call setHcveResult(cond(\
  not(testDir('r',$ORACLE_HOME)),'NoReadPerm',\
  not(testDir('w',$ORACLE_HOME)),'NoWritePerm',\
  not(testDir('x',$ORACLE_HOME)),'NoExecutePerm',\
                                 'CorrectPerms'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the user has the correct privileges to install Oracle Database 11g R2 in the Oracle home directory.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="CorrectPerms" result="PASSED"><![CDATA[The permissions for the Oracle home directory are correct. No action required.]]></sdp_action>
<sdp_action condition="==" minimum="OHNotSpecified" result="SKIPPED"><![CDATA[No ``Oracle Home`` was provided to enable verification.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|NoReadPerm|Ensure that the install user has read permissions for the Oracle home directory|
|NoWritePerm|Ensure that the install user has write permissions for the Oracle home directory|
|NoExecutePerm|Ensure that the install user has execute permissions for the Oracle home directory|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00080" mode="VERIFY" name="oraInventory Permissions">
<sdp_command type="RDA"><![CDATA[call setHcveResult(cond(\
  not(testFile('f','/etc/oraInst.loc')),\
    'oraInventoryNotFound',\
  not(testFile('wr',$INV_LOC = \
    value(grepFile('/etc/oraInst.loc','^inventory_loc','f')))),\
    'oraInventoryNotOK',\
    'oraInventoryOK'))
call setHcveVariable('$INV_LOC')
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the user installing Oracle Database 11g R2 has sufficient privileges for the ``oraInventory`` directory.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" maximum="N" minimum="oraInventoryOK|oraInventoryNotFound" result="PASSED"><![CDATA[Either the user, who is logged in, has sufficient privileges for the ``oraInventory`` directory  to install Oracle Database 11g R2 or this is the first Oracle product to be installed on the system. In that case, the installer creates ``oraInventory`` directory. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The user, who is logged in, cannot access (write) ``oraInventory`` while installing Oracle Database 11g R2 . Verify that the user can write to the directory specified in the ``/etc/oraInst.loc`` file.
|*Return Value*|*Action*|
|oraInventoryNotOK|Make sure that the install user has write permissions to ${INV_LOC}|
|oraInventoryNotFound|The ``/etc/oraInst.loc`` file was not found. This is not a problem if this is the first Oracle installation on the system|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00090" mode="VERIFY" name="Got Software Tools?">
<sdp_command type="RDA"><![CDATA[var @tbl = ()
macro find_exe
{var (\@tbl,$exe,$ref) = @arg
 if findCommand($exe)
 {var $cmd = readLink(last,last)
  if !compare('eq',$cmd,$ref)
   call push(@tbl,concat(ucfirst($exe),'Elsewhere'))
 }
 else
  call push(@tbl,concat(ucfirst($exe),'Notfound'))
}
call find_exe(\@tbl,'ar','/usr/ccs/bin/ar')
call find_exe(\@tbl,'ld','/usr/ccs/bin/ld')
call find_exe(\@tbl,'nm','/usr/ccs/bin/nm')
call find_exe(\@tbl,'make','/usr/ccs/bin/make')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'ld_nm_ar_make_found'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the required assembly tools for the installation of Oracle Database 11g R2 exist.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="ld_nm_ar_make_found" result="PASSED"><![CDATA[All required assembly tools for the Oracle Database 11g R2 installation were found. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required assembly tools for the Oracle Database 11g R2 installation were not found. Check your installation.
|*Return Value*|*Action*|
|ArNotFound|``ar`` is not found in ``PATH``|
|LdNotFound|``ld`` is not found in ``PATH``|
|NmNotFound|``nm`` is not found in ``PATH``|
|MakeNotFound|``make`` is not found in ``PATH``|
|ArElsewhere|``ar`` is found in ``PATH`` but not in ``/usr/ccs/bin`` or symbolically linked to ``/usr/ccs/bin`` as required|
|LdElsewhere|``ld`` is found in ``PATH`` but not in ``/usr/ccs/bin`` or symbolically linked to ``/usr/ccs/bin`` as required|
|NmElsewhere|``nm`` is found in ``PATH`` but not in ``/usr/ccs/bin`` or symbolically linked to ``/usr/ccs/bin`` as required|
|MakeElsewhere|``make`` is found in ``PATH`` but not in ``/usr/ccs/bin`` or symbolically linked to ``/usr/ccs/bin`` as required|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00100" mode="VERIFY" name="Umask Set to 022?">
<sdp_command type="RDA"><![CDATA[call setHcveResult(cond(\
  expr('==','022',command('/usr/bin/umask')),'UmaskOK','UmaskNotOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the ``umask`` value is set correctly for installing Oracle Database 11g R2.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="UmaskOK" result="PASSED"><![CDATA[The ``umask`` value is set correctly for installing Oracle Database 11g R2. No action required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The ``umask`` value is not set correctly. Set the ``umask`` to 022 before installing Oracle Database 11g R2.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00110" mode="VERIFY" name="ulimits OK?">
<sdp_command type="RDA"><![CDATA[import $OS_VER
var @tbl =()
macro get_ulimit_unl
{var (\@tbl,$nam) = @arg
 var $lmt = field('\)\s+',1,grepLastFile(concat('^',$nam,'\('),'if'))
 if !defined($lmt)
  call push(@tbl,concat($nam,'NotDefined'))
 elsif compare('ne',$lmt,'unlimited')
  call push(@tbl,concat($nam,'TooSmall'))
}
call loadCommand('/usr/bin/ulimit -a')
call get_ulimit_unl(\@tbl,'File')
call get_ulimit_unl(\@tbl,'Time')
call get_ulimit_unl(\@tbl,'Data')
call get_ulimit_unl(\@tbl,'Stack')
call get_ulimit_unl(\@tbl,'Memory')
if compare('valid',$OS_VER,'6.1.0.0')
 call get_ulimit_unl(\@tbl,'Processes')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'ulimitOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the ``ulimit`` settings are adequate for installing Oracle Database 11g R2.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="ulimitOK" result="PASSED"><![CDATA[The ``ulimit`` settings are adequate for installing Oracle Database 11g R2. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Review the ``ulimit`` settings and check the recommended values from the ${'BOOK'} before installing the software.
|*Return Value*|*Action*|
|FileNotDefined|ulimit(FILE) is not defined|
|FileTooSmall|Increase the ulimit(FILE) to unlimited|
|TimeNotDefined|ulimit(TIME) is not defined|
|TimeTooSmall|Increase the ulimit(TIME) to unlimited|
|DataNotDefined|ulimit(DATA) is not defined|
|DataTooSmall|Increase the ulimit(DATA) to unlimited|
|StackNotDefined|ulimit(STACK) is not defined|
|StackTooSmall|Increase the ulimit(STACK) to unlimited|
|MemoryNotDefined|ulimit(MEMORY) is not defined|
|MemoryTooSmall|Increase the ulimit(MEMORY) to unlimited|
|ProcessesNotDefined|ulimit(PROCESSES) is not defined|
|ProcessesTooSmall|Increase the ulimit(PROCESSES) to unlimited|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00140" mode="VERIFY" name="LD_LIBRARY_PATH Unset?">
<sdp_command type="RDA"><![CDATA[call setHcveResult(cond(defined(getEnv('LD_LIBRARY_PATH')),'IsSet','UnSet'))]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the ``LD_LIBRARY_PATH`` environment variable is not set.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="UnSet" result="PASSED"><![CDATA[The ``LD_LIBRARY_PATH`` environment variable is not set. No action required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The ``LD_LIBRARY_PATH`` environment variable is set in your environment and must be unset before installing Oracle Database 11g R2.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00160" mode="VERIFY" name="LIBPATH Unset?">
<sdp_command type="RDA"><![CDATA[call setHcveResult(cond(defined(getEnv('LIBPATH')),'IsSet','UnSet'))]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the ``LIBPATH`` environment variable is not set.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="UnSet" result="PASSED"><![CDATA[The ``LIBPATH`` environment variable is not set. No action required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The ``LIBPATH`` environment variable is set in your environment and must be unset before installing Oracle Database 11g R2.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00190" mode="RECORD" name="Enter JDK Home">
<sdp_command default="" type="PROMPT" variable="$sdk"><![CDATA[JDK Home]]></sdp_command>
<sdp_description><![CDATA[This rule prompts the user for the JDK home.]]></sdp_description>
</sdp_rule>


<sdp_rule id="A00200" mode="VERIFY" name="JDK Version">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00190" minimum="PASSED|RECORD" result="FAILED"><![CDATA[Requires JDK home.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $sdk
if !testDir('d',$sdk)
 return setHcveResult('JDK home is missing')
var $SDK_BIN = catDir($sdk,'bin')
if !testDir('d',$SDK_BIN)
 return setHcveResult('JDK bin directory is missing')
if !grepDir($SDK_BIN,'^javac$')
 return setHcveResult('JDK compiler is missing')
var ($lin) = command(concat(catCommand($SDK_BIN,'java'),' -fullversion 2>&1'))
if !match($lin,'ap64')
 return setHcveResult('JDK is not 64-bit')
var ($rev) = match($lin,'\050SR(\d+)\b')
var $ver = field('\s+',2,\
 command(concat(catCommand($SDK_BIN,'java'),' -version 2>&1')))
var $ver = trim(replace($ver,'[\-\_]','.',true),'"')
if !match($ver,'^\d+')
 call setHcveResult(concat('[',$ver,'] not verified'))
elsif and(match($ver,'^1.5.0'),expr('>=',$rev,10))
 call setHcveResult('Adequate')
elsif and(match($ver,'^1.6.0'),expr('>=',$rev,2))
 call setHcveResult('Adequate')
else
 call setHcveResult('Not adequate')
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the installed JDK version is Java 5 64-bit SR10 or later, or Java 6 64-bit SR2 or later. This is required for products like Oracle Java Database Connectivity and Oracle Call Interface drivers.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[The correct JDK version is installed.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The JDK is not mandatory for the database installation. JDK 1.5 is installed with this release. However, the minimum JDK are required for Oracle Java Database Connectivity and Oracle Call Interface drivers.
|*Return Value*|*Action*|
|JDK is not 64-bit|Install Java 5 64-bit SR10 or later, or Java 6 64-bit SR2 or later.|
|Not adequate|Install Java 5 64-bit SR10 or later, or Java 6 64-bit SR2 or later.|
|JDK bin directory is missing|Install full JDK package.|
|JDK compiler is missing|Install full JDK package.|
|... not verified|Cannot verify the version. Make sure Java 5 64-bit SR10 or later, or Java 6 64-bit SR2 or later is installed.|
|JDK home is missing|Provide the correct location for JDK home.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00210" mode="VERIFY" name="Other O_Hs in PATH?">
<sdp_command type="RDA"><![CDATA[var @pth = split(':',getEnv('PATH'))
loop $lin (grepFile(catFile('/etc','oratab'),'#|^$','v'))
{var $pat = concat('^',quote(replace(field(':',1,$lin),'\/+$')),'(\/.*)?$')
 if grep(@pth,$pat)
  return setHcveResult('OratabEntryInPath')
}
call setHcveResult('NoneFound')
]]></sdp_command>
<sdp_description><![CDATA[This rule checks to ensure that the PATH variable does not contain any references to other Oracle home directories based on the ``/etc/oratab`` entries.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="NoneFound" result="PASSED"><![CDATA[The PATH does not contain any of the Oracle home directories found in the ``/etc/oratab`` file. No action required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The PATH variable contains one or more references to the Oracle home directories found in the ``/etc/oratab`` file. Remove these references from the PATH variable before installing Oracle Database 11g R2.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00220" mode="VERIFY" name="Other OUI Up?">
<sdp_command type="RDA"><![CDATA[call setHcveResult(cond(\
  grepCommand('/usr/bin/ps -ef','runInstaller','i'),'AnotherOUIup',\
                                                    'NoOtherOUI'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks for another active ``runInstaller`` process on the system.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="NoOtherOUI" result="PASSED"><![CDATA[No other ``runInstaller`` process is running. No action required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[Stop the other instance of ``runInstaller`` that is active on your system.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00230" mode="VERIFY" name="Temp Adequate?">
<sdp_command type="RDA"><![CDATA[
var ($flg,$tmp,@tbl) = (true,{'/tmp','/tmp'})
loop $key ('TMP','TMPDIR')
{if getEnv($key)
  var $tmp->{$key} = last
}
loop $key (keys(%tmp))
{if !testDir('d',$tmp->{$key})
  call push(@tbl,concat($key,' invalidDir'))
 else
 {if !testDir('w',$tmp->{$key})
   call push(@tbl,concat($key,' NoWrite'))
  if and($flg,expr('>=',get_df($tmp->{$key}),1048576))
   var $flg = false
 }
}
if $flg
{loop $key (keys(%tmp))
  call push(@tbl,concat($key,' tooSmall'))
}
call setHcveParameter('RULE.A00230',$tmp)
call setHcveVariable('$TMPDIR')
var $TMPDIR = getEnv('TMPDIR','/var/tmp')
if expr('<',get_df($TMPDIR),204800)
 call push(@tbl,concat('TMPDIR lessThan200'))
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'TempSpaceOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that there is sufficient space available for storing temporary files during the Oracle Database 10g installation.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="TempSpaceOK" result="PASSED"><![CDATA[There is sufficient temporary disk space available for installing Oracle Database 10g. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The temporary space is not configured correctly.
|*Return Value*|*Action*|
|/tmp invalidDir|ALERT - ``/tmp`` is not a valid directory. ``/tmp`` needs to be a directory.|
|/tmp NoWrite|ALERT - The user does not have write permissions to the ``/tmp`` directory.|
|/tmp tooSmall|ALERT - There is less than the needed 400 MB of free space in the ``/tmp`` directory.|
|TMP invalidDir|ALERT - ``TMP`` is set to ${`RULE.A00230.TMP} in the environment; however, ${`RULE.A00230.TMP} is an invalid directory. Take appropriate action.|
|TMP NoWrite|ALERT - ``TMP`` is set to ${`RULE.A00230.TMP} in the environment; however, the user does not have write permissions to ${`RULE.A00230.TMP}.|
|TMP tooSmall|ALERT - ``TMP`` is set to ${`RULE.A00230.TMP} in the environment; however, ${`RULE.A00230.TMP} has less than the required 1 GB of free space. Make sure your temporary space has at least 1 GB of free space.|
|TMPDIR invalidDir|ALERT - ``TMPDIR`` is set to ${`RULE.A00230.TMPDIR} in the environment; however, ${`RULE.A00230.TMPDIR} is an invalid directory. Take appropriate action.|
|TMPDIR NoWrite|ALERT - ``TMPDIR`` is set to ${`RULE.A00230.TMPDIR} in the environment; however, the user does not have write permissions to ${`RULE.A00230.TMPDIR}.|
|TMPDIR tooSmall|ALERT - ``TMPDIR`` is set to ${`RULE.A00230.TMPDIR} in the environment; however, ${`RULE.A00230.TMPDIR} has less than the required 1 GB of free space. Make sure your temporary space has at least 1 GB of free space.|
|TMPDIR lessThan200|ALERT - ${`TMPDIR} has less than the required 200 MB of free space. Make sure your ${`TMPDIR} has at least 200 MB of free space.|
Note: The ``runInstaller`` (OUI) uses or checks for temporary space by checking for the ``TEMP`` environment variable first, then the ``TMP`` environment variable, and finally the ``/tmp`` mount point.
%BR%The operating system also requires additional space by creating files under ``/tmp`` or using the ``TMPDIR`` environment variable if it finds it.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00240" mode="VERIFY" name="Disk Space OK?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00060" minimum="PASSED|RECORD" result="SKIPPED" value="This rule needs an accessible ORACLE_HOME"><![CDATA[Requires ORACLE_HOME.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $ORACLE_HOME
var $dsk = expr('/',get_df($ORACLE_HOME),1024)
call setHcveResult(cond(expr('>=',$dsk,9205.76),'DiskSpaceOK',\
                        expr('>=',$dsk,7618.56),'OnlySpaceForOne',\
                                             'NoSpace'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the amount of disk space in the Oracle home directory is sufficient for installing Oracle Database 11g R2.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="DiskSpaceOK" result="PASSED"><![CDATA[The Oracle home directory has sufficient disk space to install Oracle Database 11g R2 software and create a database. No action required.]]></sdp_action>
<sdp_action condition="==" minimum="OHNotSpecified" result="SKIPPED"><![CDATA[No ``Oracle Home`` was provided to enable verification.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The Oracle home directory has insufficient disk space for installing any type of Oracle Database 11g R2 architecture. Verify the specifications:
|*Return Value*|*Action*|
|OnlySpaceForOne|${`ORACLE_HOME} has sufficient free disk space to install the Oracle Database 11g R2 software, but not enough space to create a database. You need at least 8.99 GB.|
|NoSpace|${`ORACLE_HOME} has insufficient free disk space for an Oracle Database 11g R2 installation. 7.44 GB is needed for the software and 8.99 GB is needed to install the software and data files for a minimum build.|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00250" mode="RECORD" name="Swap (in MB)">
<sdp_command type="RDA"><![CDATA[if !testFile('x','/usr/sbin/lsps')
 return setHcveResult('ALERT- SWAP space cannot be determined')
var ($swp) = match(grepCommand('/usr/sbin/lsps -s','\s*\d+MB','f'),'\s*(\d+)MB')
call setHcveResult(cond($swp,$swp,'SWAPNotSet'))
]]></sdp_command>
<sdp_description><![CDATA[This rule shows the amount of free swap space.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00260" mode="VERIFY" name="RAM (in MB)">
<sdp_command type="RDA"><![CDATA[var ($mem) = match(grepCommand(\
  "/usr/sbin/lsattr -HE -l sys0 -a realmem",'\s+\d+\s+','f'),'\s+(\d+)\s+')
call setHcveResult(cond($mem,expr('/',$mem,1024)))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that your system has sufficient physical memory (MB) installed to install Oracle Database 11g R2.]]></sdp_description>
<sdp_actions>
<sdp_action condition=">=" minimum="2048" result="PASSED"><![CDATA[You have sufficient physical memory (MB) installed to install Oracle Database 11g R2. No action required.]]></sdp_action>
<sdp_action condition=">=" minimum="1024" result="FAILED"><![CDATA[You have sufficient physical memory (MB) installed to install Oracle Database 11g R2. However, you have less than the 2GB or more of physical memory recommended by Oracle.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[ALERT:
You do not have sufficient physical memory (MB) in your system to install Oracle Database 11g R2.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00270" mode="VERIFY" name="SwapToRAM OK?">
<sdp_dependencies>
<sdp_dependency condition="!~" id="A00250" minimum="SWAP" result="SKIPPED" value="The amount of swap must be known"><![CDATA[Requires the amount of swap space.]]></sdp_dependency>
<sdp_dependency condition=">=" id="A00260" minimum="1024" result="SKIPPED" value="The amount of physical memory must be known and must be at least the minimum for installation."><![CDATA[The required swap is not defined unless the amount of physical memory is known and is at least the minimum required for installation.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[var $swp = "%A00250%"
var $mem = "%A00260%"
call setHcveResult(cond(\
  expr('<',$mem,1024),                     'LowMem',\
  expr('<',$mem,2048),\
    cond(expr('<',$swp,expr('*',$mem,1.5)),'SwapLessThanRAM','SwapToRAMOK'),\
  expr('<',$mem,16384),\
    cond(expr('<',$swp,$mem),              'SwapLessThanRAM','SwapToRAMOK'),\
  expr('<',$swp,16384),                    'SwapLessThanRAM',\
                                           'SwapToRAMOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the total amount of swap space is greater than or equal to the amount recommended by the ''Oracle Database Installation Guide 11g Release 2 (11.2) for IBM AIX on POWER Systems (64-bit)''.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="SwapToRAMOK" result="PASSED"><![CDATA[The amount of swap space meets the minimum requirement for installing Oracle Database 11g R2. No action required.]]></sdp_action>
<sdp_action condition="==" minimum="LowMem" result="SKIPPED"><![CDATA[The amount of physical memory is inadequate; therefore, ratio to swap space is not defined.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The amount of swap space is less than the amount recommended by the ${'BOOK}. Verify the requirements and adjust your system accordingly.
|*Return Value*|*Action*|
|SwapLessThanRAM|If physical memory is between 1 GB and 2 GB, then the swap space is to be at least 1.5 times the physical memory. If physical memory is between 2 GB and 16 GB, then the swap space is to be at least equal to physical memory. If physical memory is more than 16 GB, then the swap space is to be at least 16 GB.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00290" mode="RECORD" name="IP Address">
<sdp_command type="RDA"><![CDATA[var ($hst) = command('hostname')
var $ip = "%A00290%"
var @lst = grepCommand(concat('/usr/sbin/ping -c 1 ',$hst),'.')
call setHcveResult(replace(field('\s+',3,grep(@lst,'\d+:','f')),':'))
]]></sdp_command>
<sdp_description><![CDATA[This rule gets the host IP address.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00300" mode="RECORD" name="Domain Name">
<sdp_command type="RDA"><![CDATA[var ($hst) = command('hostname')
var ($nam,$dom) = split('\.',$hst,2)
if testFile('x','/bin/domainname')
 var ($nis) = command('/bin/domainname')
if testFile('r','/etc/resolv.conf')
 var $dns = field('\s+',1,grepFile('/etc/resolv.conf','domain'))
if testFile('x','/usr/bin/nslookup')
{if $nam
 {var $nsl = field(concat(quote($nam),'\.'),1,\
                  grepCommand(concat('/usr/bin/nslookup ',$hst),'Name','f'))
 }
 else
 {var $nsl = field(concat(quote($hst),'\.'),1,\
                  grepCommand(concat('/usr/bin/nslookup ',$hst),'Name','f'))
 }
}
if $ip
{if !$nam
  var $ipn = trim(field(concat($hst,'\.'),1,\
             grepCommand(concat('/usr/bin/nslookup -sil ',$ip),'Name','f')),'.')
}
call setHcveResult(cond($dom,$dom,\
                        and(length($nis),compare('ne',$nis,'(none)')),$nis,\
                        $dns,$dns,\
                        $nsl,$nsl,\
                        $ipn,$ipn,\
                            'NotFound'))
]]></sdp_command>
<sdp_description><![CDATA[This rule gets the host domain name.]]></sdp_description>
</sdp_rule>

<sdp_rule id="A00310" mode="VERIFY" name="DNS Lookup">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00290" minimum="PASSED|RECORD" result="FAILED"><![CDATA[Requires rule A00290.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[var $ip  = "%A00290%"
var $hst = field('\.',0,command('hostname'))
call setHcveResult(cond(\
  not(length($ip)),\
    'Cannot determine IP address',\
  not(testFile('x','/usr/bin/nslookup')),\
    'Cannot access /usr/bin/nslookup',\
  and(grepCommand(concat('/usr/bin/nslookup ',$hst),quote($ip),'f'),\
      grepCommand(concat('/usr/bin/nslookup ',$ip),quote($hst),'f')),\
    'Host correctly registered in DNS',\
    'Host not correctly registered in DNS'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the host is registered correctly in the DNS.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Host correctly registered in DNS" result="PASSED"><![CDATA[The host is registered correctly in the DNS.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|Host not correctly registered in DNS|Register the host.domain in the DNS.|
|Cannot determine IP address|Fix any problem with the host IP address.|
|Cannot access /usr/bin/nslookup|Grant execute permissions on ``/usr/bin/nslookup`` to the current user.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00320" mode="VERIFY" name="/etc/hosts Format">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00300" minimum="PASSED|RECORD" result="FAILED"><![CDATA[Requires domain name.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[
if !testFile('r','/etc/hosts')
 return setHcveResult('Cannot access /etc/hosts')
if !@tbl = grepFile('/etc/hosts',\
  concat('^([^\s\#]+\s+)+',quote(${RDA.HOST}),\
         '\s+([^\s\#]+\s+)*',quote(${RDA.NODE}),'(\s|\z|\#)'))
 return setHcveResult('no entry found')

# Test that line begins with IPv4 IP address
if grep(@tbl,'^(\d{1,3}\.){3}\d{1,3}\s','f')
 return setHcveResult('Adequate IPv4 entry')

# Tests that line begins with IPv6 IP address, first that all eight groups are populated, then situations where groups that are all zero are omitted (two colons together).
if grep(@tbl,'^([A-F\d]{1,4}(:[A-F\d]{1,4}){7}\s|\
                :(:[A-F\d]{1,4}){1,6}\s|\
                ([A-F\d]{1,4}:){1,5}(:[A-F\d]{1,4}){1,5}\s|\
                ([A-F\d]{1,4}:){1,6}:\s)','f')
 return setHcveResult('Adequate IPv6 entry')
return setHcveResult('no correct entry found')
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the ``/etc/hosts`` file contains a line with ``ip_address fully_qualified_domainname short_hostname``.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" minimum="^Adequate" result="PASSED"><![CDATA[The ``/etc/hosts`` entry for the fully qualified domain name and host name is adequate.]]></sdp_action>
<sdp_action condition="==" minimum="Cannot access /etc/hosts" result="FAILED"><![CDATA[Grant read permissions on ``/etc/hosts`` to the current user.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The fully qualified host name and host name are not configured correctly. Ensure that there is an IP address entry for the fully qualified domain name with the host name as one of the aliases.
|*Return Value*|*Action"|
|no entry found|No entry with the fully qualified domain name followed by the host name was found.|
|no correct entry found|No entry beginning with an IP address with the fully qualified domain name followed by the host name was found.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00330" mode="VERIFY" name="Kernel Parameters OK?">
<sdp_command type="RDA"><![CDATA[
var (@tbl,@msg) = ()
if !testFile('x','/usr/bin/smit')
 call push(@msg,'smit not executable')
elsif !loadCommand('/usr/bin/smit chgsys')
 call push(@msg,'No smit access')
else
{if !expr('<=',16384,\
   field('\[|\]',1,grepLastFile('maximum number of processes','if')))
  call push(@tbl,'maxuprocs too small')
 if !expr('<=',128,field('\[|\]',1,grepLastFile('ARG\/ENV','if')))
  call push(@tbl,'ncargs too small')
 return setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'Parameters OK'))
}
if !testFile('x','/usr/sbin/lsattr')
 call push(@msg,'lsattr not executable')
elsif !loadCommand('lsattr -E -l sys0')
 call push(@msg,'No lsattr access')
else
{if !expr('<=',16384,\
   field('\s+',1,grepLastFile('^maxuproc','if')))
  call push(@tbl,'maxuprocs too small')
 if !expr('<=',128,field('\s+',1,grepLastFile('^ncargs','if')))
  call push(@tbl,'ncargs too small')
 return setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'Parameters OK'))
}
return setHcveResult(join("\012",@msg))]]></sdp_command>
<sdp_description><![CDATA[This rule checks the Kernel paramaters maxuprocs and ncargs.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Parameters OK" result="PASSED"><![CDATA[The Kernel parameters are set satisfactorily.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The following parameters were not set satisfactorily:
|*Return Value*|*Action*|
|maxuprocs too small|The maximum number of processes must be set to 16384 or greater.|
|ncargs is too small|The ARG/ENV list size must be set to 128 or greater.|
|smit not executable|The person running the tests must be able to execute ``smit``.|
|No smit access|The person running the tests must have access to ``smit``.|
|lsattr not executable|The person running the tests must be able to execute ``lsattr``.|
|No lsattr access|The person running the tests must have access to ``lsattr``.|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id ="A00335" mode="VERIFY" name="aio_maxreqs OK?">
<sdp_command type="RDA"><![CDATA[import $OS_VER
if match($OS_VER,'^5\.3')
{var ($tmp) = \
   grepCommand('/usr/sbin/lsattr -El aio0 -a maxreqs','^maxreqs\b','f')
 if statCommand()
  return setHcveResult('lsattr error')
 if expr('>=',field('\s+',1,$tmp),65536)
  return setHcveResult('Adequate')
 return setHcveResult('maxreqs less than 65536')
}
if match($OS_VER,'^[67]\.1')
{var ($val) = grepCommand('/usr/sbin/ioo -o aio_maxreqs','^aio_maxreqs\b','f')
 if statCommand()
 {var @lin = grepCommand('/usr/bin/iostat -A','\w')
  if statCommand()
   return setHcveResult('ioo and iostat error')
  while ?shift(@lin)
  {next !match(last,'^aio:')
   if field('\s+',4,$lin[0])
   {if expr('>=',last,65536)
     return setHcveResult('Adequate')
    return setHcveResult('aio_maxreqs less than 65536')
   }
  }
  return setHcveResult('ioo and iostat error')
 }
 if expr('>=',value($val),65536)
  return setHcveResult('Adequate')
 return setHcveResult('aio_maxreqs less than 65536')
}
return setHcveResult('Skip')
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that ``aio_maxreqs`` is set to an adequate value. It must be set to 65536 or greater.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Adequate" result="PASSED"><![CDATA[``aio_maxreqs`` is set to 65536 or greater. No action needed.]]></sdp_action>
<sdp_action condition="==" minimum="Skip" result="SKIPPED"><![CDATA[No ``aio_maxreqs`` requirement is established for your OS version.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|aio_maxreqs less than 65536|The setting of ``aio_maxreqs`` is less than 65536. It is recommended that you set ``aio_maxreqs`` to at least 65536.|
|ioo and iostat error|The user may not be authorized to execute ``ioo`` and ``iostat`` or ``aio_maxreqs`` may not be set. It is recommended that ``aio_maxreqs`` be set to at least 65536.|
|lsattr error|The user may not be authorized to execute ``lsattr`` or ``maxreqs`` may not be set. It is recommended that ``maxreqs`` be set to at least 65536.|
|maxreqs less than 65536|The setting of ``maxreqs`` is less than 65536. It is recommended that you set ``maxreqs`` to at least 65536.|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00340" mode="VERIFY" name="AIXTHREAD_SCOPE=S?">
<sdp_command type="RDA"><![CDATA[import $OS_VER
if expr('>',field('\.',0,$OS_VER),5)
 return setHcveResult('NA')
var $env = getEnv('AIXTHREAD_SCOPE')
call setHcveResult(cond(not(defined($env)),    'AIXTHREADNotSet',\
                        compare('eq',$env,'S'),'AIXTHREAD_SCOPEOK',\
                                               'AIXTHREAD_SCOPEBad'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the ``AIXTHREAD_SCOPE`` environment variable is set to ``S``.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="NA" result="SKIPPED"><![CDATA[This rules does not apply to AIX 6.1 and later.]]></sdp_action>
<sdp_action condition="==" minimum="AIXTHREAD_SCOPEOK" result="PASSED"><![CDATA[The ``AIXTHREAD_SCOPE`` environment variable setting is correct. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The ``AIXTHREAD_SCOPE`` environment variable is not correct.
|*Return Value*|*Action*|
|AIXTHREADNotSet|The ``AIXTHREAD_SCOPE`` environment variable should be set to ``S``.|
|AIXTHREAD_SCOPEBad|The ``AIXTHREAD_SCOPE`` environment variable is set but not set to ``S``. Reset the value to ``S``.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00350" mode="VERIFY" name="LINK_CNTRL is Unset?">
<sdp_command type="RDA"><![CDATA[call setHcveResult(cond(\
  defined(getEnv('LINK_CNTRL')),'LINK_CNTRLBad','LINK_CNTRLunset'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that ``LINK_CNTRL`` is not set in the environment.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="LINK_CNTRLunset" result="PASSED"><![CDATA[The ``LINK_CNTRL`` environment variable setting is not set. This setting is not required for AIX 5L. No action required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The ``LINK_CNTRL`` environment variable is set in your environment. Unset the variable.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00410" mode="VERIFY" name="Got OS Patches?">
<sdp_command type="RDA"><![CDATA[import $OS_VER
var @tbl = split('\-',first(command('oslevel -s')))
var $tmp = concat($tbl[0],'.',$tbl[1],'.',$tbl[2])
var $tl = $tbl[1]
var @tbl = ()
macro check_patches
{var (\@tbl,@pch) = @arg
 loop $pch (@pch)
 {if grepCommand(concat('/usr/sbin/instfix -ik ',$pch),'no','if')
    call push(@tbl,concat('[',$pch,'] not installed'))
 }
}
if not(testFile('x','/usr/sbin/instfix'))
 return setHcveResult('NoAccess')
elsif match($OS_VER,'^5')
{if match($tl,'09')
 {if !compare('valid',$tmp,'5300.09.05')
   call check_patches(\@tbl,'IZ42940','IZ49516','IZ52331')
 }
 elsif match($tl,'10')
 {if !compare('valid',$tmp,'5300.10.02')
   call check_patches(\@tbl,'IZ42940','IZ49516','IZ52331')
 }
 elsif compare('valid',$tl,'11')
  return setHcveResult('PatchesNotRequired')
}
elsif match($OS_VER,'^6')
{if match($tl,'02')
 {if !compare('valid',$tmp,'6100.02.04')
   call check_patches(\@tbl,'IZ41855','IZ51456','IZ52319')
 }
 elsif match($tl,'03')
 {if !compare('valid',$tmp,'6100.03.02')
   call check_patches(\@tbl,'IZ41855','IZ51456','IZ52319')
 }
 elsif compare('valid',$tl,'04')
  return setHcveResult('PatchesNotRequired')
}
elsif match($OS_VER,'^7')
 call check_patches(\@tbl,'IZ87216','IZ87564')
else
 return setHcveResult('OS not certified')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'PatchesFound'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks for the OS patches required for the Oracle Database 11g R2 installation.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" minimum="PatchesFound|PatchesNotRequired|NotChecked" result="PASSED"><![CDATA[All required OS patches are found. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required OS patches were not met or found. Review the recommended OS patches from the ${'BOOK} before installing the software.
|*Return Value*|*Action*|
|OS not certified|Patch requirements are not established for non-certified operating systems.|
|... not installed|Install the OS patch or its latest version.%BR%For AIX 5.3: IZ42940, IZ49516, IZ52331%BR%For AIX 6.1: IZ41855, IZ51456, IZ52319%BR%For AIX 7.2: IZ87216, IZ87564|
|NoAccess|OS patches could not be verified because the user has no execute permissions to ``/usr/sbin/instfix``. Ensure the user, who is logged in, has execute permissions to ``/usr/sbin/instfix``.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00430" mode="VERIFY" name="Got OS Packages?">
<sdp_command type="RDA"><![CDATA[import $OS_VER
var @tbl = ()
macro check_package
{var (\@tbl) = @arg
 import $OS_LVL
 if match($OS_LVL,'^7100\-')
  var %ver = ('xlC.aix61.rte',       '10.1.0.0',\
              'xlC.rte',             '10.1.0.0')
 elsif match($OS_LVL,'^6100\-')
  var %ver = ('bos.perf.libperfstat','6.1.2.1',\
              'gpfs.base',           '3.2.1.8',\
              'xlC.aix61.rte',       '10.1.0.0')
 elsif match($OS_LVL,'^5300\-')
  var %ver = ('bos.perf.libperfstat','5.3.9.0',\
              'gpfs.base',           '3.2.1.8',\
              'xlC.aix50.rte',       '10.1.0.0')
 else
  var %ver = ()
 call loadCommand('/usr/bin/lslpp -l')
 loop $pkg ('bos.adt.base',\
            'bos.adt.lib',\
            'bos.adt.libm',\
            'bos.perf.perfstat',\
            'bos.perf.proctools',\
            keys(%ver))
 {var (undef,$lvl,$sta) = split('\s+',trim(grepLastFile(quote($pkg),'f')),4)
  if !$sta
   call push(@tbl,concat('[',$pkg,'] not installed'))
  elsif and(compare('ne',$sta,'COMMITTED'),compare('ne',$sta,'APPLIED'))
   call push(@tbl,concat('[',$pkg,'] not applied'))
  elsif and(defined($ver{$pkg}),not(compare('valid',$lvl,$ver{$pkg})))
   call push(@tbl,concat('[',$pkg,'] insufficient version'))
 }
}
call cond(testFile('x','/usr/bin/lslpp'),check_package(\@tbl),\
                                         push(@tbl,'NoAccess'))
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),\
                                     'All required OS packages are installed'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that all required OS packages are installed.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="All required OS packages are installed" result="PASSED"><![CDATA[All required OS packages are installed. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required OS packages did not satisify minimum version requirements, were not applied, or were not found. Review the recommended OS packages from the ${'BOOK} before installing the software.
|*Return Value*|*Action*|
|... not installed|Install the OS package or its latest version. Refer to the following list of required OS packages: ``bos.adt.base``, ``bos.adt.lib``, ``bos.adt.libm``, ``bos.perf.libperfstat``, ``bos.perf.perfstat``, ``bos.perf.proctools``, ``xlC.aix50.rte`` (for AIX 5.3), ``xlC.aix61.rte`` (for AIX 6.1 or AIX 7.1), ``gpfs.base`` (for AIX 5.3 or AIX 6.1), and ``xlC.rte`` (for AIX 7.1). ``gpfs.base`` is only required if you are going to use a cluster file system for Oracle clusterware or database files.|
|... not applied|The package was found but is not applied or committed. Make sure that it is applied.|
|... insufficient version|The package was applied, but is not at the minimum required version level. Refer to ${'BOOK} for the required version level.|
|NoAccess|OS packages could not be verified because the user does not have execute permissions to the ``/bin/lslpp`` command. Ensure that the user, who is logged on, has execute permissions to ``/usr/bin/lslpp``.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00445" mode="VERIFY" name="TCP/UDP Ephemeral OK?">
<sdp_command type="RDA"><![CDATA[
var @tbl = ()
call loadCommand('/usr/sbin/no -a')
if !expr('==',value(grepLastFile('tcp_ephemeral_low','f')),9000)
 call push(@tbl,'tcp_low')
if !expr('==',value(grepLastFile('tcp_ephemeral_high','f')),65500)
 call push(@tbl,'tcp_high')
if !expr('==',value(grepLastFile('udp_ephemeral_low','f')),9000)
 call push(@tbl,'udp_low')
if !expr('==',value(grepLastFile('udp_ephemeral_high','f')),65500)
 call push(@tbl,'udp_high')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),\
                                      'Ephemeral OK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks the values of ``tcp_ephemeral_low``, ``tcp_ephemeral_high``, ``udp_ephemeral_low``, and ``upd_ephemeral_high``.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Ephemeral OK" result="PASSED"><![CDATA[The ephemeral settings for TCP and UDP are OK.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The following parameters do not have the recommended value:
|*Return Result*|*Action*|
|tcp_low|The recommended value for ``tcp_ephemeral_low`` is 9000|
|tcp_high|The recommended value for ``tcp_ephemeral_high`` is 65500|
|udp_low|The recommended value for ``udp_ephemral_low`` is 9000|
|udp_high|The recommended value for ``udp_ephemeral_high`` is 65500|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

</sdp_group>
</sdp_content>
</sdp_diaglet>
