<proc:Procedure xmlns:proc="http://www.oracle.com/DataCenter/Procedure" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com/DataCenter/Procedure C:\Dev\DataCenter\xsd\Procedure.xsd" version="1.0" name="patchcpuopatch" description="Metadata and Procedure for PSU patches to be applied using opatch">
<!--
    This procedure requires the following arguments
           oracle_home: the Oracle Home being patched
           emd_root: the Agent Oracle Home on the host being patched
           patch_script: the script that does the patch (opatch.pl by default)
           patch_id: patch_id
           patch_loc: the location the patch is staged
           sql_script: the script that runs the sql commands (catcpu.sql by default), needs to be an empty string for patches without sql
           cpuname: the name of the CPU in CPUMonyyyy format - each CPU patch needs to supply the value for this in the defaultValue in this XML


-->
<proc:Argument name="oracle_home" ofType="string" ofDomain="Provisioning" />
<proc:Argument name="emd_root" ofType="string" ofDomain="Provisioning" />
<proc:Argument name="patch_script" ofType="string" ofDomain="Provisioning" defaultValue="opatch.pl" />
<proc:Argument name="patch_id" ofType="string" ofDomain="Provisioning" />
<proc:Argument name="patch_loc" ofType="string" ofDomain="Provisioning" />
<proc:Argument name="sql_script" ofType="string" ofDomain="Provisioning" defaultValue="catpsu.sql" />
<proc:Argument name="sql_rollback_script" ofType="string" ofDomain="Provisioning" defaultValue="catpsu_rollback.sql" />
<proc:Argument name="cpuname" ofType="string" ofDomain="Provisioning" defaultValue="11.2.0.3.10" />
<!--

       There is no outcome section for this procedure


-->
<!--

       The first script is to patch the software bits in an Oracle Home
       This produces a result - an exit code


-->
<proc:Script name="patchStep" flavor="PATCH" mode="PERL">
<proc:Parameter name="script_loc" ofType="string" ofDomain="Provisioning" assignment="A$patch_loc" />
<proc:Parameter name="script" ofType="string" ofDomain="Provisioning" assignment="A$patch_script" />
<proc:Result name="exitCode" ofType="integer" ofDomain="Provisioning" maker="oracle.sysman.dc.Procedure:exitCode" />
</proc:Script>
<!--

       The second script is to apply SQL.
       It has to be executed only if the first script exit code is zero


-->
<proc:Script name="sqlStep" flavor="SQL" mode="SQL" condition="P$patchStep:exitCode == 0">
<proc:Parameter name="script_loc" ofType="string" ofDomain="Provisioning" assignment="A$oracle_home/psu/A$cpuname" />
<proc:Parameter name="script" ofType="string" ofDomain="Provisioning" assignment="A$sql_script" />
<proc:Parameter name="rollbackscript" ofType="string" ofDomain="Provisioning" assignment="A$sql_rollback_script" />
</proc:Script>
</proc:Procedure>
