forked from chucknorris/roundhouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Development
Erik A. Brandstadmoen edited this page Apr 13, 2020
·
3 revisions
- Go to the docker store on https://hub.docker.com/, and look up "Oracle Database Enterprise Edition"
- Read the terms and conditions, and click through all the "I Accept" checkboxes
- Pull down the image locally, e.g.
docker pull store/oracle/database-enterprise:12.2.0.1
- Login to the docker store from your command line (I didn't need to do this step)
- Run the Oracle database server, exposing its ports with the
-P
parameter:
docker run -d -it --name oracle-roundhouse -P store/oracle/database-enterprise:12.2.0.1
The default password to connect to the database with sys
user is Oradoc_db1
.
- You can view the exposed ports using the
docker ports
command:
$ docker port oracle-roundhouse
5500/tcp -> 0.0.0.0:32768
1521/tcp -> 0.0.0.0:32769
$
- Check that the server is up and running using SQL*Plus on the container:
$ docker exec -it oracle-roundhouse bash -c "source /home/oracle/.bashrc; sqlplus / as SYSDBA"
SQL*Plus: Release 12.2.0.1.0 Production on Mon Apr 13 20:14:40 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> select * FROM v$version
BANNER
--------------------------------------------------------------------------------
CON_ID
----------
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
0
PL/SQL Release 12.2.0.1.0 - Production
0
CORE 12.2.0.1.0 Production
0
BANNER
--------------------------------------------------------------------------------
CON_ID
----------
TNS for Linux: Version 12.2.0.1.0 - Production
0
NLSRTL Version 12.2.0.1.0 - Production
0
SQL>
- Set the environment variable
TNS_ADMIN
to a folder of your choice, e.g. your home directory, and create a file namedtnsnames.ora
in that folder. I set mine toC:\Users\erik
on my Windows box. - Use the host IP addresses as listed by
docker port
above, in my example,32769
, to create the content of the file. Example content of myC:\Users\erik\tnsnames.ora
:
ORCLCDB=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=32769))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCLCDB.localdomain)))
ORCLPDB1=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=32769))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCLPDB1.localdomain)))
- Check the connection using SQL*Plus from the host.
- Download SQL*Plus, e.g. from https://www.oracle.com/database/technologies/sqlplus-cloud.html
- Install it for your platform
- Run it:
sqlplus sys/Oradoc_db1@ORCLCDB as sysdba