Public Repository

Last pushed: 2 months ago
Short Description
Short description is empty for this repo.
Full Description

Define a docker network

  • Create a docker network so you can make your Oracle Docker communicate with other docker containers:
docker network create \
    --driver bridge \
    --subnet=10.10.0.0/16 \
    dockerNetwork

Connect to Oracle Database

docker run -d \
    --name databaseOracle \
    --network=dockerNetwork \
    --ip=10.10.0.4 \
    -p <localPort>:1521 -p <localPort>:5500 \
    -e ORACLE_SID=ORCLCDB \
    -e ORACLE_PDB=ORCLPDB1 \
    -e ORACLE_PWD="gz42KHwy1HQ=1" \
    -e ORACLE_CHARACTERSET=AL32UTF8 \
    -v </path/to/local/directory>:/opt/oracle/oradata \
    rsperafico/database-oracle:12.1.0.2-ee

Create tablespace

  • Run docker exec and run sqlplus from within the same container already running the database:

docker exec -ti databaseOracle sqlplus system@ORCLPDB1

  • Create a tablespace (without the dash) and never use the default USERS tablespace:

CREATE TABLESPACE tablespaceFoo DATAFILE 'tablespaceFoo.dat' SIZE 100M AUTOEXTEND ON;

  • Create a user:

CREATE USER userFoo IDENTIFIED BY userFoo DEFAULT TABLESPACE tablespaceFoo QUOTA UNLIMITED ON tablespaceFoo;

  • Grant privileges:

GRANT CONNECT, CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER TO userFoo;

  • Delete user:

DROP USER userFoo CASCADE;

  • Delete tablespace

DROP TABLESPACE userFoo INCLUDING CONTENTS AND DATAFILES;

JDBC Connection String

  • Connect to the database created by using JDBC Connection String:
jdbc:oracle:thin:@//localhost:1521/ORCLPDB1
username: userFoo
password; <password>

Changing admin accounts' passwords

  • The password (gz42KHwy1HQ=1) for the SYS, SYSTEM and PDBADMI accounts can be changed via the docker exec command. Note, the container has to be running:
docker exec <container name> ./setPassword.sh <your password>
Docker Pull Command
Owner
rsperafico

Comments (0)