<commit_before># Oracle Database 11*g* XE (11.2.0) on Ubuntu Server 16.04.4 LTS (x86-64) Installation Instructions

## (1) Download the Oracle Database 11.2.0 XE zipped RPM package

It is freely downloadable from their OTN website. (**Note:** It needs to have an Oracle Account: sign in or sign up a new one.) The link is named as "**Oracle Database Express Edition 11g Release 2 for Linux x64**".

Transfer this package to the Ubuntu Server box:

```
$ scp -C oracle-xe-11.2.0-1.0.x86_64.rpm.zip <username>@<hostname>:/home/<username>
oracle-xe-11.2.0-1.0.x86_64.rpm.zip                   100%  301MB   5.4MB/s   00:55
```

## (2) Make the Oracle Database 11.2.0 XE DEB (Debian) package

Unzip the RPM package:

```
$ unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
Archive:  oracle-xe-11.2.0-1.0.x86_64.rpm.zip
   creating: Disk1/
   creating: Disk1/upgrade/
  inflating: Disk1/upgrade/gen_inst.sql
   creating: Disk1/response/
  inflating: Disk1/response/xe.rsp
  inflating: Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm
```

Install the **Alien** package:

```
$ sudo apt-get update && sudo apt-get install alien -y
```

Convert the RPM package to the DEB one (Superuser rights are required):

```
$ cd Disk1 && sudo alien -cd oracle-xe-11.2.0-1.0.x86_64.rpm
oracle-xe_11.2.0-2_amd64.deb generated
```

## (3) Install the DEB package into the system

Adjust the **AWK** interpreter's invocation path (create a symlink) in order to allow the Oracle Database configuration utility find it:

```
$ sudo ln -sfnv /usr/bin/awk /bin/awk
'/bin/awk' -> '/usr/bin/awk'
```

Install the **AIO** library. It is required by the Oracle Database instance binary which is dynamically linked against this library:

```
$ sudo apt-get update && sudo apt-get install libaio1 -y
```

Install the created Oracle Database DEB package:

```
$ sudo dpkg -i oracle-xe_11.2.0-2_amd64.deb
(Reading database ... 145313 files and directories currently installed.)
Preparing to unpack oracle-xe_11.2.0-2_amd64.deb ...
Unpacking oracle-xe (11.2.0-2) over (11.2.0-2) ...
Setting up oracle-xe (11.2.0-2) ...
Executing post-install steps...
/var/lib/dpkg/info/oracle-xe.postinst: line 114: /sbin/chkconfig: No such file or directory
You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for mime-support (3.59ubuntu1) ...
```

## (4) Configure the installed Oracle Database 11.2.0 XE

Adjust Kernel parameters' defaults using [this Bash script](https://raw.githubusercontent.com/rgolubtsov/dotfiles/master/ubuntusrv/oracle-11-2-0-xe-set-kernel-params "Adjust Kernel parameters required by the Oracle Database instance binary.") because it is required by the Oracle Database instance binary to run properly:

```
$ curl  -O https://raw.githubusercontent.com/rgolubtsov/dotfiles/master/ubuntusrv/oracle-11-2-0-xe-set-kernel-params && \
  chmod -v 700 oracle-11-2-0-xe-set-kernel-params                                                                    && \
  sudo       ./oracle-11-2-0-xe-set-kernel-params
...
mode of 'oracle-11-2-0-xe-set-kernel-params' changed from 0644 (rw-r--r--) to 0700 (rwx------)

=== Current values of Kernel parameters:
fs.file-max = 810275
net.ipv4.ip_local_port_range = 32768 60999
kernel.sem = 32000 1024000000 500 32000
kernel.shmmax = 18446744073692774399

=== Set the new values for Kernel parameters:
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65000<commit_msg>Ubuntu Server/amd64: Oracle Database 11g XE Installation Instructions: Fix dpkg output after clean install.<commit_after># Oracle Database 11*g* XE (11.2.0) on Ubuntu Server 16.04.4 LTS (x86-64) Installation Instructions

## (1) Download the Oracle Database 11.2.0 XE zipped RPM package

It is freely downloadable from their OTN website. (**Note:** It needs to have an Oracle Account: sign in or sign up a new one.) The link is named as "**Oracle Database Express Edition 11g Release 2 for Linux x64**".

Transfer this package to the Ubuntu Server box:

```
$ scp -C oracle-xe-11.2.0-1.0.x86_64.rpm.zip <username>@<hostname>:/home/<username>
oracle-xe-11.2.0-1.0.x86_64.rpm.zip                   100%  301MB   5.4MB/s   00:55
```

## (2) Make the Oracle Database 11.2.0 XE DEB (Debian) package

Unzip the RPM package:

```
$ unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
Archive:  oracle-xe-11.2.0-1.0.x86_64.rpm.zip
   creating: Disk1/
   creating: Disk1/upgrade/
  inflating: Disk1/upgrade/gen_inst.sql
   creating: Disk1/response/
  inflating: Disk1/response/xe.rsp
  inflating: Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm
```

Install the **Alien** package:

```
$ sudo apt-get update && sudo apt-get install alien -y
```

Convert the RPM package to the DEB one (Superuser rights are required):

```
$ cd Disk1 && sudo alien -cd oracle-xe-11.2.0-1.0.x86_64.rpm
oracle-xe_11.2.0-2_amd64.deb generated
```

## (3) Install the DEB package into the system

Adjust the **AWK** interpreter's invocation path (create a symlink) in order to allow the Oracle Database configuration utility find it:

```
$ sudo ln -sfnv /usr/bin/awk /bin/awk
'/bin/awk' -> '/usr/bin/awk'
```

Install the **AIO** library. It is required by the Oracle Database instance binary which is dynamically linked against this library:

```
$ sudo apt-get update && sudo apt-get install libaio1 -y
```

Install the created Oracle Database DEB package:

```
$ sudo dpkg -i oracle-xe_11.2.0-2_amd64.deb
Selecting previously unselected package oracle-xe.
(Reading database ... 142241 files and directories currently installed.)
Preparing to unpack oracle-xe_11.2.0-2_amd64.deb ...
Unpacking oracle-xe (11.2.0-2) ...
Setting up oracle-xe (11.2.0-2) ...
Executing post-install steps...

/var/lib/dpkg/info/oracle-xe.postinst: line 114: /sbin/chkconfig: No such file or directory

You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for systemd (229-4ubuntu21.2) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for mime-support (3.59ubuntu1) ...
```

## (4) Configure the installed Oracle Database 11.2.0 XE

Adjust Kernel parameters' defaults using [this Bash script](https://raw.githubusercontent.com/rgolubtsov/dotfiles/master/ubuntusrv/oracle-11-2-0-xe-set-kernel-params "Adjust Kernel parameters required by the Oracle Database instance binary.") because it is required by the Oracle Database instance binary to run properly:

```
$ curl  -O https://raw.githubusercontent.com/rgolubtsov/dotfiles/master/ubuntusrv/oracle-11-2-0-xe-set-kernel-params && \
  chmod -v 700 oracle-11-2-0-xe-set-kernel-params                                                                    && \
  sudo       ./oracle-11-2-0-xe-set-kernel-params
...
mode of 'oracle-11-2-0-xe-set-kernel-params' changed from 0644 (rw-r--r--) to 0700 (rwx------)

=== Current values of Kernel parameters:
fs.file-max = 810275
net.ipv4.ip_local_port_range = 32768 60999
kernel.sem = 32000 1024000000 500 32000
kernel.shmmax = 18446744073692774399

=== Set the new values for Kernel parameters:
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65000
{'fraction_non_alphanumeric': 0.12888645391042322, 'fraction_numerical': 0.08012601013559786, 'mean_word_length': 3.3516090584028606, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '130634', 'n_tokens_mistral': 2927, 'n_tokens_neox': 2478, 'n_words': 753}