<sdp_diaglet platform="solaris" product="DB11R2" set="A200DB11R2_sol" title="Oracle Database 11g R2 (11.2.0) Preinstall (Solaris)" type="A">
<sdp_meta type="version" id="$Id: A200DB11R2_sol.xml,v 1.11 2012/04/18 16:08:12 mschenke Exp $" header="$Header: /home/cvs/cvs/RDA_4/src/scripting/lib/hcve/A200DB11R2_sol.xml,v 1.11 2012/04/18 16:08:12 mschenke Exp $" version="1.0"/>
<sdp_meta author="JCR" change="Improve Temp and RAM checks" date="20120404" type="history"/>
<sdp_content set="A200DB11R2_sol" title="Oracle Database 11g R2 (11.2.0) Preinstall (Solaris)" type="check">
<sdp_group>

<sdp_rule id="A00010" mode="VERIFY" name="OS Certified?">
<sdp_command type="RDA"><![CDATA[import $OS_NAM,$OS_VER,$OS_BIT
var $BOOK = 'Oracle Database Installation Guide 11g Release 2 (11.2) for Solaris Operating System'
call setHcveVariable('$BOOK')
if and(match($OS_NAM,'SunOS'),match($OS_VER,'^2\.10'),match($OS_BIT,'64'))
{var ($tmp) = grepFile('/etc/release','_u')
 var $val = field('\D',0,field('_u',1,$tmp))
 if expr('>=',$val,6)
  call setHcveResult('Certified')
 else
  return setHcveResult('Less than Update 6')
}
else
 return setHcveResult('Not certified')
]]></sdp_command>
<sdp_description><![CDATA[This rule checks for the correct version of Solaris for installing Oracle Database 11g R2.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="Certified" result="PASSED"><![CDATA[The correct version of Solaris is installed on your server.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[!!SHOWSTOPPER!!
You do not have Solaris 10 Update 6 64-bit installed on your server. For the certified versions of Solaris, see the ${'BOOK} and My Oracle Support.]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00011" mode="VERIFY" name="OS Build Adequate?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00010" minimum="PASSED" result="SKIPPED" value="Not certified"><![CDATA[Requires a certified Solaris operating system.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[
var ($lin) = grepCommand('/usr/bin/pkginfo -l SUNWsolnm','VERSION','f')
call setHcveResult(cond(compare('VALID',value($lin),'2008.10'),'adequate',\
                                                               'inadequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the operating system build meets requirements.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="adequate" result="PASSED"><![CDATA[The operating system build is adequate. No action required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The operating system build is too old. Use a build of 2008.10 or later.]]></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')),\
    'Can not read /etc/passwd',\
  grepFile('/etc/passwd',\
           concat('^',$usr = first(command('/usr/xpg4/bin/id -nu')),':'),\
           'f'),\
    'userOK',\
    concat(nvl($usr,'User'),' 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"><![CDATA[The ``/etc/passwd`` file does not contain the user or the file has no read permissions. 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')),\
    'Can not read /etc/group',\
  grepFile('/etc/group',concat('^',command('/usr/xpg4/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"><![CDATA[ALERT:
The ``/etc/group`` file does not contain the group to which the user, who is currently logged on, belongs; or the group does not have read permissions to the file. Ensure that the ``/etc/group`` file contains the group to which the user, who is currently logged in, belongs.]]></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="Location of ORACLE_HOME must be accessible to check permissions"><![CDATA[Requires 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="=~" maximum="N" minimum="CorrectPerms" result="PASSED"><![CDATA[The permissions for the Oracle home directory are correct. No action required.]]></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','/var/opt/oracle/oraInst.loc')),\
    'oraInventoryNotFound',\
  not(testFile('wr',$INV_LOC = \
    value(grepFile('/var/opt/oracle/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 the second case, the installer creates the ``oraInventory`` directory. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The user, who is logged in, cannot access (write) the ``oraInventory`` directory while installing Oracle Database 11g R2. Verify that the user can write to the directory specified in the ``/var/opt/oracle/oraInst.loc`` file.
|*Return Value*|*Action*|
|oraInventoryNotOK|Make sure that the install user has write permissions to ${INV_LOC}|]]></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 installation of Oracle Database 11g R2 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`` was not found in ``PATH`` as required|
|LdNotfound|``ld`` was not found in ``PATH`` as required|
|NmNotfound|``nm`` was not found in ``PATH`` as required|
|MakeNotfound|``make`` was not found in ``PATH`` as required|
|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[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'))
}
macro get_ulimit_val
{var (\@tbl,$nam,$ref) = @arg
 var $lmt = field('\s+',1,grepLastFile(concat('^',$nam,'\('),'if'))
 if !length($lmt)
  call push(@tbl,concat($nam,'NotDefined'))
 elsif and(compare('ne',$lmt,'unlimited'),expr('<',$lmt,$ref))
  call push(@tbl,concat($nam,'TooSmall'))
}
call loadCommand('/usr/bin/ulimit -a')
call get_ulimit_unl(\@tbl,'Time')
call get_ulimit_unl(\@tbl,'File')
call get_ulimit_val(\@tbl,'Data',1048576)
call get_ulimit_val(\@tbl,'Stack',32768)
call get_ulimit_val(\@tbl,'NoFiles',4096)
call get_ulimit_val(\@tbl,'Vmemory',4194304)
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'ulimitOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the ``ulimit`` settings are adequate Oracle Database 11g R2. The recommended values are not less than: ulimit(TIME) = unlimited, ulimit(FILE) = unlimited, ulimit(DATA) = 1048576, ulimit(STACK) = 32768, ulimit(NOFILES) = 4096, ulimit(VMEMORY) = 4194304.]]></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, which are recommended to be at least: ulimit(TIME) = unlimited, ulimit(FILE) = unlimited, ulimit(DATA) = 1048576, ulimit(STACK) = 32768, ulimit(NOFILES) = 4096, ulimit(VMEMORY) = 4194304.
|*Return Value*|*Action*|
|TimeNotDefined|ulimit(TIME) is not defined|
|TimeTooSmall|Increase the ulimit(TIME) to unlimited|
|FileNotDefined|ulimit(FILE) is not defined|
|FileTooSmall|Increase the ulimit(FILE) to unlimited|
|DataNotDefined|ulimit(DATA) is not defined|
|DataTooSmall|Increase the ulimit(DATA) to a minimum of 1048576|
|StackNotDefined|ulimit(STACK) is not defined|
|StackTooSmall|Increase the ulimit(STACK) to a minimum of 32768|
|NoFilesNotDefined|ulimit(NOFILES) is not defined|
|NoFilesTooSmall|Increase the ulimit(NOFILES) to a minimum of 4096|
|VmemoryNotDefined|ulimit(VMEMORY) is not defined|
|VmemoryTooSmall|Increase the ulimit(VMEMORY) to a minimum of 4194304|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00140" mode="VERIFY" name="LDLIBRARYPATH 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="A00150" mode="VERIFY" name="LDLIBRARYPATH64 Unset?">
<sdp_command type="RDA"><![CDATA[call setHcveResult(cond(\
  defined(getEnv('LD_LIBRARY_PATH_64')),'LDLBRYPATH64Set','UnSet'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the ``LD_LIBRARY_PATH_64`` environment variable is not set.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="UnSet" result="PASSED"><![CDATA[The ``LD_LIBRARY_PATH_64`` environment variable is not set. No action required.]]></sdp_action>
<sdp_action result="FAILED"><![CDATA[The ``LD_LIBRARY_PATH_64`` 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 $ver = field('\s+',3,\
 command(concat(catCommand($SDK_BIN,'java'),' -fullversion 2>&1')))
var $ver = trim(replace($ver,'[\-\_]','.',true),'"')
if !match($ver,'^\d+')
 call setHcveResult(concat('[',$ver,'] not verified'))
else
 {if and(match($ver,'^1\.6\.'),compare('valid',$ver,'1.6.0.10'))
   call setHcveResult('Adequate')
  elsif and(match($ver,'^1\.5\.'),compare('valid',$ver,'1.5.0.16'))
   call setHcveResult('Adequate')
  else
   call setHcveResult('Not adequate')
 }
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the installed JDK version is JDK 1.5.0_16 or later or JDK 1.6.0_10 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[|*Return Value*|*Action*|
|Not adequate|Install JDK 1.5.0_16 or later or JDK 1.6.0_10 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 JDK 1.5.0_16 or later or JDK 1.6.0_10 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('/var','opt','oracle','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 that the PATH variable does not contain any references to other Oracle home directories based on the ``/var/opt/oracle/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 in the ``/var/opt/oracle/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 ``/var/opt/oracle/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 setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'TempSpaceOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that there is sufficient space available to store temporary files during the Oracle Database 11g R2 installation.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="TempSpaceOK" result="PASSED"><![CDATA[There is sufficient temporary disk space available for installing Oracle Database 11g R2. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The temporary space is not correctly configured.
|*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 1 GB 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 1GB 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 1GB of free space. Make sure your temporary space has at least 1 GB of free space.|
Note: The ``runInstaller`` (OUI) uses or checks for temporary space by checking for the ``TEMP`` environment variable, 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="A00050" minimum="PASSED|RECORD" result="FAILED" value="ORACLE_HOME is required for determining available disk space."><![CDATA[Requires ORACLE_HOME.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $ORACLE_HOME
call setHcveVariable('$ORACLE_HOME')
if !length($ORACLE_HOME)
 return setHcveResult('OHNotSpecified')
if !testDir('d',$ORACLE_HOME)
 return setHcveResult('OHNotValid')
var $dsk = expr('/',get_df($ORACLE_HOME),1024)
call setHcveResult(cond(expr('>=',$dsk,4812.8),\
                          'DiskSpaceOK',\
                          '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="=~" maximum="N" 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 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*|
|NoSpace|${`ORACLE_HOME} has insufficient free disk space for an Oracle Database 11g R2 installation.|
|OHNotValid|Disk space calculations cannot be performed because ${`ORACLE_HOME} is not a valid directory|
|OHNotSpecified|ORACLE_HOME was not specified|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00250" mode="RECORD" name="Swap (in MB)">
<sdp_command type="RDA"><![CDATA[if !testFile('x','/etc/swap')
 return setHcveResult('SWAPNotDetermined')
var ($cmd) = grepCommand('/etc/swap -s','^total:','f')
var $swp = field('\s+',0,replace(field('\s+',10,$cmd),'k',' k '))
call setHcveResult(cond(isNumber($swp),expr('/',$swp,1024),'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[call setHcveResult(nvl(\
  field('\s+',2,grepCommand('/usr/sbin/prtconf','Memory','f')),\
  0))
]]></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="SWAPNotSet" result="FAILED" value="Amount of swap space was not determined."><![CDATA[Requires amount of swap space.]]></sdp_dependency>
<sdp_dependency condition=">" id="A00250" minimum="0" result="FAILED" value="No swap space was found."><![CDATA[There must be 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(\
  and(expr('>=',$mem,1024),expr('<',$mem,2048)),\
    cond(expr('<',$swp,expr('*',$mem,1.5)), 'SwapToRAMTooLow','SwapToRAMOK'),\
  and(expr('>=',$mem,2048),expr('<',$mem,16384)),\
    cond(expr('<',$swp,$mem),               'SwapToRAMTooLow','SwapToRAMOK'),\
  expr('>=',$mem,16384),\
    cond(expr('<',$swp,16384),              'SwapToRAMTooLow','SwapToRAMOK'),\
                                            '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 R2 Release 2 (11.2) for Solaris Operating System''.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" maximum="N" minimum="SwapToRAMOK" result="PASSED"><![CDATA[The amount of swap space meets the minimum requirements for installing Oracle Database 11g R2. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The amount of swap space is less than the amount recommended in the ${'BOOK}. Verify the requirements and adjust your system accordingly.
|*Return Value*|*Action*|
|SwapNotDetermined|ALERT- A Swap to Memory ratio cannot be determined because swap is not set up or you do not have execute permissions to determine swap|
|SwapToRAMTooLow|ALERT- You need to increase Swap space. For RAM between 1 GB and 2 GB, the swap space needs to be at least 1.5 times the amount of RAM. For RAM between 2 GB and 16GB, the swap space needs to be at least equal to the amount of RAM. For RAM greater than 16 GB, the swap space needs 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 = field('\s+',1,grepCommand(concat('/usr/sbin/ping -a ',$hst),'.','f'))
call setHcveResult(substr($ip,1,expr('-',length($ip),2)))
]]></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 $ip = "%A00290%"
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/sbin/nslookup')
{if $nam
 {var $nsl = field(concat(quote($nam),'\.'),1,\
                  grepCommand(concat('/usr/sbin/nslookup ',$hst),'Name','f'))
 }
 else
 {var $nsl = field(concat(quote($hst),'\.'),1,\
                  grepCommand(concat('/usr/sbin/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[The 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 IP address.]]></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/sbin/nslookup')),\
    'Cannot access /usr/sbin/nslookup',\
  and(grepCommand(concat('/usr/sbin/nslookup ',$hst),quote($ip),'f'),\
      grepCommand(concat('/usr/sbin/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/sbin/nslookup|Grant execute permissions on ``/usr/sbin/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[import $OS_VER
var @tbl = ()
var $NOEXEC_USER_STACK_REQD = 1
var $SEMMNI_REQD = 100
var $SEMMNS_REQD = 1024
var $SEMMSL_REQD = 256
var $SEMVMX_REQD = 32767
var $SHMMAX_REQD = 4294967295
var $SHMMNI_REQD = 100
if !loadCommand('/etc/sysdef')
 return setHcveResult('NoAccess')
var $NOEXEC_USER_STACK = field('\s+',0,grepLastFile('NOEXEC_USER_STACK','f'))
var $SEMMNI = field('\s+',0,grepLastFile('SEMMNI','f'))
var $SEMMNS = field('\s+',0,grepLastFile('SEMMNS','f'))
var $SEMMSL = field('\s+',0,grepLastFile('SEMMSL','f'))
var $SEMVMX = field('\s+',0,grepLastFile('SEMVMX','f'))
var $SHMMAX = field('\s+',0,grepLastFile('SHMMAX','f'))
var $SHMMNI = field('\s+',0,grepLastFile('SHMMNI','f'))

if !defined($NOEXEC_USER_STACK)
{if grepFile('/etc/system',\
        '^\s*set\s+[^\s\*\#]*\bNOEXEC_USER_STACK\s*=\s*(0x[A-F\d]+|\d+)','fi1')
 {var ($val) = last
  var $NOEXEC_USER_STACK = check($val,'^0',oct2int($val),$val)
 }
}

macro chk_min
{var (\@tbl,$nam,$ref,$val) = @arg
 if !defined($val)
 {call push(@tbl,concat($nam,'Undef'))
  return
 }
 if expr('<',$val,$ref)
  call push(@tbl,concat($nam,'TooSmall'))
}
if match($OS_VER,'^2\.9$')
{call chk_min(\@tbl,'NOEXEC_USER_STACK',$NOEXEC_USER_STACK_REQD,\
                                        $NOEXEC_USER_STACK)
 call chk_min(\@tbl,'SEMMNI',$SEMMNI_REQD,$SEMMNI)
 call chk_min(\@tbl,'SEMMNS',$SEMMNS_REQD,$SEMMNS)
 call chk_min(\@tbl,'SEMMSL',$SEMMSL_REQD,$SEMMSL)
 call chk_min(\@tbl,'SEMVMX',$SEMVMX_REQD,$SEMVMX)
 call chk_min(\@tbl,'SHMMAX',$SHMMAX_REQD,$SHMMAX)
 call chk_min(\@tbl,'SHMMNI',$SHMMNI_REQD,$SHMMNI)
}
elsif match($OS_VER,'^2\.10$')
{macro chk_param
 {var ($cmd,$prj) = @arg
  var ($lin) = grepCommand(concat($cmd,' -n ',$prj,' ',${RDA.PID}),\
                           '(basic|privileged|system)','if')
  if match($lin,'\b(\d+(\.\d*)?)(\w*)\b')
   var ($siz,undef,$typ) = (last)
  return check(uc($typ),'^KB?$',expr('*',$siz,1024),\
                        '^MB?$',expr('*',$siz,1048576),\
                        '^GB?$',expr('*',$siz,1073741824),\
                        '^TB?$',expr('*',$siz,1099511627776),\
                        '^PB?$',expr('*',$siz,1125899906842624),\
                        '^EB?$',expr('*',$siz,1152921504606846976),\
                                $siz)
 }
 var $cmd = findCommand('prctl')
 call chk_min(\@tbl,'NOEXEC_USER_STACK',$NOEXEC_USER_STACK_REQD,\
                                        $NOEXEC_USER_STACK)
 call chk_min(\@tbl,'SEMMNI',$SEMMNI_REQD,\
                             chk_param($cmd,'project.max-sem-ids'))
 call chk_min(\@tbl,'SEMMSL',$SEMMSL_REQD,\
                             chk_param($cmd,'process.max-sem-nsems'))
 call chk_min(\@tbl,'SHMMAX',$SHMMAX_REQD,\
                             chk_param($cmd,'project.max-shm-memory'))
 call chk_min(\@tbl,'SHMMNI',$SHMMNI_REQD,\
                             chk_param($cmd,'project.max-shm-ids'))
}
else
 call push(@tbl,'Uncertified SunOS')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'KernelOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule verifies that the kernel parameters are set according to the ''Oracle Database Installation Guide 11g Release 2 (11.2) for Solaris''.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" maximum="N" minimum="KernelOK" result="PASSED" syntax="wiki"><![CDATA[The kernel parameters are set according to the ${'BOOK}. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[The kernel parameters are not set according to the ${'BOOK}. For the recommended values, see the ${'BOOK}. If they have been set in the ``/etc/system`` file, then you may have to add the following to set the parameters at boot time:%BR%
``forceload: sys/semsys%BR%``
``forceload: sys/shmsys%BR%``
When you make the changes in the ``/etc/system`` file, save the file and reboot to take effect.%BR%
In Solaris 10, you are not required to make changes to the ``/etc/system`` file to implement the System V IPC. Solaris 10 uses the resource control facility for its implementation.
|*Return Value*|*Action*|
|NOEXEC_USER_STACKTooSmall|Increase the kernel parameter NOEXEC_USER_STACK to 1|
|NOEXEC_USER_STACKUndef|NOEXEC_USER_STACK is not defined and must be set to 1|
|SEMMNITooSmall|Increase the kernel parameter SEMMNI to 100|
|SEMMNIUndef|SEMMNI is not defined and must be set to 100|
|SEMMNSTooSmall|Increase the kernel parameter SEMMNS to at least 1024|
|SEMMNSUndef|SEMMNS is not defined and must be set to 1024|
|SEMMSLTooSmall|Increase the kernel parameter SEMMSL to at least 256|
|SEMMSLUndef|SEMMSL is not defined and must be set to 256|
|SEMVMXTooSmall|Increase the kernel parameter SEMVMX to 32767|
|SEMVMXUndef|SEMVMX is not defined and must be set to 32767|
|SHMMAXTooSmall|Increase the kernel parameter SHMMAX to 4294967295|
|SHMMAXUndef|SHMMAX is not defined and must be set to 4294967295|
|SHMMNITooSmall|Increase the kernel parameter SHMMNI to at least 100|
|SHMMNIUndef|SHMMNI is not defined and must be set to 100 or more|
|NoAccess|You do not have access to ``/etc/sysdef``|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00402" mode="VERIFY" name="anon port range OK?">
<sdp_command type="RDA"><![CDATA[var @tbl = ()
var @tmp = command('/usr/sbin/ndd /dev/tcp tcp_smallest_anon_port tcp_largest_anon_port 2>&1')
if !match($tmp[0],'^9000\b')
 call push(@tbl,'tcp_smallest')
if !match($tmp[2],'^65500\b')
 call push(@tbl,'tcp_largest')
var @tmp = command('/usr/sbin/ndd /dev/udp udp_smallest_anon_port udp_largest_anon_port 2>&1')
if !match($tmp[0],'^9000\b')
 call push(@tbl,'udp_smallest')
if !match($tmp[2],'^65500\b')
 call push(@tbl,'udp_largest')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'RangesOK'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks that the TCP and UDP port ranges are set to Oracle's recommendation.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="RangesOK" result="PASSED"><![CDATA[The TCP and UDP port ranges are set to Oracle's recommendation. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[|*Return Value*|*Action*|
|tcp_smallest|Oracle recommends setting ``tcp_smallest_anon_port`` to 9000. Refer to the ${'BOOK}.|
|tcp_largest|Oracle recommends setting ``tcp_largest_anon_port`` to 65500. Refer to the ${'BOOK}.|
|udp_smallest|Oracle recommends setting ``udp_smallest_anon_port`` to 9000. Refer to the ${'BOOK}.|
|udp_largest|Oracle recommends setting ``udp_largest_anon_port`` to 65500. Refer to the ${'BOOK}.|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00410" mode="VERIFY" name="Got OS Patches?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00010" minimum="PASSED" result="SKIPPED" value="OS patches are only specified for certified OS"><![CDATA[Requires certified OS.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_ARC
var @tbl = ()
macro check_patch
{var (\@tbl,@pch) = @arg
 loop $pch (@pch)
 {var ($flg,$err) = (true)
  var ($pch_num,$pch_lvl) = split('\-',$pch)
  if grepLastFile($pch_num,'f')
  {var %srt = ()
   if grepLastFile(concat('Patch: ',$pch_num,'\-'))
   {loop $key (last)
     var $srt{$key} = true
    var $pch_rev = field('\s+',1,keys(%srt,'KD'))
    next compare('ge',replace($pch_rev,'\-'),replace($pch,'\-'))
    var $err = concat('Patch [',$pch_rev,'] must be at level [',$pch,']')
   }
   loop $lin (grepLastFile(concat('Obsoletes:.*',$pch_num,'.*Requires:')))
   {var ($lvl) = match($lin,concat('.*Obsoletes:.*?',$pch_num,'\-(\d+)'))
    if compare('ge',$lvl,$pch_lvl)
    {var $flg = false
     break
    }
   }
   if $flg
    call push(@tbl,nvl($err,concat('Patch [',$pch_num,'] is not installed')))
  }
  else
   call push(@tbl,concat('Patch [',$pch_num,'] is not installed'))
 }
}
call loadCommand('/usr/bin/showrev -p')
if match($OS_ARC,'Sparc')
 call check_patch(\@tbl,'120753-06','139574-03')
elsif match($OS_ARC,'Intel')
 call check_patch(\@tbl,'120754-06','119961-05','119964-14','137104-02',\
                        '139575-03','139556-08')
else
 call push(@tbl,'OS version is not certified')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'adequate'))
]]></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="adequate" result="PASSED"><![CDATA[All required OS patches are adequate. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required OS patches for the installation of Oracle Database 11g R2 were not met or found. Review the recommended OS patches from the ${'BOOK} before installing the software.
|*Return Value*|*Action*|
|Patch ... is not installed|Verify that the required OS patches are installed.%BR%For Solaris 10 on SPARC: 120753-06, 139574-03%BR%For Solaris 10 on x86-64: 120754-06, 119961-05, 119964-14, 137104-02, 139575-03, 139556-08|
|Patch ... must be at level ...|Verify that the level of the required OS patches is equal to or higher than the specified level.%BR%For Solaris 10 on SPARC: 120753-06, 139574-03%BR%For Solaris 10 on x86-64: 120754-06, 119961-05, 119964-14, 137104-02, 139575-03, 139556-08|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00420" mode="VERIFY" name="Got C compiler OS Patches?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00010" minimum="PASSED" result="SKIPPED" value="OS patches are only specified for certified OS"><![CDATA[Requires certified OS.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_ARC
var @tbl = ()
macro check_patch
{var (\@tbl,@pch) = @arg
 loop $pch (@pch)
 {var ($flg,$err) = (true)
  var ($pch_num,$pch_lvl) = split('\-',$pch)
  if grepLastFile($pch_num,'f')
  {var %srt = ()
   if grepLastFile(concat('Patch: ',$pch_num,'\-'))
   {loop $key (last)
     var $srt{$key} = true
    var $pch_rev = field('\s+',1,keys(%srt,'KD'))
    next compare('ge',replace($pch_rev,'\-'),replace($pch,'\-'))
    var $err = concat('Patch [',$pch_rev,'] must be at level [',$pch,']')
   }
   loop $lin (grepLastFile(concat('Obsoletes:.*',$pch_num,'.*Requires:')))
   {var ($lvl) = match($lin,concat('.*Obsoletes:.*?',$pch_num,'\-(\d+)'))
    if compare('ge',$lvl,$pch_lvl)
    {var $flg = false
     break
    }
   }
   if $flg
    call push(@tbl,nvl($err,concat('Patch [',$pch_num,'] is not installed')))
  }
  else
   call push(@tbl,concat('Patch [',$pch_num,'] is not installed'))
 }
}
call loadCommand('/usr/bin/showrev -p')
if match($OS_ARC,'Sparc')
 call check_patch(\@tbl,'119963-14','124861-15')
elsif match($OS_ARC,'Intel')
 return setHcveResult('Adequate - No C+ patches specified for x86-64')
else
 call push(@tbl,'OS version is not certified')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'Adequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks for the OS patches for C compiler usage required for the Oracle Database 11g R2.]]></sdp_description>
<sdp_actions>
<sdp_action condition="=~" minimum="^Adequate" result="PASSED"><![CDATA[All required OS patches are adequate. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required OS patches for Oracle Database 11g R2 where a C compiler will be used were not met or found. Review the recommended OS patches from the ${'BOOK} before installing the software.
|*Return Value*|*Action*|
|Patch ... is not installed|Verify that the required OS patches for C compiler usage are installed.%BR%For Solaris on SPARC: 119963-14, 124861-15|
|Patch ... must be at level ...|Verify that the level of the required OS patches for C compiler usage is equal to or higher than the specified level.%BR%For Solaris 10 on SPARC: 119963-14, 124861-15|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00425" mode="VERIFY" name="Got Database Smart Flash Cache OS Patches?">
<sdp_dependencies>
<sdp_dependency condition="IS" id="A00010" minimum="PASSED" result="SKIPPED" value="OS patches are only specified for certified OS"><![CDATA[Requires certified OS.]]></sdp_dependency>
</sdp_dependencies>
<sdp_command type="RDA"><![CDATA[import $OS_ARC
var @tbl = ()
macro check_patch
{var (\@tbl,@pch) = @arg
 loop $pch (@pch)
 {var ($flg,$err) = (true)
  var ($pch_num,$pch_lvl) = split('\-',$pch)
  if grepLastFile($pch_num,'f')
  {var %srt = ()
   if grepLastFile(concat('Patch: ',$pch_num,'\-'))
   {loop $key (last)
     var $srt{$key} = true
    var $pch_rev = field('\s+',1,keys(%srt,'KD'))
    next compare('ge',replace($pch_rev,'\-'),replace($pch,'\-'))
    var $err = concat('Patch [',$pch_rev,'] must be at level [',$pch,']')
   }
   loop $lin (grepLastFile(concat('Obsoletes:.*',$pch_num,'.*Requires:')))
   {var ($lvl) = match($lin,concat('.*Obsoletes:.*?',$pch_num,'\-(\d+)'))
    if compare('ge',$lvl,$pch_lvl)
    {var $flg = false
     break
    }
   }
   if $flg
    call push(@tbl,nvl($err,concat('Patch [',$pch_num,'] is not installed')))
  }
  else
   call push(@tbl,concat('Patch [',$pch_num,'] is not installed'))
 }
}
call loadCommand('/usr/bin/showrev -p')
if match($OS_ARC,'Sparc')
 call check_patch(\@tbl,'125555-03','140796-01','140899-01','141016-01',\
                        '139555-08','141414-10','141736-05')
elsif match($OS_ARC,'Intel')
 call check_patch(\@tbl,'140797-01','140900-01','141017-01','141415-10',\
                        '141737-05')
call setHcveResult(cond(scalar(@tbl),join("\012",@tbl),'adequate'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks for the OS patches for usage of Database Smart Flash Cache required for the Oracle Database 11g R2 installation.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="adequate" result="PASSED"><![CDATA[All required OS patches are adequate. No action required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Some of the required OS patches for Oracle Database 11g R2 where Database Smart Flash Cache will be used were not met or found. If you are going to use Database Smart Flash Cache, review the recommended OS patches from the ${'BOOK} before installing the software.
|*Return Value*|*Action*|
|Patch ... is not installed|Verify that the required OS patches for Database Smart Flash Cache usage are installed.%BR%For Solaris 10 on SPARC: 125555-03, 140796-01, 140899-01, 141016-01, 139555-08, 141414-10, 141736-05%BR%For Solaris 10 on x86-64: 140797-01, 140900-01, 141017-01, 141415-10, 141737-05|
|Patch ... must be at level ...|Verify that the level of the required OS patches for Database Smart Flash Cache usage is equal to or higher than the specified level.%BR%For Solaris 10 on SPARC: 125555-03, 140796-01, 140899-01, 141016-01, 139555-08, 141414-10, 141736-05%BR%For Solaris 10 on x86-64: 140797-01, 140900-01, 141017-01, 141415-10, 141737-05|
]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00430" mode="VERIFY" name="Got OS Packages?">
<sdp_command type="RDA"><![CDATA[var @tbl = ()
macro check_package
{var (\@tbl) = @arg
 call loadCommand('/usr/bin/pkginfo')
 var @pkg = ('arc','btool','hea','libC','libm','libms','sprot','too','i1of',\
             'i1cs','i15cs','xwfnt','csl')
 loop $pkg (split('\s',concat('SUNW',join(' SUNW',@pkg))))
 {if not(grepLastFile($pkg,'f'))
   call push(@tbl,$pkg)
 }
}
call check_package(\@tbl)
if expr('==',$OS_BIT,32)
 call push(@tbl,\
             'OS is not showing as running as 64bit bit, investigate')
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 were not found. Check your installation.
|*Return Value*|*Action*|
|SUNWarc|SUNWarc package must be installed|
|SUNWbtool|SUNWbtool package must be installed|
|SUNWhea|SUNWhea package must be installed|
|SUNWlibC|SUNWlibC package must be installed|
|SUNWlibm|SUNWlibm package must be installed|
|SUNWlibms|SUNWlibms package must be installed|
|SUNWsprot|SUNWsprot package must be installed|
|SUNWtoo|SUNWtoo package must be installed|
|SUNWi1of|SUNWi1of package must be installed|
|SUNWi1cs|SUNWi1cs package must be installed|
|SUNWi15cs|SUNWi15cs package must be installed|
|SUNWxwfnt|SUNWxwfnt package must be installed|
|SUNWcsl|SUNWcsl package must be installed|]]></sdp_action>
</sdp_actions>
</sdp_rule>

<sdp_rule id="A00580" mode="VERIFY" name="Cluster Information">
<sdp_command type="RDA"><![CDATA[macro cluster_info
{var ($cmd,$pat) = @arg
 var $clu_up = field('\s+',0,grepCommand($cmd,$pat,'c'))
 return cond(expr('==',$clu_up,0),'ClusterWarning')
}
var $ver = cond(\
 testFile('f','/usr/cluster/bin/scconf'),              '3X',\
 testFile('f','/opt/SUNWcluster/bin/get_node_status'), '2X')
var $clu = check(\
 $ver,'2X',cluster_info('/opt/SUNWcluster/bin/get_node_status','membership:'),\
      '3X',cluster_info('/usr/cluster/bin/scstat -n','Online'))
call setHcveResult(cond($clu,$clu,'TestCompleted'))
]]></sdp_command>
<sdp_description><![CDATA[This rule checks the status of the Sun Cluster.]]></sdp_description>
<sdp_actions>
<sdp_action condition="==" minimum="TestCompleted" result="PASSED"><![CDATA[The Sun Cluster status test is completed. If you do not have a Sun Cluster, then this test does not apply. Otherwise, a cluster was detected and is running. No action is required.]]></sdp_action>
<sdp_action result="FAILED" syntax="wiki"><![CDATA[Your Sun Cluster is not in good status. Refer to following return code information:
|*Return Value*|*Action*|
|ClusterWarning|No members of your cluster are in the UP status and the Real Application Cluster (RAC) option cannot be installed. Because a cluster has been detected or partially detected during a Typical Installation, the RAC option is installed automatically. This causes problems. Oracle recommends using the Custom Install and deselecting the RAC option to avoid any problems.|
|TestCompleted|If you do not have a Sun Cluster, then this test does not apply. Otherwise, a cluster was detected and is up. No action is required.|]]></sdp_action>
</sdp_actions>
</sdp_rule>

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



