This repository is used for building a Docker image containing Oracle Database
- Creating an Oracle Database Docker image
- Oracle Database Software Downloads
- Docker Images from Oracle
docker pull scalified/oracle-database:<version>
Version | Description |
---|---|
11g-r2 | 11g Release 2 Express Edition |
12.2.0.1-ee | 12.2.0.1 Enterprise Edition |
12.1.0.2-se2 | 12.1.0.2 Standard Edition |
12.1.0.2-ee | 12.1.0.2 Enterprise Edition |
Currently only 11g Release 2 is supported
docker run -it --name oracle -p 1521:1521 scalified/oracle-database:<tag>
jdbc:oracle:thin:@//localhost:1521/xe
User | Password | Description |
---|---|---|
system | oracle | System user |
sys | oracle | System user |
scalified | 123456 | Regular user |
- Increase Docker container size by adding the following option to the daemon start:
--storage-opt dm.basesize=20G
- Download Oracle installation files from Oracle Database Software Downloads
- Put downloaded files from step 2 into the correspondent Oracle version folder in the:
oracle-docker-images/OracleDatabase/dockerfiles
- Proceed with official building instructions
Once the container has been started and the database created you can connect to it just like to any other database:
sqlplus sys/<your password>@//localhost:1521/<your SID> as sysdba
sqlplus system/<your password>@//localhost:1521/<your SID>
sqlplus sys/<your password>@//localhost:1521/<Your PDB name> as sysdba
sqlplus pdbadmin/<your password>@//localhost:1521/<Your PDB name>
On the first startup of the container a random password is generated for the database and shown in log message:
ORACLE AUTO GENERATED PASSWORD FOR SYS, SYSTEM AND PDBAMIN: <password goes here>
CREATE USER <username> IDENTIFIED BY <password>
;
GRANT ALL PRIVILEGES TO <username>
;
CREATE PLUGGABLE DATABASE <pdb_name> ADMIN USER <username> IDENTIFIED BY <password>
FILE_NAME_CONVERT=('/opt/oracle/oradata/<cdb_name>/pdbseed/','/opt/oracle/oradata/<cdb_name>/<pdb_name>')
;
ALTER PLUGGABLE DATABASE <pdb_name> OPEN
;
ALTER PLUGGABLE DATABASE <pdb_name> SAVE STATE
;
where:
- <pdb_name> - pluggable database name to create
- <cdb_name> - container database name (SID)
Check the listener status:
lsnrctl status
This will output endpoints:
...
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=67e0ca534f7b)(PORT=5500))(Presentation=HTTP)(Session=RAW))
...
Login to sql as sysdba and execute procedure:
exec dbms_xdb_config.setListenerEndPoint(dbms_xdb_config.xdb_endpoint_http2, '67e0ca534f7b', 5500, dbms_xdb_config.xdb_protocol_tcp);
More info:
https://www.morganslibrary.org/reference/pkgs/dbms_xdb_config.html
Setting EM ports:
exec DBMS_XDB_CONFIG.SETHTTPSPORT(5500);
exec DBMS_XDB_CONFIG.SETHTTPPORT(5510);
echo "INBOUND_CONNECT_TIMEOUT_LISTENER=0" >> $ORACLE_HOME/network/admin/listener.ora
echo "SQLNET.INBOUND_CONNECT_TIMEOUT=0" >> $ORACLE_HOME/network/admin/sqlnet.ora