Skip to content

Commit

Permalink
21c regular image improvements, DISABLE_OOB (#54)
Browse files Browse the repository at this point in the history
* Add artifactory upload

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

* Adding Container Example Start/Creation Script

* Incorporated feedback and fixes from pull request in example script

* Fix for #43

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

* Remove Oracle Memory Speed (OMS) PMEM binaries

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

* Remove MLE

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

* Added PWgen check

* Clean lastlog

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

* Add 21c backups

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

* Fix typo for 21 tests

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

* Fix for #50, set exec permissions for shell scripts

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

* Add utPLSQL as users

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

* Better GitHub Actions documentation as per #45

Signed-off-by: gvenzl <gerald.venzl@gmail.com>

Co-authored-by: Daniel Haanpaa [Lab0] <dhaanpaa@djhent.us>
  • Loading branch information
gvenzl and dhaanpaa-lab0 authored Nov 15, 2021
1 parent 359e20b commit 2c0b7b4
Show file tree
Hide file tree
Showing 11 changed files with 158 additions and 13 deletions.
18 changes: 18 additions & 0 deletions ImageDetails.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ A couple of modifications have been performed to make the installation more suit
* `COMMON_USER_PREFIX=''`
* `LOCAL_LISTENER=''`
* An `OPS$ORACLE` externally identified user has been created and granted `CONNECT` and `SELECT_CATALOG_ROLE` (this is used for health check and other operations)
* `DISABLE_OOB=ON` in `sqlnet.ora` (see https://github.com/gvenzl/oci-oracle-xe/issues/43)
* `BREAK_POLL_SKIP=1000` in `sqlnet.ora` (see https://github.com/gvenzl/oci-oracle-xe/issues/43)

#### Operating system

* `/var/log/lastlog` has been cleaned

### Regular image flavor (`21`)

Expand Down Expand Up @@ -56,6 +62,9 @@ The following binaries have been removed from the `$ORACLE_HOME/bin` directory:
* `$ORACLE_HOME}/bin/proc` (Pro\*C/C++ Precompiler)
* `$ORACLE_HOME/bin/procob` (Pro COBOL Precompiler)
* `$ORACLE_HOME/bin/orion` (ORacle IO Numbers benchmark tool)
* `$ORACLE_HOME/bin/oms_daemon` (Oracle Memory Speed (PMEM support) daemon)
* `$ORACLE_HOME/bin/omsfscmds` (Oracle Memory Speed (PMEM support) command line utility)


The following binaries have been replaced by shell scripts with static output:

Expand All @@ -67,6 +76,7 @@ The following binaries have been replaced by shell scripts with static output:

The following libraries have been removed from the `$ORACLE_HOME/lib` directory:

* `$ORACLE_HOME/lib/libmle.so` (Multilingual Engine)
* `$ORACLE_HOME/lib/libopc.so` (Oracle Public Cloud)
* `$ORACLE_HOME/lib/libosbws.so` (Oracle Secure Backup Cloud Module)
* `$ORACLE_HOME/lib/libra.so` (Recovery Appliance)
Expand Down Expand Up @@ -104,6 +114,10 @@ A couple of modifications have been performed to make the installation more suit
* `LOCAL_LISTENER=''`
* An `OPS$ORACLE` externally identified user has been created and granted `CONNECT` and `SELECT_CATALOG_ROLE` (this is used for health check and other operations)

#### Operating system

* `/var/log/lastlog` has been cleaned

### Regular image flavor (`18`)

The regular image strives to balance between the functionality required by most users and image size. It has all customizations that the full image has and removes additional components to further decrease the image size:
Expand Down Expand Up @@ -232,6 +246,10 @@ A couple of modifications have been performed to make the installation more suit
* The `REDO` logs have been located into `$ORACLE_BASE/oradata/$ORACLE_SID/`
* The fast recovery area has been removed (`DB_RECOVERY_FILE_DEST=''`)

#### Operating system

* `/var/log/lastlog` has been cleaned

### Regular image flavor (`11`)

The regular image strives to balance between the functionality required by most users and image size. It has all customizations that the full image has and removes additional components to further decrease the image size:
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Oracle Database Express Edition Container / Docker images.

# Quick Start

## Examples
[Examples Folder](./examples)


Run a new database container (data is removed when the container is removed, but kept throughout container restarts):

```shell
Expand Down Expand Up @@ -57,6 +61,7 @@ We are proud of the following users of these images:
* [Rucio by CERN](https://rucio.cern.ch/) [[`80dffbb`](https://github.com/rucio/rucio/commit/80dffbb09f58a9f30d2a9a4c3297e8ed22a78963)]
* [SchemaCrawler](https://www.schemacrawler.com/) [[`08d9b87`](https://github.com/schemacrawler/SchemaCrawler/commit/08d9b87c280bf23e405bea6265abf01448fa71d3)]
* [Testcontainers](https://www.testcontainers.org/) [[`99b91b8`](https://github.com/testcontainers/testcontainers-java/commit/99b91b89b6ee3f8f0e9545e86d9f0744b301db30)]
* [utPLSQL](http://utplsql.org/) [[`8080604`](https://github.com/utPLSQL/utPLSQL/commit/8080604df0256ab2202c9f64bb67671d55c63710#diff-6ac3f79fc25d95cd1e3d51da53a4b21b939437392578a35ae8cd6d5366ca5485)]

If you are using these images and would like to be listed as well, please open an [issue on GitHub](https://github.com/gvenzl/oci-oracle-xe/issues) or reach out on [Twitter](https://twitter.com/geraldvenzl).

Expand Down Expand Up @@ -118,6 +123,23 @@ The images can be used as a [Service Container](https://docs.github.com/en/actio
--health-retries 10
```
After your service is created, you can connect to it via the following properties:
* Host: `localhost` or `127.0.0.1`
* Port: `1521`
* Service name: `XEPDB1`
* Database App User: `my_user`
* Database App Password: `my_password_which_I_really_should_change`

If you amend the variables above, here is some more useful info:

* Ports: you can access the port dynamically via `${{ job.services.oracle.ports[1521] }}`. This is helpful when you do not want to specify a given port via `- 1521/tcp` instead of `- 1521:1521`. Note that the `oracle` refers to the service name in the yaml file. If you call your service differently, you will also have to change `oracle` here to that other service name.
* Database Admin User: `system`
* Database Admin User Password: `$ORACLE_PASSWORD`
* Database App User: `$APP_USER`
* Database App User Password: `$APP_USER_PASSWORD`
* Example JDBC connect string with dynamic port allocation: `jdbc:oracle:thin:@localhost:${{ job.services.oracle.ports[1521] }}/XEPDB1`

# Image flavors

| Flavor | Extension | Description | Use cases |
Expand Down
5 changes: 5 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Examples

| Script | Parameters | Description |
|--------|------------|-------------|
| dkr-create-oracle-xe-server | hostXePort containerName | Create Oracle XE Container using docker |
51 changes: 51 additions & 0 deletions examples/dkr-create-oracle-xe-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
# Variables used for the script

if [ ! -f `which pwgen` ]; then
echo "You must have pwgen on your machine to run this script"
exit 1
fi

if [ -z "$DKR_HOST_PORT" ]; then
echo "You must provide docker host port"
exit 1
fi


if [ -z "$DKR_CNT_NAME" ]; then
echo "You must provide dockercontainer name"
exit 1
fi


CMG_COMMAND=docker
DKR_IMAGE="gvenzl/oracle-xe"
DKR_HOST_PORT=$1
DKR_CNT_NAME=$2
DKR_DATA_PATH=dbcxe-$DKR_CNT_NAME-dvol
DKR_ORA_USER_APP=DAAPPUSER
DKR_ORA_PW=`pwgen -1 16 | tr -d '\n'`
DKR_ORA_PW_APP=`pwgen -1 16 | tr -d '\n'`

echo "Docker Image ............................ :'$DKR_IMAGE'"
echo "Database (SYS AND SYSTEM) User Password . :'$DKR_ORA_PW'"
echo "Database Application User ............... :'$DKR_ORA_USER_APP'"
echo "Database Application User Password ...... :'$DKR_ORA_PW_APP'"
echo "Docker Volume Name ...................... :'$DKR_DATA_PATH'"
echo "Docker Host Port ........................ :'$DKR_HOST_PORT'"
echo "Docker Container Name ................... :'$DKR_CNT_NAME'"



$CMG_COMMAND run --name $DKR_CNT_NAME \
-p $DKR_HOST_PORT:1521 \
-e "ORACLE_PASSWORD=$DKR_ORA_PW" \
-e "APP_USER=$DKR_ORA_USER_APP" \
-e "APP_USER_PASSWORD=$DKR_ORA_PW_APP" \
-v $DKR_DATA_PATH:/opt/oracle/oradata \
-d $DKR_IMAGE

echo "Waiting for container '$DKR_CNT_NAME' to start ... "
sleep 10

echo "Docker Container '$DKR_CNT_NAME' has been started on port '$DKR_HOST_PORT'"
Empty file modified healthcheck.sh
100644 → 100755
Empty file.
3 changes: 3 additions & 0 deletions install.11202.sh
Original file line number Diff line number Diff line change
Expand Up @@ -645,3 +645,6 @@ microdnf -y remove acl bc cracklib cracklib-dicts cryptsetup-libs \

# Remove dnf cache
microdnf clean all

# Clean lastlog
echo "" > /var/log/lastlog
3 changes: 3 additions & 0 deletions install.1840.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -1105,3 +1105,6 @@ rm /etc/sysctl.conf.rpmsave

# Remove dnf cache
microdnf clean all

# Clean lastlog
echo "" > /var/log/lastlog
21 changes: 16 additions & 5 deletions install.2130.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ EXTPROC_CONNECTION_DATA =
" > "${ORACLE_BASE_HOME}"/network/admin/tnsnames.ora

# sqlnet.ora
echo "NAMES.DIRECTORY_PATH = (EZCONNECT, TNSNAMES)" > "${ORACLE_BASE_HOME}"/network/admin/sqlnet.ora
echo \
"NAMES.DIRECTORY_PATH = (EZCONNECT, TNSNAMES)
# See https://github.com/gvenzl/oci-oracle-xe/issues/43
DISABLE_OOB=ON
BREAK_POLL_SKIP=1000
" > "${ORACLE_BASE_HOME}"/network/admin/sqlnet.ora

chown -R oracle:dba "${ORACLE_BASE_HOME}"/network/admin

Expand Down Expand Up @@ -959,10 +964,12 @@ if [ "${BUILD_MODE}" == "REGULAR" ] || [ "${BUILD_MODE}" == "SLIM" ]; then
rm -r "${ORACLE_HOME}"/python

# Remove unnecessary binaries (see http://yong321.freeshell.org/computer/oraclebin.html#21c)
rm "${ORACLE_HOME}"/bin/afd* # ASM Filter Drive components
rm "${ORACLE_HOME}"/bin/proc # Pro*C/C++ Precompiler
rm "${ORACLE_HOME}"/bin/procob # Pro COBOL Precompiler
rm "${ORACLE_HOME}"/bin/orion # ORacle IO Numbers benchmark tool
rm "${ORACLE_HOME}"/bin/afd* # ASM Filter Drive components
rm "${ORACLE_HOME}"/bin/proc # Pro*C/C++ Precompiler
rm "${ORACLE_HOME}"/bin/procob # Pro COBOL Precompiler
rm "${ORACLE_HOME}"/bin/orion # ORacle IO Numbers benchmark tool
rm "${ORACLE_HOME}"/bin/oms_daemon # Oracle Memory Speed (PMEM support) daemon
rm "${ORACLE_HOME}"/bin/omsfscmds # Oracle Memory Speed command line utility

# Replace `orabase` with static path shell script
su -p oracle -c "echo 'echo ${ORACLE_BASE}' > ${ORACLE_HOME}/bin/orabase"
Expand All @@ -974,6 +981,7 @@ if [ "${BUILD_MODE}" == "REGULAR" ] || [ "${BUILD_MODE}" == "SLIM" ]; then
su -p oracle -c "echo 'echo ${ORACLE_BASE_CONFIG}' > ${ORACLE_HOME}/bin/orabaseconfig"

# Remove unnecessary libraries
rm "${ORACLE_HOME}"/lib/libmle.so # Multilingual Engine
rm "${ORACLE_HOME}"/lib/libopc.so # Oracle Public Cloud
rm "${ORACLE_HOME}"/lib/libosbws.so # Oracle Secure Backup Cloud Module
rm "${ORACLE_HOME}"/lib/libra.so # Recovery Appliance
Expand Down Expand Up @@ -1069,3 +1077,6 @@ rpm -e --nodeps acl bc binutils cracklib cracklib-dicts cryptsetup-libs \

# Remove dnf cache
microdnf clean all

# Clean lastlog
echo "" > /var/log/lastlog
2 changes: 1 addition & 1 deletion tests/all_build_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ set -Eeuo pipefail
./build_Dockerfile_11202.sh

# In order of newest to latest
./build_cokerfile_2130.sh
./build_Dockerfile_2130.sh
./build_Dockerfile_1840.sh
31 changes: 26 additions & 5 deletions tests/backup_old_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ podman pull docker.io/gvenzl/oracle-xe:latest
podman tag docker.io/gvenzl/oracle-xe:latest docker.io/gvenzl/oracle-xe:latest-backup
podman rmi docker.io/gvenzl/oracle-xe:latest

# Backup 21c images
echo "Backup 21.3.0-full"
podman pull docker.io/gvenzl/oracle-xe:21.3.0-full
podman tag docker.io/gvenzl/oracle-xe:21.3.0-full docker.io/gvenzl/oracle-xe:21.3.0-full-backup
podman rmi docker.io/gvenzl/oracle-xe:21.3.0-full

echo "Backup 21-full"
podman pull docker.io/gvenzl/oracle-xe:21-full
podman tag docker.io/gvenzl/oracle-xe:21-full docker.io/gvenzl/oracle-xe:21-full-backup
podman rmi docker.io/gvenzl/oracle-xe:21-full

echo "Backup full"
podman pull docker.io/gvenzl/oracle-xe:full
podman tag docker.io/gvenzl/oracle-xe:full docker.io/gvenzl/oracle-xe:full-backup
podman rmi docker.io/gvenzl/oracle-xe:full

echo "Backup 21.3.0"
podman pull docker.io/gvenzl/oracle-xe:21.3.0
podman tag docker.io/gvenzl/oracle-xe:21.3.0 docker.io/gvenzl/oracle-xe:21.3.0-backup
podman rmi docker.io/gvenzl/oracle-xe:21.3.0

echo "Backup 18"
podman pull docker.io/gvenzl/oracle-xe:21
podman tag docker.io/gvenzl/oracle-xe:21 docker.io/gvenzl/oracle-xe:21-backup
podman rmi docker.io/gvenzl/oracle-xe:21

# Backup 18c images
echo "Backup 18.4.0-full"
podman pull docker.io/gvenzl/oracle-xe:18.4.0-full
Expand All @@ -39,11 +65,6 @@ podman pull docker.io/gvenzl/oracle-xe:18-full
podman tag docker.io/gvenzl/oracle-xe:18-full docker.io/gvenzl/oracle-xe:18-full-backup
podman rmi docker.io/gvenzl/oracle-xe:18-full

echo "Backup full"
podman pull docker.io/gvenzl/oracle-xe:full
podman tag docker.io/gvenzl/oracle-xe:full docker.io/gvenzl/oracle-xe:full-backup
podman rmi docker.io/gvenzl/oracle-xe:full

echo "Backup 18.4.0"
podman pull docker.io/gvenzl/oracle-xe:18.4.0
podman tag docker.io/gvenzl/oracle-xe:18.4.0 docker.io/gvenzl/oracle-xe:18.4.0-backup
Expand Down
15 changes: 13 additions & 2 deletions tests/upload_images_artifactory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,24 @@ podman login gvenzl.jfrog.io
echo "Upload latest"
podman push gvenzl/oracle-xe:latest gvenzl.jfrog.io/docker/oracle-xe:latest

# Upload 21c images
echo "Upload 21.3.0-full"
podman push gvenzl/oracle-xe:21.3.0-full gvenzl.jfrog.io/docker/oracle-xe:21.3.0-full
echo "Upload 21-full"
podman push gvenzl/oracle-xe:21-full gvenzl.jfrog.io/docker/oracle-xe:21-full
echo "Upload full"
podman push gvenzl/oracle-xe:full gvenzl.jfrog.io/docker/oracle-xe:full

echo "Upload 21.3.0"
podman push gvenzl/oracle-xe:21.3.0 gvenzl.jfrog.io/docker/oracle-xe:21.3.0
echo "Upload 21"
podman push gvenzl/oracle-xe:21 gvenzl.jfrog.io/docker/oracle-xe:21

# Upload 18c images
echo "Upload 18.4.0-full"
podman push gvenzl/oracle-xe:18.4.0-full gvenzl.jfrog.io/docker/oracle-xe:18.4.0-full
echo "Upload 18-full"
podman push gvenzl/oracle-xe:18-full gvenzl.jfrog.io/docker/oracle-xe:18-full
echo "Upload full"
podman push gvenzl/oracle-xe:full gvenzl.jfrog.io/docker/oracle-xe:full

echo "Upload 18.4.0"
podman push gvenzl/oracle-xe:18.4.0 gvenzl.jfrog.io/docker/oracle-xe:18.4.0
Expand Down

0 comments on commit 2c0b7b4

Please sign in to comment.