Skip to content

Commit 376aada

Browse files
authored
Support to turn on archive log mode in the database (#1904)
* Enable support to turn on archive log mode in the database while creating the container or deploying using 19c docker image Signed-off-by: abhisbyk <abhishek.by.kumar@oracle.com> * Adding more info to readme files, changing enable_archive option of helm to enable_archivelog Signed-off-by: abhisbyk <abhishek.by.kumar@oracle.com>
1 parent a7824c0 commit 376aada

File tree

6 files changed

+19
-2
lines changed

6 files changed

+19
-2
lines changed

OracleDatabase/SingleInstance/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ To run your Oracle Database image use the `docker run` command as follows:
6868
-e INIT_PGA_SIZE=<your database PGA memory in MB> \
6969
-e ORACLE_EDITION=<your database edition> \
7070
-e ORACLE_CHARACTERSET=<your character set> \
71+
-e ENABLE_ARCHIVELOG=true \
7172
-v [<host mount point>:]/opt/oracle/oradata \
7273
oracle/database:19.3.0-ee
7374

@@ -89,6 +90,9 @@ To run your Oracle Database image use the `docker run` command as follows:
8990
Supported 19.3 onwards.
9091
-e ORACLE_CHARACTERSET:
9192
The character set to use when creating the database (default: AL32UTF8).
93+
-e ENABLE_ARCHIVELOG:
94+
To enable archive log mode when creating the database (default: false).
95+
Supported 19.3 onwards.
9296
-v /opt/oracle/oradata
9397
The data volume to use for the database.
9498
Has to be writable by the Unix "oracle" (uid: 54321) user inside the container!
@@ -136,6 +140,12 @@ The password for those accounts can be changed via the `docker exec` command. **
136140

137141
docker exec <container name> ./setPassword.sh <your password>
138142

143+
#### Enabling archive log mode while creating the database
144+
145+
Archive mode can be enabled during the first time when database is created by setting ENABLE_ARCHIVELOG to `true` and passing it to `docker run` command. Archive logs are stored at the directory location: `/opt/oracle/oradata/$ORACLE_SID/archive_logs` inside the container.
146+
147+
In case this parameter is set `true` and passed to `docker run` command while reusing existing datafiles, even though this parameter would be visible as set to `true` in the container environment, this would not be set inside the database. The value used at the time of database creation will be used.
148+
139149
#### Running Oracle Database 18c Express Edition in a container
140150

141151
To run your Oracle Database 18c Express Edition container image use the `docker run` command as follows:

OracleDatabase/SingleInstance/dockerfiles/19.3.0/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ ENV ORACLE_BASE=/opt/oracle \
5555
USER_SCRIPTS_FILE="runUserScripts.sh" \
5656
INSTALL_DB_BINARIES_FILE="installDBBinaries.sh" \
5757
RELINK_BINARY_FILE="relinkOracleBinary.sh" \
58-
SLIMMING=$SLIMMING
58+
SLIMMING=$SLIMMING \
59+
ENABLE_ARCHIVELOG=false
5960

6061
# Use second ENV so that variable get substituted
6162
ENV PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch/:/usr/sbin:$PATH \

OracleDatabase/SingleInstance/dockerfiles/19.3.0/createDB.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ DIAG_ADR_ENABLED = off
7272

7373
# Start LISTENER and run DBCA
7474
lsnrctl start &&
75-
dbca -silent -createDatabase -responseFile $ORACLE_BASE/dbca.rsp ||
75+
dbca -silent -createDatabase -enableArchive $ENABLE_ARCHIVELOG -archiveLogDest $ORACLE_BASE/oradata/$ORACLE_SID/archive_logs -responseFile $ORACLE_BASE/dbca.rsp ||
7676
cat /opt/oracle/cfgtoollogs/dbca/$ORACLE_SID/$ORACLE_SID.log ||
7777
cat /opt/oracle/cfgtoollogs/dbca/$ORACLE_SID.log
7878

OracleDatabase/SingleInstance/helm-charts/oracle-db/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ The following tables lists the configurable parameters of the Oracle Database c
8080
| image | Image to pull | container-registry.oracle.com/database/enterprise:19.3.0.0 |
8181
| imagePullPolicy | Image pull policy | Always |
8282
| imagePullSecrets | container registry login/password | |
83+
| enable_archivelog | Set true to enable archive log mode when creating the database | false |
8384
8485
8586
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

OracleDatabase/SingleInstance/helm-charts/oracle-db/templates/_helpers.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ env:
3939
value: {{ default "ORCLPDB1" .Values.oracle_characterset | quote }}
4040
- name: ORACLE_EDITION
4141
value: {{ default "enterprise" .Values.oracle_edition | quote }}
42+
- name: ENABLE_ARCHIVELOG
43+
value: {{ default false .Values.enable_archivelog | quote}}
4244
{{- end }}
4345
{{/* oracle db labels */}}
4446
{{- define "oracle-db-labels" }}

OracleDatabase/SingleInstance/helm-charts/oracle-db/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ oracle_characterset: AL32UTF8
2020
## The database edition (default: enterprise)
2121
oracle_edition: enterprise
2222

23+
## Enable archive log mode when creating the database
24+
enable_archivelog: false
25+
2326
## Enable persistence using Persistent Volume Claims
2427
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
2528
persistence:

0 commit comments

Comments
 (0)