Installation
docker pull container-registry.oracle.com/database/free:latest
Oracle source
To run stuff within the docker container, one must have the respective permissions. Piece of cake with
usermod -aG docker <username>You can check with the id or the group command
Management
Sources
- https://docs.oracle.com/en/database/oracle/oracle-database/21/deeck/oracle-database-enterprise-edition-installation-guide-docker-containers-oracle-linux.pdf
- https://medium.com/@bastian.ohm/how-to-run-oracle-db-in-docker-6990780d4cac
- https://www.ecosia.org/chat?q=oracle%20docker%20run
Start the docker container
Before you start: If you are doing this over a remote connection, make sure a window can get opened.
docker run --detach [--interactive --tty] --name oracle_db --publish 1521:1521 --publish 5500:5500 container-registry.oracle.com/database/free:latestwhere
- --detach: Run container in background and print container ID
- --name: Assign a name to the container by which the container can be stopped or removed
- --interactive: Keep STDIN open even if not attached
- --tty: Allocate a pseudo-TTY
- --publish: Publish a container's port(s) to the host, 1521 is the standard port for DB access and 5500 for the Enterprise Manager Express
- conta…: the image name
This should issue the container ID used like d6f5a36a8d60af6a980b3acf7945efe4fa1af368f5130d04164d7c1269a8bd33; it can be used to stop/remove the container instead of the name.
Stop the docker container
docker stop oracle_dbRemove the docker container
docker rm oracle_dbExecute stuff from within the docker
docker execute --interactive --tty oracle_db <command>e.g. docker execute --interactive --tty oracle_db /usr/bin/env bash
Unfortunately, the docker I used has no zsh installed.
Set a new SYS password
- Fire up a shell
docker execute --interactive --tty oracle_db bash - Fire up sqlplus as SYS
sqlplus / as sysdba - Change the password of SYS (or any other user), you might want to double quote it in the first place as there are quite of a number of characters that require that anyway.
ALTER USER sys IDENTIFIED BY "finding_a_valid_password_is_a_pain_in_the_a";