Youtube : https://www.youtube.com/watch?v=56dSXI2PbCQ&t=148s
- Navigate to Oracle Registry and Click on Database => Oracle Registry - Database
- Select the "Free" Repository "Oracle Database Free" => Oracle Database Free - Repository Detail
- Copy the pull command : docker pull container-registry.oracle.com/database/free:latest
- VERSION AT THE TIME OF THIS : Version 23.7.0.25.01
- Go to Docker Terminal enter
docker login container-registry.oracle.com
- it'll ask for username and password (Credentials used to sign in to container-registry.oracle.com) - you'll see login succeeded
- paste command
docker pull container-registry.oracle.com/database/free:latest
- wait for the pull to be successful and complete
- Now youll see an image in DOcker Desktop with name "container-registry.oracle.com/database/free:latest"
- Click on Run on that Image, and Give a container name(oracle-free-db), set host port(use same as it shows i.e 1521), In Environment Variables (enter ORACLE_PWD = password(or your own password))
- More Details on the Oracle Database Free Docker Image : Oracle Database Free - Repository Detail
- The Oracle Database 23ai Free Container Image contains a pre-built database, so the startup time is very fast. Fast startup can be helpful in CI/CD scenarios. To start an Oracle Database Free container, run the following command where, can be any custom name for the container:
docker run -d --name oracle-free-db container-registry.oracle.com/database/free:latest
- When the container is started, a random password is generated for the SYS, SYSTEM and PDBADMIN users. This is termed the default password.
To connect to the Oracle Database by running a SQL*Plus command from within the container using one of the following commands: (once you have started the Container)
- docker exec -it sqlplus sys/<your_password>@FREE as sysdba
- docker exec -it sqlplus system/<your_password>@FREE
- docker exec -it sqlplus pdbadmin/<your_password>@FREEPDB1
sqlplus sys/@//localhost:<port mapped to 1521>/FREE as sysdba
username: sys as SYSDBA, password: password, host: localhost, port: 1521. servicename: FREE
sqlplus system/@//localhost:<port mapped to 1521>/FREE
username: system, password: password, host: localhost, port: 1521. servicename: FREE
sqlplus pdbadmin/@//localhost:<port mapped to 1521>/FREEPDB1
username: pdbadmin, password: password, host: localhost, port: 1521. servicename: FREEPDB1
- In SQL Developer use, you can create individual connects for all 3
username: sys as SYSDBA, password: password, host: localhost, port: 1521. servicename: FREE username: system, password: password, host: localhost, port: 1521. servicename: FREE username: pdbadmin, password: password, host: localhost, port: 1521. servicename: FREEPDB1
Similarly, use above users SYSTEM / PDBADMIN to create connections in SQL Developer if needed.
- Login to "sys as SYSDBA"
- REFER : https://www.oracletutorial.com/getting-started/create-oracle-sample-database-for-practice/
- Switch to Pluggable DB from SYSDBA:
ALTER SESSION SET CONTAINER = FREEPDB1;
- verify
SHOW con_name; >>result is "FREEPDB1"
- create user
CREATE USER OT IDENTIFIED BY Orcl1234;
- and grant priviliges
GRANT CONNECT, RESOURCE, DBA TO OT;
- Now create another connection in SQL Developer with
username: OT, password: Orcl1234, host: localhost, port: 1521. servicename: FREEPDB1
- Download the same Table and Data : Order Transactions Zip
- And Run the sql files.
- Similarly, we can create HR
- Login to "sys as SYSDBA"
- Switch to Pluggable DB from SYSDBA:
ALTER SESSION SET CONTAINER = FREEPDB1;
- verify
SHOW con_name; >>result is "FREEPDB1"
- create user
CREATE USER HR IDENTIFIED BY Orcl1234;
- and grant priviliges
GRANT CONNECT, RESOURCE, DBA TO HR;
- Now create another connection in SQL Developer with
username: HR, password: Orcl1234, host: localhost, port: 1521. servicename: FREEPDB1
- Download the same Table and Data : https://www.oracletutorial.com/getting-started/oracle-sample-database/
- And Run the sql files.
