Cloning an Oracle Database Home Using an Image File

Learn how to clone an Oracle Database home using the -createGoldImage option.

Create an image file from the source Oracle home using the -createGoldImage option, unzip the image file, and perform a software-only Oracle Database installation to register the Oracle Database product.
  1. Log in as the Oracle installation owner user account (oracle).
  2. Go to the source Oracle home directory.
    $ cd /u01/app/oracle/product/21.0.0/dbhome_1
  3. Use the runInstaller command with the -createGoldImage option to create a gold image from the source Oracle home.

    For example, to create an image file of dbhome_1 and save it in the temporary destination location my_db_images:

    ./runInstaller -createGoldImage -destinationLocation /tmp/my_db_images
  4. Create a new OFA-compliant Oracle home directory and extract the image file that you have created in to this destination Oracle home directory. For example:
    $ mkdir -p /u01/app/oracle/product/21.0.0/dbhome_2
    $ cd /u01/app/oracle/product/21.0.0/dbhome_2
    $ unzip -q /tmp/my_db_images/db_home.zip

    Note:

    Oracle home or Oracle base cannot be symlinks, nor can any of their parent directories, all the way to up to the root directory.
  5. From this new destination Oracle home directory, run the runInstaller command to start the Oracle Database Setup Wizard and register Oracle Database.
    $ cd /u01/app/oracle/product/21.0.0/dbhome_2
    $ ./runInstaller
  6. In the Select Configuration Option screen, select Set Up Software Only to perform a software-only Oracle Database installation.
  7. Select your installation type and respond to the configuration prompts as needed.
  8. Provide information to automate root scripts, or run scripts as root when prompted by the setup wizard.

    Note:

    Click Help if you have any questions about the information you are asked to submit during installation.
  9. Oracle Database is now successfully registered. Run Oracle Database Configuration Assistant (Oracle DBCA) to create a database and configure the listener for the newly-cloned Oracle home.
    $ cd /u01/app/oracle/product/21.0.0/dbhome_2/bin
    $ ./dbca