Connect to Oracle XE Docker container
NickName:nifu Ask DateTime:2020-09-05T22:16:07

Connect to Oracle XE Docker container

I have problems reaching an Oracle XE database Docker container (Version 2.3.0.4) via Telnet or SQLPLUS from my hostsystem:

This is my Oracle XE and Container configuration:

docker port 54cb9336d8c3
1521/tcp -> 127.0.0.1:1521

Oracle configuration:

cat /opt/oracle/product/18c/dbhomeXE/network/admin/listener.ora
DEFAULT_SERVICE_LISTENER = XE

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

cat /opt/oracle/product/18c/dbhomeXE/network/admin/tnsnames.ora
XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )

LISTENER_XE =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))

lsnrctl output:

lsnrctl status

LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 05-SEP-2020 13:29:49

Copyright (c) 1991, 2018, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date                04-SEP-2020 23:23:29
Uptime                    0 days 14 hr. 6 min. 20 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /opt/oracle/product/18c/dbhomeXE/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/54cb9336d8c3/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=127.0.0.1)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/XE/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "XE" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
Service "ae7e9c04366c09a3e053030011ac556e" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
Service "xepdb1" has 1 instance(s).
  Instance "XE", status READY, has 1 handler(s) for this service...
The command completed successfully

I can access via SQLPLUS from the Docker Container to the XE database, but it is not possible to connect to the DB from my hostsystem.

Telnet to Port 1521 (in Docker container)

[root@54cb9336d8c3 admin]# telnet localhost 1521
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Telnet to Port 1521 (from macOS Host)

telnet localhost 1521
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

Did I miss anything in the configuration of the Oracle DB or the Docker Container?

Copyright Notice:Content Author:「nifu」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/63754893/connect-to-oracle-xe-docker-container

More about “Connect to Oracle XE Docker container” related questions

Connect to Oracle XE Docker container

I have problems reaching an Oracle XE database Docker container (Version 2.3.0.4) via Telnet or SQLPLUS from my hostsystem: This is my Oracle XE and Container configuration: docker port 54cb9336d8c...

Show Detail

Connecting to Oracle XE running on Docker

I'm trying to connect to Oracle XE which is running on docker on my Mac. docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g $ docker ps CONTAINER ID IMAGE

Show Detail

Cannot connect to the new user created on Oracle database 18 XE in Docker

I recently built an image of oracle database 18xe using this script and created a container with following command: $docker run --name myxedb \ -d \ -p 51521:1521 \ -p 55500:5500 \ -e ORACLE_PWD=...

Show Detail

Running Docker Oracle Container with different databases

i want to realize the following scenario: create a basic Oracle XE Docker container(no database inside) connect this container with a database file backup container remove the database file cont...

Show Detail

A custom Oracle XE data directory location to retrieve my tables data across docker container restarts

Using the Docker Oracle XE image https://hub.docker.com/r/wnameless/oracle-xe-11g/ I created a docker-compose file: version: "3" services: oracle-xe: image: wnameless/oracle-xe-11g:16.04 ...

Show Detail

Oracle-xe docker container have weird behaviour

I am new to docker I have been trying to install oracel-18xe in the docker after installing Oracele-xe which seems to be working but after running ./buildContainerImage.sh command I got the following

Show Detail

Oracle-xe docker container have weird behaviour

I am new to docker I have been trying to install oracel-18xe in the docker after installing Oracele-xe which seems to be working but after running ./buildContainerImage.sh command I got the following

Show Detail

Connect from web app to Oracle DB docker container

I'm running on the same host a tomcat container where I've deployed a web application and an oracle DB container. The settings I'm using the following settings to connect from the web app to the or...

Show Detail

Cannot run SQL script after the start of a Docker-container with Oracle XE

I want to start a Docker-container with Oracle XE and then run an SQL script (ddl.sql) to create some tables in docker-compose. If I execute all the steps separately, everything works: $ docker r...

Show Detail

Connecting an Oracle DB Container and a Java application Container (Docker)

I am now working on a docker project with two docker containers - one for the oracle db and the other with a java application. The container for oracle db is working ok. I used the already built i...

Show Detail