oracle-test 5.0/oracle-db 23.5 Upgrade and Data Loading Guide
oracle-test 5.0 (for helm-maven-plugin projects) and oracle-db (for skaffold/kustomize projects) use Oracle 23 Free.
This requires changes to where you put SQL scripts and the contents of your SQA scripts as some paths no longer exist.
The latest versions of oracle-db and oracle-test no longer have any SQL files loaded at startup. Any service that needs
either of these will have to stage their SQL files so that they can load them without overwriting the SQL files other dependencies load. This can be accomplished in similar ways with HMP based services and skaffold/kustomize based services. The path container-entrypoint-initdb.d in the docker container automatically runs any SQL or shell scripts.
Connection String Change for skaffold/kustomize projects
ORACLE_URL=jdbc:oracle:thin:@(DESCRIPTION= (CONNECT_TIMEOUT=15) (RETRY_COUNT=20) (RETRY_DELAY=3) (ADDRESS_LIST =(LOAD_BALANCE=ON) (ADDRESS= (PROTOCOL=tcp) (HOST=oracle-test-v4)(PORT=1521))) (CONNECT_DATA= (SERVICE_NAME=EE)))
ORACLE_URL=jdbc:oracle:thin:@(DESCRIPTION= (CONNECT_TIMEOUT=15) (RETRY_COUNT=20) (RETRY_DELAY=3) (ADDRESS_LIST =(LOAD_BALANCE=ON) (ADDRESS= (PROTOCOL=tcp) (HOST=oracle-db)(PORT=1521))) (CONNECT_DATA= (SERVICE_NAME=FREE)))`
The key part is the SERVICE_NAME has been updated to FREE along with changing HOST to oracle-db
Connection String Change for helm-maven-plugin projects
ORACLE_URL=jdbc:oracle:thin:@(DESCRIPTION= (CONNECT_TIMEOUT=15) (RETRY_COUNT=20) (RETRY_DELAY=3) (ADDRESS_LIST =(LOAD_BALANCE=ON) (ADDRESS= (PROTOCOL=tcp) (HOST=oracle-test-v4)(PORT=1521))) (CONNECT_DATA= (SERVICE_NAME=EE)))
ORACLE_URL=jdbc:oracle:thin:@(DESCRIPTION= (CONNECT_TIMEOUT=15) (RETRY_COUNT=20) (RETRY_DELAY=3) (ADDRESS_LIST =(LOAD_BALANCE=ON) (ADDRESS= (PROTOCOL=tcp) (HOST=oracle-test-v5)(PORT=1521))) (CONNECT_DATA= (SERVICE_NAME=FREE)))
The key part is the SERVICE_NAME has been updated to FREE along with changing the majorVersion for the oracle-test k8s service name
SQL Script changes
Updates to your SQL scripts. The EE path as follows no longer exists
CREATE TABLESPACE CALLBACK_DATA DATAFILE '/opt/oracle/oradata/EE/callback_data_ts.dbf' SIZE 50 M;
It needs to be changed to
CREATE TABLESPACE CALLBACK_DATA DATAFILE '/opt/oracle/oradata/callback_data_ts.dbf' SIZE 50 M;
HMP-based projects (oracle-test 5.0.x)
Below is an example using callback-service for how to configure a HMP based project.
SQL loading has changed locations in this base image as well to the below:
target: /docker-entrypoint-initdb.d/
target: /container-entrypoint-initdb.d/callback
oracle-test:
volumeMounts:
- source: db
target: /container-entrypoint-initdb.d/callback
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-db-scripts</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>package</phase>
<configuration>
<resources>
<resource>
<directory>${project.build.directory}/db</directory>
<includes>
<include>**/*.sql</include>
</includes>
</resource>
</resources>
<outputDirectory>${project.build.directory}/helm/callback-service-${project.version}/charts/oracle-test-${oracletest.version}/volumes/db/callback</outputDirectory>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
</plugin>
Kustomize-based projects (oracle-db 23.5)
There are references to oracle-test in multiple places in the kustomizations. You will want to change all those references to be oracle-db. It is highly recommended that you use the following commands to help troubleshoot issues where you have missed some oracle-test references.
kustomize build ./kubernetes/dev-with-dependencies
kustomize build ./kubernetes/debug-all
kustomize build ./kubernetes/sqa-build-test
Or any other overlay that happens to be failing during the localization command.
SQL loading has changed locations in this base image as well to the below:
mountPath: /docker-entrypoint-initdb.d/callback
mountPath: /container-entrypoint-initdb.d/callback
configMapGenerator:
- name: callback-service-app-config
behavior: merge
envs:
- application.env
- name: callback-oracle-db-configs
files:
- callback-db/sql/001-callback.sql
- callback-db/sql/002-callback.sql
- callback-db/sql/003-callback.sql
- callback-db/sql/004-callback.sql
- callback-db/sql/005-callback.sql
- callback-db/sql/006-callback.sql
- callback-db/sql/007-callback.sql
- callback-db/sql/008-callback-1.8.4.sql
containers:
- name: oracle-db
volumeMounts:
- name: callback-oracle-db-configs
mountPath: /container-entrypoint-initdb.d/callback
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-db-scripts</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>package</phase>
<configuration>
<resources>
<resource>
<directory>${project.build.directory}/db</directory>
<includes>
<include>**/*.sql</include>
</includes>
</resource>
</resources>
<outputDirectory>${project.basedir}/../kubernetes/components/dev/callback-db/</outputDirectory>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
</plugin>