Overview and some details

Internet

As some other servers oracle need a connection to the loopback interface. Perhaps it is enough with calling localhost, but I choose to make separate aliases to localhost with an own IP and hostname as I have seen in only a few blogs.

Up to ubuntu 17.10, the recipe is the same, but not on 18.04 as the networking is reformed with netplan and such. There is no resolv-conf.d to create the file base. Instead I edited resolv.conf as a temporary solution. I have to investigate those new features better. libnss-myhostname is also installed by defasult.

java

The most practical method I found was using the ppa: webupd8team/java. Same procedure for all ubuntus.

Most blogs recomends java7, but its quite recently abandoned by oracle for the newer versions 8 and 9.  For those that really need java7 and are a paying customer at Oracle, it can be downloaded though. This is something that can be bought for money.

Recently Oracle announced they will also throw java-8 under the bus and what I understood, JDK and JRE will not be supported after Feb 2019.  This will make problems for products needing JRE, but perhaps the database itself will not be affected.

Update:
Oracle has thrown java 9 and 10 under the buss so we either has to live with old but free 8 or pay up with java 11 as it could seems like,

I dont know if I have some reading disabilities or Oracle changes release schedules sometimes and dropping confusing information.

Now it looks like java 8 will survive through 2020, at least for personal use, otherwise its gone now, besides “premier support”?.

In fact, it looks like java 11 will be free, but not for Oracle products. So, then Oracle will get rid off “freeriders”, they should switch to OpenJDK instead, if I understand it right. Also it looks like it could be free for the regular relesese, two each year, but not for long term supported ones.

Good then is that the gap between Oracles and open java are closing.

But what about XE database that is a free product, shouldnt java 11 it uses usalso be free? I believe free for developers but not so for commercial use.

This is what has to be replaces in the recipes to use Oracle java 11 instead of java 8:
sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get install oracle-java11-installer

This I found in Oracle web pages:
“Oracle will continue to provide free public updates and auto updates of Java SE 8, until at least the end of December 2020 for Personal Users, and January 2019 for Commercial Users.”

“premier support until March 2022”

“commercial license for those using the Oracle JDK as part of an Oracle product or service”

 

Swapfile

Most blogs seems to prefer creating a specific swap in /swapfile. Ubuntu before 17.04 created a swap in a specific partition when OS installed, identified by a sort of uuid, but thereafter it creates a swap in /swapfile. My choise to create a swap in the earlier models, even if it will be two swaps and leave /swapfile as it is in later models.

Shared memory

In ubuntu 14, there is no real mountpoint for /dev/shm, instead a softlink to /run/shm, so this softlink has to be removed and a real directory created. In later versions this has been corrected.

An init-script also has to be created for this shared memory issue. I put it in both rc2.d and rg5.d for both runlevel 2 and 5.

In this script the file /var/lock/subsys/listener is also created. In later version this init-script is not needed but this listener-file has to be created anyhow, I suppose, so I put some code in /etc/rc.local doing the same job.

Kernel parameters

Some information about the kernel parameters I have found on Internet:

Only one of those parameter has different interpretations and values in some blogs: shmall. Some says bytes, other says memory pages. I bet on the later. It is calculated using dividing bytes with PAGE_SIZE.

shmall: the sum of all the shared memory segments on your system, should also be greater than the total of all SGAs configured on your
oracle database server. For 11G-XE its about 1Gb.

shmmax: maximum size of a single shared memory segment represented in bytes. Should be size of the largest SGA defined on your database server.

shmmni: maximum number of shared memory segments.

aio-max-nr: file is the maximum number of allowable concurrent I/O requests.

rmem_default: default TCP/IP receive window, default size of receive buffers used by sockets.
rmem_max: maximum TCP/IP receive window, max size of receive buffers used by sockets.
wmem_default: maximum TCP/IP send window, default setting in bytes of the socket send buffer
wmem_max: maximum TCP/IP send window, max setting in bytes of the socket send buffer

net.ipv4.ip_local_port_range: range of ports to use for client connections.

kernel.sem semmsl semmns semopm semmni
semmsl: maximum number of semaphores per set
semmns: maximum number of semaphores
semopm: maximum operations per semop call
semmni: maximum number of semaphore sets

vm.hugetlb_shm_group: instead of using standard 4KB pages for 32bit systems, with hugetlbpages functionality enabled pagesize will rocket to 4MB and thus save you a lot of CPU cycles as it will save some of your precious physical memory because there will be less pagetables for kernel to worry about. The parameter enables this.

fs.suid_dumpable: set the core dump mode for setuid or otherwise protected/tainted binaries.
0: turned off(default), 1; only root can read the dumps, 2: debug mode

Besides shmall, the only one, there is another one a bit disputed, fs.suid_dumpable. Most blogs want this value to be 2(debug) as it is said oracle recommends.

When I setting this value in system changing it to 1, that it fact seems reasonable, why demand debug mode?. This about suid looks to me like something to avoid, but could it has to do with anything in installation?

When set to 1 system creates core dump if needed, so what else is needed? So I setting it to 2, but accepting system using 1.

In ubuntu 14, those parameters are much lower then oracle demands, but in ubuntu 16 and up 4 of them jump above Oracle needs. Some blogs proposes a decrase to to the demanded values. I decided to leave them as they are, at least until i have figured out if anything other has use of those higher values.

Those parameters are: kernel.shmmax, kernel.shmall, kernel.shmmni and kernel.sem.

Those boosted parameters values in my system are:
kernel.shmmax: from oracle demand 1073741824 to 18446744073692774399
kernel.shmall: from oracle demand 524288 to 18446744073692774399
kernel.sem: from oracle demand 250 3200 100 128 to 32000 1024000000 500 32000
kernel.shmmni: increased to oracle demand 4096

Looks like its a macro setting those values only considering if system is 32-bit or 64-bit.  So I assume there’s no problem leaving them as they are, but on systems with RAM less then 32Gb, they could very well be adjusted down.

I don’t find any process in Ubuntu 18 demanding such values, I think it is mostly databases setting those parameters is needed.

My choice is to leave those parameters as they are by default or setting them to the oracle demands, like for Ubuntu 14, especially for smaller systems.

Oracle users, groups and directories

In some blogs /opt is named as installation dir, but in most, u01 and u02 are given and those seems to be what the database itself want. Perhaps this is something old.

The home dir also differ in blogs and I choose /home/oracle. Same procedure for all ubuntus. As 11G-XE doesn’t use ASM, the adding to group asmadmin don’t look useful to me, but it wont make any harm.

Limits

Oracle demands much higher limits on user processes and open files then the standard installations, of course.

I found two alternatives, the file ordinary file /etc/security/limits.conf and a specific created one: /etc/security/limits.d/oracle.conf. I edited both to be sure and don’t suppose anything will be hurt.

Those limits has to be “allowed” by adding a rule in /etc/pam.d/common-session, but its not enough. All common-session files has to be edited and the other one I found was /etc/pam.d/common-session-noninteractive. Same procedure for all ubuntus

Fake installer file

This is not in all blogs and is needed to avoid stupid comments about non-licensed on this OS and such. Installation script recognizes ubuntu’s replacement for “/etc/functions” functions, but not as it seems, when using a “fake installer” file.

A consequence is that the installation script calls functions in /etc/functions that doesn’t exist in Ubuntu, but has a sort of counterparts in /lib/lsb/init-functions so I make a softlink to it. I dont know which, or if the database uses some of those init- or system-functions. Same procedure for all ubuntus

Sudoers

Some difference in the blogs about group, but I suppose database only need sudo-power during installation so I choose oracle:oinstall. Same procedure for all ubuntus

Softlinks

Because some programs, like awk and rpm and libraries are residing in different directories in different OS’es, there is a case for softlinking here. Some blogs differ on some few libs and the “reverse” softlink for bash I have only seen in one blog. I choose to softlink all libs and programs I found in the blogs. Same procedure for all ubuntus

Packages packages packages

On of the subjects the blogs differ most in. Some has only a few, most necessary ones, while other has a lot. I grabbed everyone I found even if I haven’t figured out why and if they are really needed. Only they aren’t harmful in any way.

Quite a lot has happened with Linux since 11G-XE was released so problems and surprises should not directly be unexpected when migrating from older versions and using kind of legacy software.

11G-XE depends a lot on 32-bit code, but with the invention of Multiarch, its easier to applying packages with different binary targets on same system. Packages can have both i386(32-bit) and amd64)64.bit) versions. Sometimes it looks like both versions can coexist, but sometimes one has to chose. It will then be the older, slower 32-bit one, the :i386 for the sake of oracle 11G-XE.

In a couple of blogs I have found some packages related to WIM-files(Windows Imaging). I don’t know when or if they are used but installing them anyhow. A bit confusing is that one package is called wimlib-dev in ubuntu 14 but libwim-dev in later versions.

Problem packages with 16.04 and later

Package ‘pdksh’ has no installation candidate:

my explanation: obsolete package, replaced by mksh. I suspect there could be issues with some scripts, but I dont know any.
my choice of solution: sudo apt install mksh

Unable to locate package lib32bz2-1.0 and lib32bz2-dev:

my explanation: could be naming problems: fresher name but probably the same package
my choice of solution: sudo apt install libbz2-dev:i386

Package ‘libmotif3’ and ‘libmotif4’ has no installation candidate:

my explanation: obsolete packages. libmotif4 replaced libmotif3 but is now fading away, dont know of any replacement.
my choice of solution: sudo apt install libuil4
download Debian libmotif4 for ubuntu16(xenial) from launchpad
sudo dpkg -i libmotif4_2.3.4-8ubuntu1_amd64.deb

Unable to locate package libbeecrypt7:

my explanation: obsolete package, don’t know of any replacement.
my choice of solution: download Debian libbeecrypt7 for ubuntu16(xenial) from launchpad
sudo dpkg -i libbeecrypt7_4.2.1-4_amd64.deb

Unable to locate package lsb-desktop lsb-rpm lsb-cxx:

my explanation: obsolete packages, functions replaced by newer models.
my choice of solution: Just forget them.

Start scripts

There is only 2 scripts to care about in this case. One imitates chkconfig and the other one creates the lock-file /var/subsys/listener if it doesn’t exists as well as creates a mountpoint for /dev/shm in Ubuntu 14.

chkconfig uses update- rc.d to create the configuration script in /etc/init.d.

Ubuntu has traveled from System V to upstart and now systemd and that determines where those scripts resides.

For this installation it doesn’t matter as only System-V is used and other systems has backward compatibility. Ubuntu places System-V scripts for applications in /etc/init.d, like the config script, other Linuxes uses for example /etc/rc.d/init.d. System start scripts are put, after respective runlevel in /etc/rc(n).d, like the one creating the lock file and shared memory. Today, the scripts in rc2,d etc are onlysoftlinks to /etc/init.d.

As shared memory has a mountpoint, there is no need for maintaining a service in Ubuntu after 14, I put the code creating “/var/lock/subsys/listener” file in “/etc/rc.local”.  This file disappeared in Ubuntu 18, but if created, it will run as a service as usual.

Runlevel

11G-XE seems to demand the System-V runlevel 5, while in Ubuntu default is 2. For ununtu 14, using upstart, runlevel 2-5 is the same so no problem changing it.

In ubuntus above it, using systemd, they are probably less important. There is however a corresponding parameter graphical.target for runlevel 5. So I set runlevel the upstart way, checking both upstart and systemd. In Ubuntu 18, runlevel 5 is the default though.

The database install

The database .rpm has to be converted to a .deb package, using alien. Same procedure for all ubuntus.

What differ in some blogs are some environment variables and where to put them. One reason for difference could be that not all are needed for installation and running database, some could be only needed in installation , some could be useful for development tools etc. Examples are .profile, .bashrc and /etc/environmemt.

There is also differences in install-script and oracle_env.sh. One reason could be that a variable is needed for setting an Oracle parameter.

I, of course added all those I found and put them in /etc/environment so applications not started from command prompt could find them. .

/etc/environment is no shell-script-thing so all variables should be in the form of key-value pairs avoiding environment variables.

LOG, PATH and NLS_LANG are specific for the OS/user and they can be found resolved after installation using printenv. LOG that depende on “hostname” can be found searching for file listener.log.

NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh` is in my case resolved to NLS_LANG=SWEDISH_SWEDEN.AL32UTF8 and in LOG, hostname in my case is folke-VirtualBox.

Leave a Reply

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