Download the Oracle 11gR2 express edition installer from the link given below:
http://www.oracle.com/technetwork/products/express-edition/downloads/index.html( You will need to create a free oracle web account if you don't already have it )
Unzip it :
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zipInstall the following packages :
sudo apt-get install alien libaio1 unixodbc vimThe Red Hat based installer of Oracle XE 11gR2 relies on /sbin/chkconfig, which is not used in Ubuntu. The chkconfig package available for the current version of Ubuntu produces errors and my not be safe to use. So you'll need to create a special chkconfig script, below is a simple trick to get around the problem and install Oracle XE successfully:
sudo vi /sbin/chkconfig(copy and paste the following into the file )
#!/bin/bashSave the above file and provide appropriate execute privilege :
# 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
#EOF
chmod 755 /sbin/chkconfigOracle 11gR2 XE requires to set the following additional kernel parameters:
sudo vi /etc/sysctl.d/60-oracle.conf(Enter the following)
# Oracle 11g XE kernel parameters(Save the file)
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65000
kernel.sem=250 32000 100 128
kernel.shmmax=536870912
Note: kernel.shmmax = max possible value , e.g. size of physical RAM ( in bytes e.g. 512MB RAM == 512*1024*1024 == 536870912 bytes )
Verify the change :
sudo cat /etc/sysctl.d/60-oracle.confLoad new kernel parameters:
sudo service procps startVerify:
sudo sysctl -q fs.file-maxIncrease the system swap space : Analyze your current swap space by following command :
-> fs.file-max = 6815744
free -mMinimum swap space requirement of Oracle 11gR2 XE is 2 GB . In case, your is lesser , you can increase it by following steps in one of my previous posts.
make some more required changes :
sudo ln -s /usr/bin/awk /bin/awkConvert the red-hat ( rpm ) package to Ubuntu-package :
sudo mkdir -p /var/lock/subsys
sudo touch /var/lock/subsys/listener
sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm(this may take a long time)
Go to the directory where you created the ubuntu package file in the previous step and enter following commands in terminal :
sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb
Do the following to avoid getting MEMORY TARGET error ( ORA-00845: MEMORY_TARGET not supported on this system ) :
The reason of doing all this is that on a Ubuntu system /dev/shm is just a link to /run/shm but Oracle requires to have a seperate /dev/shm mount point.
To make the change permanent do the following :
create a file named S01shm_load in /etc/rc2.d :
You can now proceed to the Oracle initialization script
sudo rm -rf /dev/shm(here size will be the size of your RAM in MBs ).
sudo mkdir /dev/shm
sudo mount -t tmpfs shmfs -o size=2048m /dev/shm
The reason of doing all this is that on a Ubuntu system /dev/shm is just a link to /run/shm but Oracle requires to have a seperate /dev/shm mount point.
To make the change permanent do the following :
create a file named S01shm_load in /etc/rc2.d :
sudo vi /etc/rc2.d/S01shm_loadThen copy and paste following lines into the file :
#!/bin/shSave the file and provide execute permissions :
case "$1" in
start) mkdir /var/lock/subsys 2>/dev/null
touch /var/lock/subsys/listener
rm /dev/shm 2>/dev/null
mkdir /dev/shm 2>/dev/null
mount -t tmpfs shmfs -o size=2048m /dev/shm ;;
*) echo error
exit 1 ;;
esac
chmod 755 /etc/rc2.d/S01shm_loadThis will ensure that every-time you start your system, you get a working Oracle environment.
You can now proceed to the Oracle initialization script
sudo /etc/init.d/oracle-xe configureEnter the following configuration information:
- A valid HTTP port for the Oracle Application Express (the default is 8080)
- A valid port for the Oracle database listener (the default is 1521)
- A password for the SYS and SYSTEM administrative user accounts
- Confirm password for SYS and SYSTEM administrative user accounts
- Whether you want the database to start automatically when the computer starts (next reboot).
a) Set-up the environmental variables, add following lines to the bottom of /etc/bash.bashrc :
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xeb) execute your .profile to load the changes:
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
source /etc/bash.bashrcStart the Oracle 11gR2 XE :
sudo service oracle-xe startThe output should be similar to following :
user@machine:~$ sudo service oracle-xe startAnd you're done :)
Starting Oracle Net Listener.
Starting Oracle Database 11g Express Edition instance.
user@machine:~$
Thank you so much!!
ReplyDeleteGreat tutorial, works perfectly ! ;)
Muchas gracias, te pasaste excelente tutorial.
ReplyDeleteExcelent tutorial... Thank You so much!
ReplyDeleteI get bash: "/etc/init.d/oracle-xe: Permission denied" when i try to execute "sudo /etc/init.d/oracle-xe configure" even when i log into the shell as root. what could be the problem?
ReplyDeleteCheck if the file is executable.
DeleteGracias por el tutorial! Esta explicado a la perfeccion!
ReplyDeleteWhen I enter:
ReplyDeletesudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
I get
File "oracle-xe-11.2.0-1.0.x86_64.rpm" not found.
Also I enter sudo /etc/init.d/oracle-xe configure
I get sudo: /etc/init.d/oracle-xe: command not found
Pls help I have Ubuntu 10.04 lucid
I see oracle-xe-11.2.0-1.0.x86_64.rpm.zip but not oracle-xe-11.2.0-1.0.x86_64.rpm in my directory
same error
Deleteroot@radhekrishan:/home/barcelona# service procps start
ReplyDeletestart: Unknown job: procps
this is the error which I got!.
Please help !
Starting Oracle Net Listener.
ReplyDeleteStarting Oracle Database 11g Express Edition instance.
Failed to start Oracle Net Listener using /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr and Oracle Express Database using /u01/app/oracle/product/11.2.0/xe/bin/sqlplus.
I got this error, what can I do to fixt it?
Make sure the TCP port is not already in use by another process ant that the hostname confugured is resolvable by the host, you can edit:
Delete/u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
and
/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora
and change the hostname to 0.0.0.0
also make sure that /var/tmp/.oracle is owned by oracle:
chown -R oracle:dba /var/run/.oracle
chown -R oracle:dba /var/tmp/.oracle
or try useradd oracle
DeleteI would like to know how to use HR Schema in the Apex
ReplyDeleteI Would like to know how to use HR Schema in the Apex please
ReplyDeleteStarting Oracle Net Listener.
ReplyDeleteStarting Oracle Database 11g Express Edition instance.
Failed to start Oracle Net Listener using /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr and Oracle Express Database using /u01/app/oracle/product/11.2.0/xe/bin/sqlplus.
I changed hostname to 0.0.0.0 still getting same error
Starting Oracle Net Listener.
ReplyDeleteStarting Oracle Database 11g Express Edition instance.
Failed to start Oracle Net Listener using /u01/app/oracle/product/11.2.0/xe/bin/tnslsnr and Oracle Express Database using /u01/app/oracle/product/11.2.0/xe/bin/sqlplus.
i changed hostname to 0.0.0.0 still getting
same error.
Great tutorial... Thanks!!
ReplyDeleteWorks also perfectly for a Debian system.
ReplyDeleteVery good, saved my life ;-)
Hi,
ReplyDeleteI can not get this error fixed:
Starting Oracle Net Listener...Done
Configuring database...
Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details
In the postDBCreation.log :
begin
*
ERROR at line 1:
ORA-31112: fail to unregister for HTTP port using xdb configuration
ORA-06512: at "XDB.DBMS_XDB", line 528
ORA-06512: at "XDB.DBMS_XDB", line 667
ORA-06512: at line 2
Hopefully somebody can help me :)
sudo service oracle-xe start
ReplyDeleteoutput:
Job for oracle-xe.service failed. See "systemctl status oracle-xe.service" and "journalctl -xe" for details
systemctl status oracle-xe.service:
oracle-xe.service - SYSV: This is a program that is responsible for taking care of
Loaded: loaded (/etc/init.d/oracle-xe)
Active: failed (Result: exit-code) since Fri 2015-07-24 22:04:33 IST; 4min 44s ago
Docs: man:systemd-sysv-generator(8)
Process: 7849 ExecStart=/etc/init.d/oracle-xe start (code=exited, status=1/FAILURE)
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 systemd[1]: Starting SYSV: This i...
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 oracle-xe[7849]: Starting Oracle ...
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 su[7857]: No passwd entry for use...
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 oracle-xe[7849]: Starting Oracle ...
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 su[7863]: No passwd entry for use...
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 oracle-xe[7849]: Failed to start ...
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 systemd[1]: oracle-xe.service: co...
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 systemd[1]: Failed to start SYSV:...
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 systemd[1]: Unit oracle-xe.servic...
Jul 24 22:04:33 sibideiveegan-Inspiron-3542 systemd[1]: oracle-xe.service fai...
Hint: Some lines were ellipsized, use -l to show in full
how i can resolve it?
Everytime i ran sudo /etc/init.d/oracle-xe configure it showed installed successfully and then showed the following error:"/etc/init.d/oracle-xe: line 178: /etc/sysconfig/oracle-xe: No such file or directory".Following which it does not move ahead showing the same error.Is there are solution to this?
ReplyDeletesame problem here brother if you find solution then please share it with me..thanks
Deletethank you so much!!!
ReplyDeleteThank you, very useful! Of course ridiculous that Oracle hasn't made proper packages for Ubuntu itself, seeing that it's such a widely used Linux distro.
ReplyDeleteI installed oracle11g xe in my ubuntu14.04 and worked fine but after rebooting the system. Oracle is not working.when i run sudo /etc/init.d/oracle-xe start it says database is not configured when i run configure it says Installation completed successfully.
ReplyDelete/etc/init.d/oracle-xe: line 178: /etc/sysconfig/oracle-xe: No such file or directory
i searched on internet and tried couple of tricks but nothing worked.Please Help Me.
Thanks in Advance.
First, great article! I wanted to post an issue I had with shared memory since I found the solution here.
ReplyDeleteYou talk about getting a MEMORY TARGET error which I remembered when my Oracle instance failed connections with:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
I checked the /dev/shm directory and it was again linked to /run/shm. I think this happened after a reboot. I simply re-ran the steps in your blog and Oracle was fixed. I'm going to make that change more permanent but wanted to let others know that the /dev/shm directory can cause other errors too.
Hi,
ReplyDeleteI Installed oracle-xe successfully on ubuntu machine & after installation i was able to connect.
But after restarting my machine it throws following error while connecting:
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
What can be issue?
Thanks
Satish Lakhani
Hi,
ReplyDeleteGreat tutorial! It worked fine on Ubuntu 15.10.
Thanks,
Daniel.
thanks alot ...this tutorial is very simple to follow yet it works like charm
ReplyDeletesudo dpkg --install oracle-xe_11.2.0-2_amd64.deb
ReplyDeleteafter this step i am getting an error as
dpkg: error processing archive oracle-xe_11.2.0-2_amd64.deb (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
oracle-xe_11.2.0-2_amd64.deb
help me
I am getting the same error at that step - did you figure this out?
DeleteI get the same error at the same point. Did you figure this out?
Delete