Both gridSetup.sh in grid infrastructure and runInstaller in Oracle database software has the option to create gold images from an installation. This facilitate standardization and uniformity. Moreover each time a patch is applied a new gold image could be created which will include the patched binaries. So any new home created from the gold image will also include the patch. This post shows steps for creating gold image for grid infrastructure and oracle database.
Creating Gold Image of Grid Infrastructure
Gold image from a grid infrastructure setup is created using gridSetup.sh with the createGoldImage option. By default this expect X-windows to be available. If not the execution will fail.
Secondly the destination location must be at least 23GB, even though the final zip file generated could be 5-6 GB (depending on excluding certain files). Execution will fail if there isn't sufficient space
Creating Gold Image of Oracle Database
The gold image for Oracle database software is created using runInstaller.
Creating Gold Image of Grid Infrastructure
Gold image from a grid infrastructure setup is created using gridSetup.sh with the createGoldImage option. By default this expect X-windows to be available. If not the execution will fail.
./gridSetup.sh -createGoldImage -destinationLocation /media/giGold
ERROR: Unable to verify the graphical display setup. This application requires X display. Make sure that xdpyinfo exist under PATH variable.
Secondly the destination location must be at least 23GB, even though the final zip file generated could be 5-6 GB (depending on excluding certain files). Execution will fail if there isn't sufficient space
./gridSetup.sh -createGoldImage -destinationLocation /media/giGold -silentIf there's no risk of patches being rolled back, then the .patch_storage folder could be excluded from the gold image. This will reduce the size of the final zip file created. Other candidates for exclusions are files that have the server hostname in the name.
Launching Oracle Grid Infrastructure Setup Wizard...
[FATAL] [INS-32707] The specified destination location (/media/giGold) does not have enough free space.
ACTION: Provide a destination location path with at least (22,694) MB of free space.
./gridSetup.sh -createGoldImage -destinationLocation /media/giGold -silent -exclFiles $GI_HOME/.patch_storageAny new grid infrastructure installation done using the gold image will have the patches.
Launching Oracle Database Setup Wizard...
Successfully Setup Software.
Gold Image location: /media/giGold/grid_home_2019-03-26_12-20-38PM.zip
$ /opt/app/oracle/product/18.x.0/grid/OPatch/opatch lspatchesThe gold image doesn't zip all the files in the current installation. Some directories such as log directories are excluded automatically. In previous versions when installing from a gold image, these missing folders caused issue. But this appear to be fixed on 18c and no issues were encountered when a new installation was done using the gold image.
28864607;ACFS RELEASE UPDATE 18.5.0.0.0 (28864607)
28864593;OCW RELEASE UPDATE 18.5.0.0.0 (28864593)
28822489;Database Release Update : 18.5.0.0.190115 (28822489)
28547619;TOMCAT RELEASE UPDATE 18.0.0.0.0 (28547619)
28435192;DBWLM RELEASE UPDATE 18.0.0.0.0 (28435192)
27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
Creating Gold Image of Oracle Database
The gold image for Oracle database software is created using runInstaller.
./runInstaller -createGoldImage -destinationLocation /media/ohGold -silent -exclFiles $ORACLE_HOME/.patch_storageAs mentioned earlier patch storage could be excluded from the gold image. Any new database installation created using the gold image will have the patches already applied.
Launching Oracle Database Setup Wizard...
Successfully Setup Software.
Gold Image location: /media/ohGold/db_home_2019-03-26_03-35-48PM.zip
/opt/app/oracle/product/18.x.0/dbhome_1/OPatch/opatch lspatchesAny new database created will also have the post patch scripts applied.
28864593;OCW RELEASE UPDATE 18.5.0.0.0 (28864593)
28822489;Database Release Update : 18.5.0.0.190115 (28822489)
27908644;UPDATE 18.3 DATABASE CLIENT JDK IN ORACLE HOME TO JDK8U171
27923415;OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)
SQL> select PATCH_ID,PATCH_TYPE,ACTION,STATUS,SOURCE_VERSION,TARGET_VERSION,ACTION_TIME from dba_registry_sqlpatch;
PATCH_ID PATCH_TYPE ACTION STATUS SOURCE_VERSION TARGET_VERSION ACTION_TIME
---------- ---------- --------------- ------------------------- --------------- --------------- ------------------------------
28822489 RU APPLY SUCCESS 18.1.0.0.0 18.5.0.0.0 27-MAR-19 12.10.44.167872 PM
27923415 INTERIM APPLY SUCCESS 18.1.0.0.0 18.1.0.0.0 27-MAR-19 12.10.44.171197 PM