oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.54k stars 5.42k forks source link

The listener supports no services #2502

Open Sylvestre67 opened 1 year ago

Sylvestre67 commented 1 year ago

Same as https://github.com/oracle/docker-images/issues/2397.

When using the following config (from a docker-compose yml file) using the enterprise image:

    oracle:
      image: container-registry.oracle.com/database/enterprise:21.3.0.0
      container_name: oracle_db
      environment:
        - ORACLE_PWD=AvErYsEcUrEPaSsW0rD
      ports:
        - "1521:1521"
        - "5500:5500"

After running the docker-compose up oracle command the logs shows:

oracle_db  | [2022:11:07 22:02:33]: Acquiring lock .ORCLCDB.create_lck with heartbeat 30 secs
oracle_db  | [2022:11:07 22:02:33]: Lock acquired
oracle_db  | [2022:11:07 22:02:33]: Starting heartbeat
oracle_db  | [2022:11:07 22:02:33]: Lock held .ORCLCDB.create_lck
oracle_db  | ORACLE EDITION: ENTERPRISE
oracle_db  |
oracle_db  | LSNRCTL for Linux: Version 21.0.0.0.0 - Production on 07-NOV-2022 22:02:34
oracle_db  |
oracle_db  | Copyright (c) 1991, 2021, Oracle.  All rights reserved.
oracle_db  |
oracle_db  | Starting /opt/oracle/product/21c/dbhome_1/bin/tnslsnr: please wait...
oracle_db  |
oracle_db  | TNSLSNR for Linux: Version 21.0.0.0.0 - Production
oracle_db  | System parameter file is /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora
oracle_db  | Log messages written to /opt/oracle/diag/tnslsnr/39faef2359d1/listener/alert/log.xml
oracle_db  | Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
oracle_db  | Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
oracle_db  |
oracle_db  | Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
oracle_db  | STATUS of the LISTENER
oracle_db  | ------------------------
oracle_db  | Alias                     LISTENER
oracle_db  | Version                   TNSLSNR for Linux: Version 21.0.0.0.0 - Production
oracle_db  | Start Date                07-NOV-2022 22:02:34
oracle_db  | Uptime                    0 days 0 hr. 0 min. 0 sec
oracle_db  | Trace Level               off
oracle_db  | Security                  ON: Local OS Authentication
oracle_db  | SNMP                      OFF
oracle_db  | Listener Parameter File   /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora
oracle_db  | Listener Log File         /opt/oracle/diag/tnslsnr/39faef2359d1/listener/alert/log.xml
oracle_db  | Listening Endpoints Summary...
oracle_db  |   (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
oracle_db  |   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
oracle_db  | The listener supports no services
oracle_db  | The command completed successfully

Then did

$ docker exec -ti oracle_db bash

And from the container:

bash-4.2$ lsnrctl status

Outputs

LSNRCTL for Linux: Version 21.0.0.0.0 - Production on 07-NOV-2022 22:26:09

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 21.0.0.0.0 - Production
Start Date                07-NOV-2022 22:02:34
Uptime                    0 days 0 hr. 23 min. 35 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/39faef2359d1/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully

Seeing the same behavior with the express image.

From the container, when trying to login as sysdba with

$ bash-4.2$ sqlplus sys/AvErYsEcUrEPaSsW0rD@localhost/ORCLPDB1 as sysdba

It produces the corresponding output:

SQL*Plus: Release 21.0.0.0.0 - Production on Tue Nov 8 16:52:39 2022
Version 21.3.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.

ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor

Enter user-name:

Same with

bash-4.2$ sqlplus /nolog

and then

SQL*Plus: Release 21.0.0.0.0 - Production on Tue Nov 8 17:02:49 2022
Version 21.3.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.

SQL> CONNECT SYS
Enter password:
ERROR:
ORA-12547: TNS:lost contact

How can I get a database to run in this container ?

toondaey commented 1 year ago

Help with this please...

sana-h-pathan commented 1 year ago

any solution on above issue?

devinbost commented 1 year ago

Getting exact issue.

devinbost commented 1 year ago

I'm getting this in 21.3. As context, I'm running on M1 Mac with colima. Reproduction steps:

brew install colima
colima start --arch x86_64 --memory 4
docker run -it  --name oracledb21 -p 1521:1521 -p 5500:5500 -e ORACLE_SID=ORCLCDB -e ORACLE_PWD=top_secret container-registry.oracle.com/database/enterprise:21.3.0.0
# In another tab:
docker exec -it oracledb21 bash
sqlplus sys/top_secret@localhost/ORCLPDB1 as sysdba

I've tried many variations of the above steps but have not found a workaround to this issue yet.

devinbost commented 1 year ago

Update: When running Oracle 19.3, I get the same issue (ERROR: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor) but when I run lsnrctl status, I see this instead of The listener supports no services:

. . . 
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Services Summary...
Service "ORCLCDB" has 1 instance(s).
  Instance "ORCLCDB", status RESTRICTED, has 1 handler(s) for this service...
Service "ORCLCDBXDB" has 1 instance(s).
  Instance "ORCLCDB", status RESTRICTED, has 1 handler(s) for this service...
The command completed successfully
johannest commented 1 year ago

For me the following seemed to work:

Then it took ~15min to create the DB, after which I can connect to it with SqlDeveloper.

Edit: it worked only once.. When I had to re-create the container it did not help anymore. Now trying to just wait, the container status goes from "starting" to "unhealthy" after ~30min but if I keep waiting longer ~1h it finally starts creating the DB:

Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/be3961f120fd/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                07-MAR-2023 06:12:56
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/be3961f120fd/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
   CAUSE: 
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
8% complete
Copying database files

Edit2: As a summary it started working eventually when I just waited around 2.5h. M2 Pro with Colima