Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle DB 23.4.0 FREE setup binds to docker host name #2823

Closed
tomasr opened this issue Jun 25, 2024 · 4 comments
Closed

Oracle DB 23.4.0 FREE setup binds to docker host name #2823

tomasr opened this issue Jun 25, 2024 · 4 comments
Assignees
Labels

Comments

@tomasr
Copy link

tomasr commented Jun 25, 2024

Seems like the 23.4.0 setup files will produce a non-working tnsnames.ora file that is bound to the docker hostname instead of 0.0.0.0:

# tnsnames.ora Network Configuration File: /opt/oracle/product/23ai/dbhomeFree/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

FREE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = f545cf6d23da)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = FREE)
    )
  )

LISTENER_FREE =
  (ADDRESS = (PROTOCOL = TCP)(HOST = f545cf6d23da)(PORT = 1521))


FREEPDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = FREEPDB1)
    )
  )

This causes a failure during startup because the TNS listener won't start if the hostname has changed:

Oracle Database instance FREE started.

Failed to start Oracle Net Listener using /opt/oracle/product/23ai/dbhomeFree/bin/tnslsnr and Oracle Database using /opt/oracle/product/23ai/dbhomeFree/bin/sqlplus.
The Oracle base remains unchanged with value /opt/oracle

Looking at the setup scripts, the way tnsnames.ora was definitely changed between 23.3.0 and 23.4.0.

@tomasr
Copy link
Author

tomasr commented Jun 25, 2024

Looking at this a bit closer, I think the issue might be less tnsnames.ora and more listener.ora, which is still bound to the hostname.

@aditya059
Copy link
Member

aditya059 commented Jun 28, 2024

Hi @tomasr

I build and ran 23.4 free container on my machine. For me the files created are correct. Output below:

bash-4.4$ podman run -td --name free23.4 oracle/database:23.4.0-free

bash-4.4$ podman logs -f free23.4
Specify a password to be used for database accounts. 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]. Note that the same password will be used for SYS, SYSTEM and PDBADMIN accounts:
Confirm the password:
Configuring Oracle Listener.
Listener configuration succeeded.
Configuring Oracle Database FREE.
Enter SYS user password: 
*******************
Enter SYSTEM user password: 
****************
Enter PDBADMIN User Password: 
*****************
Prepare for db operation
7% complete
Copying database files
29% complete
Creating and starting Oracle instance
30% complete
33% complete
36% complete
39% complete
43% complete
Completing Database Creation
47% complete
49% complete
50% complete
Creating Pluggable Databases
54% complete
71% complete
Executing Post Configuration Actions
93% complete
Running Custom Scripts
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/FREE.
Database Information:
Global Database Name:FREE
System Identifier(SID):FREE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/FREE/FREE.log" for further details.

Connect to Oracle Database using one of the connect strings:
     Pluggable database: b45412fbfd63/FREEPDB1
     Multitenant container database: b45412fbfd63

SQL*Plus: Release 23.0.0.0.0 - Production on Fri Jun 28 07:06:01 2024
Version 23.4.0.24.05

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


Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.4.0.24.05

SQL> 
System altered.

SQL> 
Pluggable database altered.

SQL> 
PL/SQL procedure successfully completed.

SQL> SQL> 
Session altered.

SQL> 
User created.

SQL> 
Grant succeeded.

SQL> 
Grant succeeded.

SQL> 
Grant succeeded.

SQL> 
User altered.

SQL> SQL> Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.4.0.24.05
The Oracle base remains unchanged with value /opt/oracle
The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
FREEPDB1(3):Tablespace created: USERS ts# 6
FREEPDB1(3):Completed: CREATE SMALLFILE TABLESPACE "USERS" LOGGING  DATAFILE  '/opt/oracle/oradata/FREE/FREEPDB1/users01.dbf' SIZE 5M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED  EXTENT MANAGEMENT LOCAL  SEGMENT SPACE MANAGEMENT  AUTO
FREEPDB1(3):ALTER DATABASE DEFAULT TABLESPACE "USERS"
FREEPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
ALTER PLUGGABLE DATABASE FREEPDB1 SAVE STATE
Completed: ALTER PLUGGABLE DATABASE FREEPDB1 SAVE STATE
2024-06-28T07:06:01.505992+00:00
ALTER SYSTEM SET local_listener='' SCOPE=BOTH;
ALTER PLUGGABLE DATABASE FREEPDB1 SAVE STATE
Completed: ALTER PLUGGABLE DATABASE FREEPDB1 SAVE STATE
2024-06-28T07:06:35.297816+00:00
TABLE SYS.WRP$_REPORTS: ADDED AUTOLIST FRAGMENT SYS_P362 (2) VALUES (( 1444875687, TO_DATE(' 2024-06-24 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
TABLE SYS.WRP$_REPORTS_DETAILS: ADDED AUTOLIST FRAGMENT SYS_P363 (2) VALUES (( 1444875687, TO_DATE(' 2024-06-24 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
TABLE SYS.WRP$_REPORTS_TIME_BANDS: ADDED AUTOLIST FRAGMENT SYS_P366 (2) VALUES (( 1444875687, TO_DATE(' 2024-06-24 00:00:00', 'syyyy-mm-dd hh24:mi:ss', 'nls_calendar=gregorian') ))
^Cbash-4.4$ 
bash-4.4$ 
bash-4.4$ 
bash-4.4$ podman exec -it free23.4 bash
bash-4.4$ 
bash-4.4$ 
bash-4.4$ cat "$ORACLE_HOME"/network/admin/sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT, HOSTNAME)
DISABLE_OOB=ON
SQLNET.EXPIRE_TIME=3
bash-4.4$ 
bash-4.4$ 
bash-4.4$ cat "$ORACLE_HOME"/network/admin/listener.ora
# listener.ora Network Configuration File: /opt/oracle/product/23ai/dbhomeFree/network/admin/listener.ora
# Generated by Oracle configuration tools.

DEFAULT_SERVICE_LISTENER = FREE

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

bash-4.4$ 
bash-4.4$ 
bash-4.4$ cat "$ORACLE_HOME"/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /opt/oracle/product/23ai/dbhomeFree/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

FREE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = FREE)
    )
  )

LISTENER_FREE =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))


FREEPDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = FREEPDB1)
    )
  )

@doberkofler
Copy link

@tomasr I might have a related problem (#2870) and was wondering if you are also using (doker) buildkit?

@tomasr
Copy link
Author

tomasr commented Sep 23, 2024

@tomasr I might have a related problem (#2870) and was wondering if you are also using (doker) buildkit?

Not intentionally, no. My issue was more related to restarting the container after build. Like I said, my listener changes worked, not sure why the team insists it is correct, since it's obviously broken if hostnames change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants