I found it very easy to set up a quick database environment to do some tests. You don’t need any virtual machine, Vagrant, or anything else to set this up.
The Oracle Database 23ai Free server Container image contains a pre-built database running on Oracle Linux 8, so the startup time is very fast.
This image contains a default database in a multitenant configuration with one pluggable database.
Pre-requisite: You should have docker installed on your system.
Here is the link for the Oracle registry where you can find docker images.
- Go to Oracle Container Registry
- Click on Database
- Click on the free Repository
You can use the below command to pull the image and then run it.
docker pull container-registry.oracle.com/database/free:latest
Or I used the direct Docker run command and provided variables in the command.
docker run -d --name myoradb1 -p 1521:1521 -p 5500:5500 -e ORACLE_PWD=Welcome1 -e ORACLE_CHARACTERSET=AL32UTF8 -v ${PWD}/opt/oracle/oradata:/opt/oracle/oradata container-registry.oracle.com/database/free:latest
This command will pull the image and run it.
In the above command
container name = myoradb1
Port mapping = 1521:1521
Port mapping = 5500:5500
Set env. variable = ORACLE_CHARACTERSET=AL32UTF8
Set volume = ${PWD}/opt/oracle/oradata:/opt/oracle/oradata
Container Registry = container-registry.oracle.com/database/free:latest
Once this is done, you can see the image using the below command.
I used Docker Desktop on my Windows machine, so we can also see the image on the Docker Desktop.
Now let me start the container in interactive mode to log into the Database.
Connect as you see in my above docker command I used port mapping so that we can connect this DB
From any external tool like SQL Developer, toad, etc. from a laptop