Skip to content
Erik A. Brandstadmoen edited this page Apr 13, 2020 · 3 revisions

Running integration tests

Oracle

  1. Go to the docker store on https://hub.docker.com/, and look up "Oracle Database Enterprise Edition"
  2. Read the terms and conditions, and click through all the "I Accept" checkboxes
  3. Pull down the image locally, e.g.
docker pull store/oracle/database-enterprise:12.2.0.1
  1. Login to the docker store from your command line (I didn't need to do this step)
  2. 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.

  1. 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
$
  1. 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>
  1. Set the environment variable TNS_ADMIN to a folder of your choice, e.g. your home directory, and create a file named tnsnames.ora in that folder. I set mine to C:\Users\erik on my Windows box.
  2. 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 my C:\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)))
  1. Check the connection using SQL*Plus from the host.
sqlplus sys/Oradoc_db1@ORCLCDB as sysdba
Clone this wiki locally