Docker install of Oracle 12c

From MyWiki
Revision as of 11:00, 17 April 2021 by George2 (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Taken from history:
docker pull store/oracle/database-enterprise:12.2.0.1
docker run -d -it --name mydb -P store/oracle/database-enterprise:12.2.0.1
docker run -d -it --name mydb -p 1521:1521 store/oracle/database-enterprise:12.2.0.1
docker container remove mydb
docker container rename mydb mydb_saved
docker run -d -it --name mydb -p 1521:1521 store/oracle/database-enterprise:12.2.0.1c

Notes from the Docker doc page for this container:
Starting an Oracle database server instance is as simple as executing
$ docker run -d -it --name <Oracle-DB> store/oracle/database-enterprise:12.2.0.1
Connecting to the Database Server Container
The default password to connect to the database with sys user is Oradoc_db1.
Connecting from outside the container
The database server exposes port 1521 for Oracle client connections over SQLNet protocol and port 5500 for Oracle XML DB. SQLPlus or any JDBC client can be used to connect to the database server from outside the container.

Using this <mapped host port> and <ip-address of host> create tnsnames.ora in the directory pointed to by environment variable TNS_ADMIN.

ORCLCDB=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<ip-address of host>)(PORT=<mapped host port>))
    (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCLCDB.localdomain)))
ORCLPDB1=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<ip-address> of host)(PORT=<mapped host port>))
    (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCLPDB1.localdomain)))


To connect from outside the container using SQL*Plus,
$ sqlplus sys/Oradoc_db1@ORCLCDB as sysdba