Setup docker for ORACLE db

Oracle doc: https://container-registry.oracle.com/ords/f?p=113:4:116819793979697:::::

<https://collabnix.com/how-to-run-oracle-database-in-a-docker-container-using-docker-compose/>
  1. docker pull container-registry.oracle.com/database/enterprise:latest

  2. docker login http://container-registry.oracle.com

Output: Username: sonu@optimizory.com
Password: Optimizory@1
Login Succeeded

3. docker images (to list all existing images)

4. docker run -d --name oracle-db -p 1521:1521 container-registry.oracle.com/database/enterprise:latest

5. Set password once: docker exec oracle-db ./setPassword.sh Oradoc_db1
Password for oracle: Oradoc_db1

6. Access shell: docker exec -it oracle-db bash

7. Access SQlPlus: sqlplus sys/Oradoc_db1@ORCLCDB as sysdba

8. create database (In oracle username is similar to db name) and give necessary permissions
See screenshots for service name in Jira and database name in RMsis
ORCLCDB will always be the database name, changing/creating new user automatically changes the database being used
port number depends on the command number 4, here it is 1521

create user c##<db_name> identified by <password> default tablespace users quota unlimited on users;
Example: create user c##rmsisdb identified by oracle123 default tablespace users quota unlimited on users;

give permissions (These are mandatory, do not skip anyone)

For RMsis

grant connect to c##rmsisdb;
grant create table to c##rmsisdb;
grant create sequence to c##rmsisdb;
grant create trigger to c##rmsisdb;
grant dba to c##rmsisdb;

For jira
create user c##jiradb identified by oracle123 default tablespace users quota unlimited on users;
grant connect to c##jiradb;
grant create table to c##jiradb;
grant create sequence to c##jiradb;
grant create trigger to c##jiradb;
grant dba to c##jiradb;

Note: make sure you use the correct service name, db name etc, it is not like postgres or mssql
Understand the screenshot first