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

Ability to set ORACLE_SID #34

Closed
Physium opened this issue Dec 29, 2023 · 5 comments
Closed

Ability to set ORACLE_SID #34

Physium opened this issue Dec 29, 2023 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@Physium
Copy link

Physium commented Dec 29, 2023

Is there a way for me to tweak the ORACLE_SID? Seems like its set to FREE on build but i want it to be something else, is that possible?

@gvenzl gvenzl self-assigned this Jan 28, 2024
@gvenzl gvenzl added the question Further information is requested label Jan 28, 2024
@gvenzl
Copy link
Owner

gvenzl commented Jan 28, 2024

Hey @Physium,

Thanks a lot for using these images!

Unfortunately, there is no way around the ORACLE_SID, it has to be called FREE (case-insensitive), see:

[oracle@c7d90a09e0bc dbs]$ export ORACLE_SID=MY_ORCL
[oracle@c7d90a09e0bc dbs]$ sqlplus / as sysdba

SQL*Plus: Release 23.0.0.0.0 - Production on Sun Jan 28 02:03:31 2024
Version 23.3.0.23.09

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

Connected to an idle instance.

SQL> startup
ORA-00441: Oracle Free Edition SID violation. Expected:free vs Actual:MY_ORCL
SQL>

However, you could just set the service_names parameter to the name you would like:

[oracle@c7d90a09e0bc ~]$ sqlplus / as sysdba

SQL*Plus: Release 23.0.0.0.0 - Production on Sun Jan 28 02:07:35 2024
Version 23.3.0.23.09

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


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

SQL> alter system set service_names='my_orcl';

System altered.

SQL> alter system register;

System altered.

SQL> exit
Disconnected from Oracle Database 23c Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.3.0.23.09
[oracle@c7d90a09e0bc ~]$ lsnrctl status

LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 28-JAN-2024 02:07:52

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_FREE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 23.0.0.0.0 - Production
Start Date                28-JAN-2024 01:58:32
Uptime                    0 days 0 hr. 9 min. 20 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           FREE
Listener Parameter File   /opt/oracle/product/23c/dbhomeFree/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/c7d90a09e0bc/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_FREE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Services Summary...
Service "FREE" has 1 instance(s).
  Instance "FREE", status READY, has 1 handler(s) for this service...
Service "FREEXDB" has 1 instance(s).
  Instance "FREE", status READY, has 0 handler(s) for this service...
Service "my_orcl" has 1 instance(s).
  Instance "FREE", status READY, has 1 handler(s) for this service...
The command completed successfully

Once the service my_orcl is registered, you can connect via it:

[oracle@c7d90a09e0bc ~]$ sqlplus system/LetsTest1@//localhost/my_orcl

SQL*Plus: Release 23.0.0.0.0 - Production on Sun Jan 28 02:08:09 2024
Version 23.3.0.23.09

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

Last Successful login time: Mon Oct 30 2023 03:01:49 +00:00

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

SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL>

The service_names parameter also accepts multiple service names via a comma-separated list, so you can pass on multiple, e.g: 'free,my_orcl,foobar':

SQL> alter system set service_names='free,my_orcl,foobar';

System altered.

SQL> alter system register;

System altered.

SQL> exit
Disconnected from Oracle Database 23c Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.3.0.23.09
[oracle@c7d90a09e0bc ~]$ lsnrctl status

LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 28-JAN-2024 02:10:05

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_FREE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 23.0.0.0.0 - Production
Start Date                28-JAN-2024 01:58:32
Uptime                    0 days 0 hr. 11 min. 32 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           FREE
Listener Parameter File   /opt/oracle/product/23c/dbhomeFree/network/admin/listener.ora
Listener Log File         /opt/oracle/diag/tnslsnr/c7d90a09e0bc/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_FREE)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Services Summary...
Service "FREE" has 1 instance(s).
  Instance "FREE", status READY, has 1 handler(s) for this service...
Service "FREEXDB" has 1 instance(s).
  Instance "FREE", status READY, has 0 handler(s) for this service...
Service "foobar" has 1 instance(s).
  Instance "FREE", status READY, has 1 handler(s) for this service...
Service "my_orcl" has 1 instance(s).
  Instance "FREE", status READY, has 1 handler(s) for this service...
The command completed successfully

You can connect with either free, my_orcl, or foobar to the container database:

[oracle@c7d90a09e0bc ~]$ sqlplus system/LetsTest1@//localhost/foobar

SQL*Plus: Release 23.0.0.0.0 - Production on Sun Jan 28 02:10:12 2024
Version 23.3.0.23.09

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

Last Successful login time: Sun Jan 28 2024 02:08:09 +00:00

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

SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL> conn system/LetsTest1@//localhost/my_orcl
Connected.
SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL> conn system/LetsTest1@//localhost/free
Connected.
SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL>

Of course, you could also create a PDB with the desired name, but I am assuming you want the container database to have a different name.

Hope this helps!

@Physium
Copy link
Author

Physium commented Jan 29, 2024

i want it configured upfront because its acting as a CI image for me. It there a licensing issue if i were to tweak the dockerfile oracle_sid to whatever i want?

@gvenzl
Copy link
Owner

gvenzl commented Feb 5, 2024

Hi @Physium,

I understand, but as said, you can't tweak the SID for Free.
If you do, the Oracle Database will throw ORA-00441: Oracle Free Edition SID violation. Expected:free vs Actual:MY_ORCL and refuse to start up.

@Physium
Copy link
Author

Physium commented Feb 5, 2024

@gvenzl truly much appreciated. thanks for shedding lights in into this blackbox.

@Physium Physium closed this as completed Feb 5, 2024
@gvenzl
Copy link
Owner

gvenzl commented Feb 5, 2024

You are very welcome, @Physium!

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

No branches or pull requests

2 participants