Skip to content

Create Upgrade Images

Sean Scott edited this page Nov 1, 2020 · 1 revision

Introduction

Dockerfile.Upgrade creates an image with an OS image suitable for running both a source and target version of a database, as well as source and target homes and (optionally) adds Oracle's pre-upgrade and AutoUpgrade JAR files.

Running the image starts DBCA to create a source database as normal. When DBCA completes the database can be upgraded to the target version, using the target home directory.

Prerequisites

Populate the VERSION/install/* directories for both the source and target version as you would normally.

Copy the pre-upgrade and/or AuotUpgrade JAR files to the upgrade/ directory.

Build the Image

Build a default image, with an Oracle 12.1.0.2 database as the source and an Oracle 19.9.0 database as the target using the following command:

docker build -t <IMAGE_NAME> -f Dockerfile.Upgrade .

To use different versions, edit Dockerfile.Upgrade and change the ORACLE_VERSION and TARGET_VERSION, or supply the values to the build:

docker build --force-rm=true --no-cache=true \
       --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
       --build-arg ORACLE_VERSION=<source version> \
       --build-arg TARGET_VERSION=<target_version> \
       -t <IMAGE_NAME> -f Dockerfile.Upgrade .

Navigating the Container

The major differences found in the upgrade image are:

  • An extended environment based on the preinstall RPM of both the source and target versions
  • Presence of the target version ORACLE_HOME
  • Two additional environment variables:
    • TARGET_VERSION - The target database version
    • TARGET_HOME - The path to the new, target database home
  • Files and tools present in the upgrade/ directory during the build are copied to SCRIPTS_DIR (default: /opt/scripts)
  • Port 8080 is exposed to allow AutoUpgrade's status.html to be served