If you are using Customization Manager and you wanted to execute a custom shell script during the deployment of a custom patch, you could achieve it by following the steps below:
1. Add the following driver instruction to the shell script:
# exec <product> bin <filename> bin &phase=first checkfile:<product>:bin:<filename> <arguments to script>
# dbdrv: exec xxco bin lokesh.sh bin &phase=first checkfile:xxco:bin:lokesh.sh hello
2. The shell script should have a shebang line with proper $Header information.
The $Header format should be:
# $Header: <file name> <version> 2002/06/06 09:38 <author> noship $
3. Create customization package including this script and deploy it using Patch Manager.
We have followed the method explained above to execute shell scripts through CMP. We are able to execute the shell script when we deploy the script file for the first time.
However, we are unable to execute the same script when we deploy it again unless the file is modified. Please let us know if we are missing something.
Oracle patching utility (adpatch) is optimized not to execute/copy the file unless the version in the $Header is higher in the patch as compared to the instance. Please bump up the $Header version within the script and update the package to pull in the changed file. When you deploy the package again, the file should get invoked.