How to install Oracle Database Express Edition 11g Release 2 (11.2) on Debian Squeeze x86_64

There's a very good howto on installing this particular Oracle RDBMS version on Ubuntu 11.10 here. However Ubuntu is not Debian, there're a few differences. Mostly you've to skip a few steps:

  • swap space is not a hard requirement (ie. if you've enough RAM, the installer and the RDBMS won't complain about the absence of swap memory)
  • in a typical server environment you won't run into the problem of resizing the root partition or anything like that (you most probably will create a new partition/LVM volume for Oracle anyway ... a 3GB volume is sufficient for the software, the starter database and a few hundred MB of user data)
  • the /dev/shm directory is still present in Debian Squeeze, no need to "backport" it
Essentially if you've a fully functional Debian Squeeze server (with enough memory -physical and/or swap- to run everything including the Oracle DB) and you've already set up some (at least 2.5 GB) storage for /u01, then you can just execute the following steps (as documented in the previously referenced howto): 3, 5, 8, 9.

I've extracted the relevant code from the howto, it should work with a copy&paste (assuming you've already downloaded the Oracle installer RPM into /tmp):
apt-get install alien libaio1 unixodbc
cat > /etc/sysctl.d/60-oracle.conf <<EOF
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65500
kernel.sem=250 32000 100 1024
kernel.shmmax=268435456
EOF
service procps start
sysctl -q fs.file-max
sysctl -q kernel.shmmax
sysctl -q net.ipv4.ip_local_port_range
sysctl -q kernel.sem
# Set up /u01 as you like (I created a 3GB LVM2 volume)
df -h /u01
cd /tmp
alien --to-deb --scripts oracle-xe-11.2.0-1.0.x86_64.rpm
ls -al
ln -s /usr/bin/awk /bin/awk
mkdir /var/lock/subsys
cat > /sbin/chkconfig <<EOF
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Debian based Linux (by dude)
# Only run once.
echo "Simulating /sbin/chkconfig..."
if [[ ! \`tail -n1 /etc/init.d/oracle-xe | grep INIT\` ]]; then
cat >> /etc/init.d/oracle-xe <<-EOM
#
### BEGIN INIT INFO
# Provides:                  OracleXE
# Required-Start:        \\\$remote_fs \\\$syslog
# Required-Stop:        \\\$remote_fs \\\$syslog
# Default-Start:            2 3 4 5
# Default-Stop:            0 1 6
# Short-Description:   Oracle 11g Express Edition
### END INIT INFO
EOM
fi
update-rc.d oracle-xe defaults 80 01
EOF
chmod 755 /sbin/chkconfig
dpkg -i oracle-xe_11.2.0-2_amd64.deb
/etc/init.d/oracle-xe configure
rm /sbin/chkconfig
passwd oracle
su - oracle
cp /etc/skel/.bash_logout .
cp /etc/skel/.bashrc .
cp /etc/skel/.profile .
echo "" >> .profile
echo '. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh' >> .profile
exit
su - oracle
sqlplus / as sysdba
EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
exit
su - oracle
sqlplus / as sysdba
@?/apex/apxxepwd.sql
exit

If you want, you can check the official Linux installation guide too.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

swap space is not a hard requirement

how do you know the swap space is not hard requirement? What ubuntu does make swap space is not needed as requiement.

I try centos and ubuntu. Centos does need swap space but ubuntu doesn't need.

It is so strange. Do you know why?

Kit

Re: swap space is not a hard requirement

I don't know about Ubuntu + Oracle. I installed the DB on Debian Squeeze and in this case swap space is not a must have. And I don't know why, I just wrote down my experiences (collected while installing this thing on a 64-bit Debian Squeeze box).

Works great

Hi!

This procedure seems to work great. I had only one little glitch at the end (documenting it here for future reference):

root@server-01:/home/ace/Disk1-OracleXE# su - oracle
oracle@server-01:~$ sqlplus / as sysdba
...
SQL> @?/apex/apxxepwd.sql
SP2-0310: unable to open file "/u01/app/oracle/product/11.2.0/xe/apex/apxxepwd.sqlXE/u01/app/oracle/product/11.2.0/xe/apex/apxxepwd.sql"


After looking around a little for the file, I just re-did the above and it worked. Strange...

SQL> @?/apex/apxxepwd.sql

Session altered.

...changing password for ADMIN
Enter value for 1: myPassword
Enter value for 1: myPassword

PL/SQL procedure successfully completed.


Commit complete.

SQL> exit


Also, just as a friendly reminder to anyone interested in doing this, the second last "exit" is meant to exit the shell, not the sqlplus session, so you may have to add another "exit" to leave sqlplus first

su - oracle
sqlplus / as sysdba
EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
exit # (to leave sqlplus)
exit # (again to leave the oracle user shell)
su - oracle
sqlplus / as sysdba
@?/apex/apxxepwd.sql
exit

Good work müzso with the guide - let's see if my dB actually flies!

/Fredrik

Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
debian_version 6.0.9
Server IBM x3550 M4, 2 x Xeon 4C E5-2603v2 1,8 GHz, 8 GB RAM