In older Oracle database releases, you would use the clone.pl script to create a copy of your Oracle Home. This process is much faster (and easier) than installing the database software and patches on a new host and guarantees that the new installation is identical to the old one.
This functionality was deprecated with the release of Oracle Database version 18c. It still works, but Oracle recommends using runInstaller’s -createGoldImage option instead. With good reason—it’s a multi-step process that includes manually removing configuration files present in the original home. Creating a Gold Image is a single step, and the result is a zip file that works identically to the vanilla software installation files downloaded from Oracle—but with all the patches of your custom installation embedded. It’s ready to use to create a new, custom database home.
Or, nearly so.
Don’t Clone Production Homes
Oracle’s instructions for cloning direct users to manually clean up configuration files from ORACLE_HOME/dbs and ORACLE_HOME/network/admin. This keeps sensitive data from being moved across the environment and prevents potentially confusing and dangerous situations. Imagine production and development environments that use the same TNS aliases for different systems within each stack. Copying the production tnsnames.ora to development could have disastrous effects. Likewise, sharing a production password file allows users privileged access to the production database from the development environment.
The -createGoldImage functionality automates this step for the network/admin directory but does not clean up the dbs
directory. That means anything stored in the source database’s dbs
directory is in the Gold Image, including the lock, health check, parameter, and password files:
[oracle - ORCL] /u01/app/oracle/product/19.21/dbhome_1
# ./runInstaller -silent -createGoldImage -destinationLocation /u02/app/oracle/oradata
Launching Oracle Database Setup Wizard...
Successfully Setup Software.
Gold Image location: /u02/app/oracle/oradata/db_home_2023-11-07_02-58-43PM.zip
# unzip -l /u02/app/oracle/oradata/db_home_2023-11-07_02-58-43PM.zip | grep -E "\bdbs/"
0 11-07-2023 14:58 dbs/
24 11-06-2023 17:17 dbs/lkORCL
3079 05-14-2015 09:32 dbs/init.ora
1544 11-07-2023 14:44 dbs/hc_ORCL.dat
47 11-06-2023 17:17 dbs/orapwORCL
52 11-06-2023 17:17 dbs/spfileORCL.ora
I’ve identified this behavior in Oracle 19c, 21c, and 23.3, and Oracle has confirmed it as a bug. A fix is anticipated for version 23.4 or 23.5 and should then be backported to 19c and 21c.
In the meantime, you can work around this by manually removing files under ORACLE_HOME/dbs immediately after creating the Gold Image or creating Gold Images in a “clean” environment without a database.
SUBMIT YOUR COMMENT