Recipe: Ubuntu 18.04

Red text means instance specific values and green text content in a file,, blue text is instructions rather then commands, rest could be run in command prompt.

Regarding progress with 18c XE, look at intro-page.

I have tested an install on stable release and found /etc/rc.local didn’t execute and added a “shebang” in start of file.

25 June 2018 I corrected 5 flaws. I removed part with runlevel as it already set to the correct one, 5.  I also added nameserver 127.0.1.1 to stub-resolv.conf. None of those would have affected  the installation.  Added missing -m in creation of user oracle.  Finally removed -s in packages cabextract install as in libbz2-dev:i386 install.

Internet

sudo gedit /etc/hosts
127.0.0.2 oracle

sudo gedit /etc/network/interfaces
auto lo:0
iface lo:0 inet static
address 127.0.0.2
netmask 255.0.0.0
auto lo:1
iface lo:1 inet static
address 127.0.1.1
netmask 255.0.0.0

sudo gedit /run/systemd/resolve/stub-resolv.conf

nameserver 127.0.0.1
nameserver 127.0.0.2

java

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

Listener lock file

sudo gedit /etc/rc.local

#!/bin/bash
if [ ! -f /var/lock/subsys/listener ]; then
touch /var/lock/subsys/listener
fi
exit 0

sudo chmod +x /etc/rc.local

Kernel parameters

sudo gedit /etc/sysctl.conf
fs.file-max=6815744
fs.aio-max-nr=1048576
fs.suid_dumpable=1
net.ipv4.ip_local_port_range=9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576
vm.hugetlb_shm_group=1001

The parameters shmmax, shmall, are set to higher values then Oracle 11G-XE demands so they were left as they are. Alternatively they can be set to Oracle 11g-XE demands with editing /etc/sysctl.conf:

kernel.shmmax=1073741824
kernel.shmall=524288
kernel.sem=250 32000 100 128

Oracle users, groups and directories

sudo mkdir -p /u01/app/oracle
sudo mkdir -p /u02/oradata

sudo groupadd -g 502 oinstall
sudo groupadd -g 503 dba
sudo groupadd -g 504 oper
sudo groupadd -g 505 asmadmin
sudo groupadd nobody

sudo useradd -u 502 -g oinstall -G dba,asmadmin,oper -s /bin/bash -m -d /home/oracle oracle
sudo passwd oracle
sudo usermod -g nobody nobody

sudo chown -R oracle:oinstall /u01/app/oracle
sudo chown -R oracle:oinstall /u01
sudo chown -R oracle:oinstall /u01/app
sudo chown -R oracle:oinstall /u02/oradata
sudo chown -R oracle:oinstall /u02

Other files and directories

sudo gedit /sbin/chkconfig
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01

sudo chmod 755 /sbin/chkconfig

sudo mkdir /etc/sysconfig

Limits

sudo gedit /etc/security/limits.d/oracle.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

sudo gedit /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

sudo gedit /etc/pam.d/common-session
session required pam_limits.so

sudo gedit /etc/pam.d/common-session-noninteractive
session required pam_limits.so

“fake” installer, sudo and runlevel

sudo gedit /etc/redhat-release
Red Hat Linux release 5

sudo visudo -f /etc/sudoers.d/oracle
%oinstall ALL=(ALL) ALL

Softlinks

sudo ln -s /usr/bin/basename /bin/basename
sudo ln -s bin/bash /usr/bin/bash
sudo ln -s /usr/bin/rpm /bin/rpm
sudo ln -s /usr/bin/awk /bin/awk

sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64

sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /lib64/libstdc++.so.6
sudo ln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/libgcc_s.so.1
sudo ln -s /usr/lib/i386-linux-gnu/libpthread_nonshared.a /usr/lib/libpthread_nonshared.a

sudo ln -s /lib/lsb/init-functions /etc/init.d/functions

install packages

sudo apt install libc6-i386

sudo apt install gcc-multilib g++-multilib libc6-dev-i386 libstdc++6:i386

sudo apt install alien autoconf automake autotools-dev elfutils rpm rpm-common

sudo apt install build-essential debhelper expat gawk gsfonts-x11 html2text sysstat

sudo apt install unixodbc unixodbc-dev doxygen ksh openssh-server pax perl-doc rlwrap

sudo apt install lsb lsb-core zlibc

sudo apt install lib32z1-dev lib32ncurses5 libaio1 libaio-dev

sudo apt install libelf-dev libodbcinstq4-1 libpth-dev libpthread-stubs0-dev libpthread-workqueue0 libpthread-workqueue-dev

sudo apt-get install libtiff5-dev libzthread-dev libqt4-opengl:i386 libodbcinstq4-1:i386 libglu1-mesa:i386

sudo apt-get install  cabextract

sudo add-apt-repository ppa:nilarimogard/webupd8

sudo apt update

sudo apt install wimtools libwim-dev

sudo apt install -s libbz2-dev:i386

sudo apt install libuil4

download libmotif4_2.3.4-8ubuntu1_amd64.deb
from https://launchpad.net/ubuntu/xenial/amd64/libmotif4/2.3.4-8ubuntu1
sudo dpkg -i libmotif4_2.3.4-8ubuntu1_amd64.deb

download libbeecrypt7_4.2.1-4_amd64.deb
from https://launchpad.net/ubuntu/xenial/amd64/libbeecrypt7/4.2.1-4
sudo dpkg -i libbeecrypt7_4.2.1-4_amd64.deb

The database install

sudo alien -d -c oracle-xe-11.2.0-1.0.x86_64.rpm
sudo dpkg –install oracle-xe_11.2.0-2_amd64.deb

sudo gedit /etc/environment
PATH="/u01/app/oracle/product/11.2.0/xe/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin"
ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
LSNR=/u01/app/oracle/product/11.2.0/xe/bin/lsnrctl
SQLPLUS=/u01/app/oracle/product/11.2.0/xe/bin/sqlplus
ORACLE_OWNER=oracle
ORACLE_UNQNAME=XE
ORACLE_SID=XE
LOG=/u01/app/oracle/diag/tnslsnr/
hostname /listener/trace/listener.log
CLASSPATH=/u01/app/oracle/product/11.2.0/xe/jlib:/u01/app/oracle/product/11.2.0/xe/rdbms/jlib

NLS_LANG=SWEDISH_SWEDEN.AL32UTF8

or using .profile/.bashrc
sudo gedit /home/user/.profile
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_HOME_LISTNER=/u01/app/oracle/diag/tnslsnr/hostname/listener/trace/
export LSNR=$ORACLE_HOME/bin/lsnrctl
export SQLPLUS=$ORACLE_HOME/bin/sqlplus
export ORACLE_OWNER=oracle
export LOG="$ORACLE_HOME_LISTNER/listener.log"
export ORACLE_UNQNAME=XE
export ORACLE_SID=XE
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export PATH=$ORACLE_HOME/bin:$PATH


Test script, parameters etc

More detailed description of the installing and some little discussions

5 Replies to “Recipe: Ubuntu 18.04”

    1. Hello mam and thanks for comment, you are the first one.

      I didnt expect anyone to find this blog yet, but I checked stats and found several has found it.

      Problem for you is that you are installing 12c and my blog is about oracle 11g-xe on ubuntu only.
      I suppose I have to make this more clear.

      I have made some research on 12c and Ubntu 18.04 though and found those blogs:

      “https://tutorialforlinux.com/2018/05/09/how-to-install-oracle-12c-r1-database-on-ubuntu-18-04-bionic-64bit-easy-guide-installing-packages/”
      and
      “https://stackoverflow.com/questions/51060012/installing-oracle-12c-r2-on-ubuntu-18-04#”

      The later is about linking problems. The first one is more detailed but I doubt the packages are able to install.

      You can comment if any of those blogs are useful.

      Regards
      Folke Larsson

  1. after executing all above steps, when i hit sqlplus in oracle user, i see below

    Enter user-name: system
    Enter password:
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Linux-x86_64 Error: 2: No such file or directory
    Process ID: 0
    Session ID: 0 Serial number: 0

    please suggest

    1. Hello Sivaji

      Indication instance not started.

      Check if lictener lockfile exists: /var/lock/subsys/listener
      You can also run the testscrpt.

      Check if instance is up: sudo /etc/init.d/oracle-xe status

      Then from command prompt:

      sqlplus /nolog

      connect sys as sysdba

Leave a Reply

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