INSTALL ORACLE XE 11g on UBUNTU SERVER LINUX 16.04
Download oracle installation file
http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html
Convert from rpm file to deb for Ubuntu
# alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
oracle-xe_11.2.0-2_amd64.deb generated
# ls -l
-rw-rw-r-- 1 mzadmin admin 317320273 Aug 28 2011 oracle-xe-11.2.0-1.0.x86_64.rpm
-rw-r--r-- 1 root root 275903388 Mar 26 11:08 oracle-xe_11.2.0-2_amd64.deb
# vi /sbin/chkconfig
1 #!/bin/bash
2 # Oracle 11gR2 XE installer chkconfig hack for Ubuntu
3 file=/etc/init.d/oracle-xe
4 if [[ ! `tail -n1 $file | grep INIT` ]]; then
5 echo >> $file
6 echo '### BEGIN INIT INFO' >> $file
7 echo '# Provides: OracleXE' >> $file
8 echo '# Required-Start: $remote_fs $syslog' >> $file
9 echo '# Required-Stop: $remote_fs $syslog' >> $file
10 echo '# Default-Start: 2 3 4 5' >> $file
11 echo '# Default-Stop: 0 1 6' >> $file
12 echo '# Short-Description: Oracle 11g Express Edition' >> $file
13 echo '### END INIT INFO' >> $file
14 fi
15 update-rc.d oracle-xe defaults 80 01
16 #EOF
# ll /sbin/chkconfig
-rw-r--r-- 1 root root 553 Mar 26 11:19 /sbin/chkconfig
# sudo chmod 755 /sbin/chkconfig
--
# vi /etc/sysctl.d/60-oracle.conf
# Oracle 11g XE kernel parameters
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65000
kernel.sem=250 32000 100 128
kernel.shmmax=536870912
# service procps restart
# sysctl -q fs.file-max
fs.file-max = 6815744
# ln -s /usr/bin/awk /bin/awk
# mkdir /var/lock/subsys
# touch /var/lock/subsys/listener
INSTALL
# dpkg --install oracle-xe_11.2.0-2_amd64.deb
Run configure script
# /etc/init.d/oracle-xe configure
Port for Oracle Application Express (default 8080): 8081
(using 8081 because 8080 already exist for other app)
Port for databaselistener [1521]: <Enter>
Specify password: oracle
Confirm pwd: oracle
Oracle to start on boot : y
Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.
---
# cat /etc/passwd
oracle:x:1004:1004::/u01/app/oracle:/bin/bash
# id oracle
uid=1004(oracle) gid=1004(dba) groups=1004(dba)
Change oracle id password or else sudo to oracle id
# passwd oracle
Setup oracle variables
# vi /etc/bash.bashrc
# ORACLE ENV VARIABLES
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
Load changes
# source /etc/bash.bashrc
Check
# echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/xe
Start Oracle
# service oracle-xe start
# service oracle-xe status
oracle-xe.service - LSB: Oracle 11g Express Edition
Loaded: loaded (/etc/init.d/oracle-xe; bad; vendor preset: enabled)
Active: active (exited) since Mon 2018-03-26 13:10:41 +08; 22s ago
Docs: man:systemd-sysv-generator(8)
Process: 24839 ExecStart=/etc/init.d/oracle-xe start (code=exited, status=0/SUCCESS)
Mar 26 13:10:41 KL-TEST systemd[1]: Starting LSB: Oracle 11g Express Edition...
Mar 26 13:10:41 KL-TEST oracle-xe[24839]: Oracle Database 11g Express Edition instance is already started
Mar 26 13:10:41 KL-TEST systemd[1]: Started LSB: Oracle 11g Express Edition.
--
Make getting started link on desktop executable
$ cd ~/Desktop
$ chmod a+x oraclexe-gettingstarted.desktop
REFERENCE
http://blog.whitehorses.nl/2014/03/18/installing-java-oracle-11g-r2-express-edition-and-sql-developer-on-ubuntu-64-bit/
EXAMPLE:
$ id
oracle
$ sqlplus
Enter username: mzadmin
Enter password: xxxx
SQL>
SQL> conn / as sysdba
Connected.
SQL> create user mzadmin identified by dba;
SQL> grant dba to mzadmin;
SQL> conn mzadmin as sysdba;
Password: dr
>Create table & insert data using SQL Developer Client
>Check data from sql*plus cmd line
SQL> SELECT * FROM MZADMIN.TPHONE;
ID NAME PHONE
---------- ------------------------- ---------------
1 AINA 0193831234
CHECK SESSION PARAMETER & CURRENT USAGE
SQL> select name, value from v$parameter where name='sessions';
NAME
--------------------------------------------------------------------------------
VALUE
--------------------------------------------------------------------------------
sessions
172
SQL> select count(*) from v$session;
COUNT(*)
----------
35