Oracle 18c XE on Linux Mint

When things go naturally, you select an operating system, supported by the database of choice. Unfortunately, the only natural in our business is a changes.  And somewhere in the middle of that, you find yourself with the task like "Hey, we need Oracle database on the Linux Mint box."  Ugh, that's a funky cocktail, and you may need my cookbook for that.

Start with the shopping list:

  • The OS is Linux x86-64, and if it's a RedHat based system you could stop right there and follow the Oracle instllation guide.
  • You shoud have 1GB+ of RAM, Oracle says 2GB is even better.
  • Elevated access to the system. You could not do it without sudo access.
  • Basic knowledge of Bash and Nano editor
  • You need Oracle XE 18c RPM package downloaded on your machine.
  • At least 10GB of free space for package conversion and DB installation

And if you meet  all the requirements, go ahead an prepare you Linux.  

  1. Update Aptitude package cache and install libaio. Most likely you don't have it
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install libaio*
  1. Install alien package.
sudo apt-get-install alien

If you haven't done it before, copy a database RPM package to the server filesystem. Any location should be okay, but make sure that you have enough space for the pack unpack operations. The RPM is massive, so you have some decent amount of time until alien will convert it.

The alien command allows you to combine conversion and installation: don't do it. Otherwise, you will lose another half an hour if you decide to reinstall database from scratch.

  1. If you database RPM in the /opt/distr folder. Conversion commands are:
cd /opt/distr
alien  --scripts oracle-database-xe-18c-1.0-1.x86_64.rpm 
  1. Make sure that you see new package and if it's about 2.4Gb, you can delete original binaryies.
ls -la oracle*.deb
rm oracle-database-xe-18c-1.0-1.x86_64.rpm
  1. The intallation is stright forward, just install your new .deb package.
dpkg -i oracle-database-xe-18c_1.0-2_amd64.deb

The Installer will ask for database  administrators passwords.  You could do the silent installation as in Oracle Documentation, but don't follow documentation further than that. We need to address a few issues before you can complete the database configuration.

  1. Make sure that you have IPv4 record for your host in /etc/hosts file. Without it, network configuration wizard will be really upset. For my VM it's similar to
10.10.10.10 lmde3.vb.mmikhail.com lmde3
  1. We know from the begining, Debian-based systems can't pass the system validation process. To bypass systemm check, edit the file /etc/init.d/oracle-xe-18c-config
cd /etc/init.d/
cp oracle-database-xe-18c oracle-database-xe-18c-cfg
nano oracle-database-xe-18c-cfg
  1. Add the parameter -J-Doracle.assistants.dbca.validate.ConfigurationParams=false to line 289 as below:
$SU -s /bin/bash  $ORACLE_OWNER -c "(echo '$ORACLE_PASSWORD'; echo '$ORACLE_PASSWORD'; echo '$ORACLE_PASSWORD') | $DBCA -silent -createDatabase -gdbName $ORACLE_SID -templateName $TEMPLATE_NAME -characterSet $CHARSET -createAsContainerDatabase $CREATE_AS_CDB -numberOfPDBs $NUMBER_OF_PDBS -pdbName $PDB_NAME -sid $ORACLE_SID -emConfiguration DBEXPRESS -emExpressPort $EM_EXPRESS_PORT -J-Doracle.assistants.dbca.validate.DBCredentials=false -sampleSchema true -J-Doracle.assistants.dbca.validate.ConfigurationParams=false $SQLSCRIPT_CONSTRUCT $DBFILE_CONSTRUCT $MEMORY_CONSTRUCT"
  1. Save the changes in the script. Another tweak will address missed library issue. Original link is broken, so I just linked existing library fro mthe different folder
LD_LIBRARY_PATH=/opt/oracle/product/18c/dbhomeXE/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
cd /opt/oracle/product/18c/dbhomeXE/lib/
ln -s /opt/oracle/product/18c/dbhomeXE/inventory/Scripts/ext/lib/libclntshcore.so.18.1
chown oracle:oinstall libclntshcore.so.18.1
  1. Finally, configure the database
/etc/init.d/oracle-xe-18c-cfg configure
....
# Follow the documentation and answer the questions 
# When setup is completed, remove the altered file. 
....
rm /etc/init.d/oracle-xe-18c-cfg
# Start Oracle XE database
/etc/init.d/oracle-xe-18c start

At this point you have database and listener started. Enjoy  your mint fresh XE instance!

Oracle XE 18c EM Console