dockerfile: https://github.com/oracle/docker-images/tree/master/OracleDatabase/SingleInstance
To run your Oracle Database Docker image use the docker run command as follows:
docker run --name <container name> \
-p <host port>:1521 -p <host port>:5500 \
-e ORACLE_SID=<your SID> \
-e ORACLE_PDB=<your PDB name> \
-e ORACLE_PWD=<your database passwords> \
-e ORACLE_CHARACTERSET=<your character set> \
-v [<host mount point>:]/opt/oracle/oradata \
oracle/database:12.2.0.1-ee
Parameters:
--name: The name of the container (default: auto generated)
-p: The port mapping of the host port to the container port.
Two ports are exposed: 1521 (Oracle Listener), 5500 (OEM Express)
-e ORACLE_SID: The Oracle Database SID that should be used (default: ORCLCDB)
-e ORACLE_PDB: The Oracle Database PDB name that should be used (default: ORCLPDB1)
-e ORACLE_PWD: The Oracle Database SYS, SYSTEM and PDB_ADMIN password (default: auto generated)
-e ORACLE_CHARACTERSET:
The character set to use when creating the database (default: AL32UTF8)
-v /opt/oracle/oradata
The data volume to use for the database.
Has to be writable by the Unix "oracle" (uid: 54321) user inside the container!
If omitted the database will not be persisted over container recreation.
-v /opt/oracle/scripts/startup | /docker-entrypoint-initdb.d/startup
Optional: A volume with custom scripts to be run after database startup.
For further details see the "Running scripts after setup and on startup" section below.
-v /opt/oracle/scripts/setup | /docker-entrypoint-initdb.d/setup
Optional: A volume with custom scripts to be run after database setup.
For further details see the "Running scripts after setup and on startup" section below.
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 pdbadmin/<your password>@//localhost:1521/<Your PDB name>
The Oracle Database inside the container also has Oracle Enterprise Manager Express configured. To access OEM Express, start your browser and follow the URL:
https://localhost:5500/em/
NOTE: Oracle Database bypasses file system level caching for some of the files by using the O_DIRECT flag. It is not advised to run the container on a file system that does not support the O_DIRECT flag.
On the first startup of the container a random password will be generated for the database if not provided. You can find this password in the output line:
ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN:
The password for those accounts can be changed via the docker exec command. Note, the container has to be running:
docker exec <container name> ./setPassword.sh <your password>
select CDB from v$database;
select name,open_mode from v$pdbs;
show con_name;
alter session set container=ORCLPDB1;
ORA-04031: unable to allocate 28049976 bytes of shared memory ("large pool","unknown object","kxttIICDT: 4","kxttAssignMemory: 10") in 12c olution
Increasing the database granule size resolved the error in this case.
1. Connect to the database as SYSDBA.
2. Issue command:
SQL> alter system set "_ksmg_granule_size"=33554432 scope=spfile;
3. Re-start the instance so the change takes effect. shutdown immediate && startup
Content type
Image
Digest
Size
2.6 GB
Last updated
over 6 years ago
docker pull hejiazhen/oracle:12.2.0.1-ee