Oracle 18 XE – First Impressions

Oracle XE has many features and options which even most of the Oracle Enterprise Edition customers do not have access to (see Oracle 18 XE is available). In this blog I will go into the details about the installation and configuration.

Installation

It has never been easier to install the Oracle database software. One single package with approx. 2,5 GByte in size is sufficient (Oracle eventually decided not to add an outdated version of SQL Developer and APEX to the download). In addition to the software package a preinstall package has to be downloaded. Without that one and without internet access the installation will not work. BTW: what about SuSE Linux customers?

Download 18 XE

After downloading the software it can be installed using “yum”. All tasks including software installation and database configuration must be executed as root user. Whoever is familiar with Docker knows the ongoing discussion about privileges and security aspects. I won’t comment on that.

# yum localinstall oracle-database-xe-18c-1.0-1.x86_64.rpm
Examining oracle-database-xe-18c-1.0-1.x86_64.rpm: oracle-database-xe-18c-1.0-1.x86_64
Marking oracle-database-xe-18c-1.0-1.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-xe-18c.x86_64 0:1.0-1 will be installed
…
Installed:
  oracle-database-xe-18c.x86_64 0:1.0-1

Dependency Installed:
  bc.x86_64 0:1.06.95-13.el7oracle-database-preinstall-18c.x86_64 0:1.0-1.el7

Complete!

The software will always be installed in /opt/oracle/product/18c/dbhomeXE (ORACLE_HOME) with ORACLE_BASE=/opt/oracle. During the installation the OS user oracle will be created with ID 54321 and all the OS groups (oinstall, dba, oper, backupdba, dgdba, kmdba, racdba) as well. If you want to keep your own ID’s you need to create those users and groups manually before you start the installation.

Unfortunately the home directory for oracle is missing.

# mkdir -p /home/oracle
# chown oracle:oinstall /home/oracle

Create Database

Before you can create the database you might want to change some of the few parameters in /etc/sysconfig/oracle-xe-18c.conf:

# cat /etc/sysconfig/oracle-xe-18c.conf
#This is a configuration file to setup the Oracle Database.
#It is used when running '/etc/init.d/oracle-xe-18c configure'.

# LISTENER PORT used Database listener, Leave empty for automatic port assignment
LISTENER_PORT=1521

# EM_EXPRESS_PORT Oracle EM Express URL port
EM_EXPRESS_PORT=5500

# Character set of the database
CHARSET=AL32UTF8

# Database file directory
# If not specified, database files are stored under Oracle base/oradata
DBFILE_DEST=/u02/oradata

# SKIP Validations, memory, space
SKIP_VALIDATIONS=false

Especially the datafile path is important. By default they will end up in /opt/oracle/oradata. But even in an XE database with only 12 GByte of user data I would recommend using a separate file system:

# mkdir -p /u02/oradata
# chown oracle:oinstall /u02/oradata

Please notice that the hostname must be defined. If you have a simple environment (like with Virtual Box) without DNS you probably end up with the following error message while configuring the database::

# /etc/init.d/oracle-xe-18c configure
Configuring Oracle Database XE.
[FATAL] [DBT-06103] The port (5,500) is already in use.
   ACTION: Specify a free port.

Database configuration failed. Check logs under '/opt/oracle/cfgtoollogs/dbca'.

The error message is misleading. It’s not the port but the missing hostname. So add the correct one in /etc/hosts. With this change the database configuration task should work without any problems.

# /etc/init.d/oracle-xe-18c configure
...
Oracle Net Listener configured.
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/XE.
Database Information:
Global Database Name:XE
System Identifier(SID):XE
Look at the log file "/opt/oracle/cfgtoollogs/dbca/XE/XE.log" for further details.

Connect to Oracle Database using one of the connect strings:
     Pluggable database: clapton.carajandb.local/XEPDB1
     Multitenant container database: clapton.carajandb.local
Use https://localhost:5500/em to access Oracle Enterprise Manager for Oracle Database XE

Done!

Start and Stop

Even automatic start and stop of the database and listener is available out of the box:

Oracle Linux 6

# /sbin/chkconfig oracle-xe-18c on
# /sbin/service oracle-xe-18c start

Oracle Linux 7

# systemctl daemon-reload
# systemctl enable oracle-xe-18c

Adaptions

There will be no patches available for XE. Because of this I would recommend to deinstall options you don’t need. The most important one is the Oracle Java Virtual Machine (OJVM) because in the past most critical security patches where associated with that option. Mike Dietrich wrote some great blogs on how to deinstall the various options. Here are the ones for OJVM, XML and Oracle Text / Multimedia: JAVAVM and XML Clean Up in Oracle Database 11.2-12.2 and Oracle Multimedia (ORDIM) Clean Up in Oracle Database 11.2-12.2

Deinstallation

Also the commands for the deletion of the database and deinstallation of the software are available – even though you don’t want to deinstall anything.

# /etc/init.d/oracle-xe-18c delete
# yum remove oracle-database-xe-18c

Conclusion

It’s fun! An Oracle database with Enterprise Edition Features and many interesting options free of charge! In my next blog I will go over some examples with the Multitenant Database Option in XE.

BTW: you can configure the XE database with dbca as well. This gives some more opportunities and challenges. I’m going to write a blog about that topic as well..

If you have questions or comments do not hesitate to write a blog comment or drop me an e-mail at info@carajandb.com

2 thoughts on “Oracle 18 XE – First Impressions”

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top