Chapter 2. Building a 3scale API Management system image with the Oracle Database relational database management system
By default, the Red Hat 3scale API Management system component stores configuration data in a MySQL database. You have the option to override the default database and store your information in an external Oracle Database. Follow the steps in this document to build a custom system container image with your own Oracle Database client binaries and deploy 3scale to OpenShift.
2.1. Before you begin
2.1.1. Obtain Oracle software components
Before you can build the custom 3scale system container image, you must acquire a supported version of the following Oracle software components:
- Oracle Instant Client Package Basic or Basic Light
- Oracle Instant Client Package SDK
- Oracle Instant Client Package ODBC
2.1.2. Meet prerequisites
You must also meet the following prerequisites:
- A supported version of Oracle Database accessible from your OpenShift cluster
- Access to the Oracle Database system user for installation procedures
- Possess the Red Hat 3scale 2.3 amp.yml template
2.2. Preparing Oracle Database
Create a new database. Collect the following information:
- Oracle Database URL
- Oracle Database service name
- Oracle Database system user name and password
- Oracle Database service name
For information on creating a new database in Oracle Database, refer to the Oracle documentation.
2.3. Building the system image
- clone the 3scale-amp-openshift-templates github repository
-
place your Oracle Database Instant Client Package files into the
3scale-amp-openshift-templates/amp/system-oracle/oracle-client-filesdirectory run the
oc new-appcommand with the -f option and specify thebuild.ymlOpenShift template$ oc new-app -f build.yml
run the
oc new-appcommand with the -f option, specifying theamp.ymlOpenShift template, and the -p option, specifying theWILDCARD_DOMAINparameter with the domain of your OpenShift cluster$ oc new-app -f amp.yml -p WILDCARD_DOMAIN=example.com
enter the following shell
forloop command, specifying the following information you collected in the Preparing Oracle Database section previously:-
{USER}: the username that will represent 3scale in your Oracle Database -
{PASSWORD}: the password forUSER -
{ORACLE_DB_URL}: the URL of your Oracle Database -
{DATABASE}: the service name of the database you created in Oracle Database {PORT}: the port number of your Oracle Databasefor dc in system-app system-resque system-sidekiq system-sphinx; do oc env dc/$dc --overwrite DATABASE_URL="oracle-enhanced://{USER}:{PASSWORD}@{ORACLE_DB_URL}:{PORT}/{DATABASE}"; done
-
enter the following
oc patchcommand, specifying the sameUSER,PASSWORD,ORACLE_DB_URL,PORT, andDATABASEvalues that you provided in the previous step above:$ oc patch dc/system-app -p '[{"op": "replace", "path": "/spec/strategy/rollingParams/pre/execNewPod/env/1/value", "value": "oracle-enhanced://{USER}:{PASSWORD}@{ORACLE_DB_URL}:{PORT}/{DATABASE}"}]' --type=jsonenter the following
oc patchcommand, specifying your own Oracle Database system user password in theSYSTEM_PASSWORDfield:$ oc patch dc/system-app -p '[{"op": "add", "path": "/spec/strategy/rollingParams/pre/execNewPod/env/-", "value": {"name": "ORACLE_SYSTEM_PASSWORD", "value": "SYSTEM_PASSWORD"}}]' --type=jsonenter the
oc start-buildcommand to build the new system image:oc start-build 3scale-amp-system-oracle --from-dir=.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.