For an upgrade of my scripts to FMW 12.2.1.1, I did a Google-search on it and found: http://stackoverflow.com/questions/415677/how-to-replace-placeholders-in-a-text-file. The top 2 suggestions were:
- sed -e "s/\${i}/1/" -e "s/\${word}/dog/" template.txt
- i=32 word=foo envsubst < template.txt
So let's say my response file template looks like:
[ENGINE] #DO NOT CHANGE THIS. Response File Version=1.0.0.0.0 [GENERIC] #Set this to true if you wish to skip software updates DECLINE_AUTO_UPDATES=true # MOS_USERNAME= # MOS_PASSWORD=<SECURE VALUE> #If the Software updates are already downloaded and available on your local system, then specify the path to the directory where these patches are available and set SPECIFY_DOWNLOAD_LOCATION to true AUTO_UPDATES_LOCATION= # SOFTWARE_UPDATES_PROXY_SERVER= # SOFTWARE_UPDATES_PROXY_PORT= # SOFTWARE_UPDATES_PROXY_USER= # SOFTWARE_UPDATES_PROXY_PASSWORD=<SECURE VALUE> #The oracle home location. This can be an existing Oracle Home or a new Oracle Home ORACLE_HOME=${FMW_HOME} #Set this variable value to the Installation Type selected. e.g. Fusion Middleware Infrastructure, Fusion Middleware Infrastructure With Examples. INSTALL_TYPE=Fusion Middleware Infrastructure #Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name. MYORACLESUPPORT_USERNAME= #Provide the My Oracle Support Password MYORACLESUPPORT_PASSWORD=<SECURE VALUE> #Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration DECLINE_SECURITY_UPDATES=true #Set this to true if My Oracle Support Password is specified SECURITY_UPDATES_VIA_MYORACLESUPPORT=false #Provide the Proxy Host PROXY_HOST= #Provide the Proxy Port PROXY_PORT= #Provide the Proxy Username PROXY_USER= #Provide the Proxy Password PROXY_PWD=<SECURE VALUE> #Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port] COLLECTOR_SUPPORTHUB_URL=
Saved as 'fmw_12.2.1.1.0_infrastructure.rsp.tpl'; note the reference ORACLE_HOME=${FMW_HOME}. And I have set FMW_HOME with an fmw12c_env.sh script, as described in former posts. Then I only have to do:
envsubst < fmw_12.2.1.1.0_infrastructure.rsp.tpl >>fmw_12.2.1.1.0_infrastructure.rspTo have the file copied to fmw_12.2.1.1.0_infrastructure.rsp with a replaced FMW_HOME variable:
... # SOFTWARE_UPDATES_PROXY_PASSWORD=<SECURE VALUE> #The oracle home location. This can be an existing Oracle Home or a new Oracle Home ORACLE_HOME=/u01/app/oracle/FMW12211 #Set this variable value to the Installation Type selected. e.g. Fusion Middleware Infrastructure, Fusion Middleware Infrastructure With Examples. INSTALL_TYPE=Fusion Middleware Infrastructure ...
Couldn't be more simple, I'd say. Nice thing is that this enables me to do more directives. So, learned something again, from a question dated 7,5 years ago...
No comments :
Post a Comment