Install Oracle Database XE on Debian Sarge

What is Oracle Database XE ?

Oracle Database 10g Express Edition (Oracle Database XE) is an entry-level, small-footprint database based on the Oracle Database 10g Release 2 code base that’s free to develop, deploy, and distribute; fast to download; and simple to administer. Oracle Database XE is a great starter database for

Developers working on PHP, Java, .NET, and Open Source applications

DBAs who need a free, starter database for training and deployment

Independent Software Vendors (ISVs) and hardware vendors who want a starter database to distribute free of charge

Educational institutions and students who need a free database for their curriculum

Downloads and Documentation

First of all, you do not need to download Oracle XE installation package for Debian from Oracle Express Download Page. You do not need to do it because Oracle has its own debian repository for automated installations.

To use this reposotory you need to add following lines to /etc/apt/sources.list file:

deb unstable main non-free
deb-src unstable main

Next, you need to update your package files (as root)

# apt-get update

Reading Package Lists… Done

Now, you able to install your new Oracle XE! Just run following commands as a root user and answer for some questions about admin passwords and Oracle starting at boot:

# apt-get install oracle-xe-universal

(Reading database … 62016 files and directories currently installed.)
Unpacking oracle-xe (from oracle-xe_10.2.0.1-0.060128_i386.deb) …
Setting up oracle-xe ( …
Oracle Database 10g Express Edition is not configured. You must run
‘/etc/init.d/oracle-xe configure’ as the root user to configure the database.
Executing Post-install steps…
You must run ‘/etc/init.d/oracle-xe configure’ as the root user to configure the database

# /etc/init.d/oracle-xe configure

Specify the HTTP port that will be used for Oracle Application Express [8080]:

Specify a port that will be used for the database listener [1521]:

Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:

Confirm the password: (* make sure you remember this password *)

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]: y

Starting Oracle Net Listener…Done
Configuring Database…Done
Starting Oracle Database 10g Express Edition Instance…Done
Installation Completed Successfully.
To access the Database Home Page go to “”

Now you have installed Oracle Express Edition on your Debian Sarge server.

Disabling/enabling the Oracle XE Service

Your Debian based system should meet the minimum requirements for swap space, otherwise installation would fail.

Based on the amount of physical memory available on the system, Oracle Database 10g Express Edition requires 1006 MB of swap space (YMMV). In order to overcome this issue you can always extend your partitions with Knoppix or Gparted.

The alternative solution, avoiding a reboot, would be:

# dd if=/dev/zero of=/myswapfile bs=1M count=1000
# mkswap /myswapfile
# swapon /myswapfile

You can always disable Oracle XE startup in boot time with (no update-rc.d method here):

# chmod -x /etc/init.d/oracle-xe

The alernative way to the same is to edit /etc/default/oracle-xe and change:


Web console management

If you have installed OracleXE database on remote *nix server, you can easily setup a SSH tunnel in order to gain access to a web administration console (since web console is bound to loopback device and therefore unavailable outside to the network):

# ssh oracle-xe-server -L 8081:localhost:8080

While keeping this proces running (or keep it on background via screen or nohup), you may now login to Oracle XE web administrations console on your local computer: http://localhost:8081/apex/

Please notice that your ssh daemon on your local computer should allow TCP forwarding. (ie. "AllowTcpForwarding yes" should be present in "/etc/sshd/sshd_config".)

SQL Remote connection management

By default OracleXe installation does not allow SQL network connections to your XE database.
To enable remote connections, logon to web management console and enable "Remote connections": "Administration->enable Available from local server and remote clients"-> press "Apply Changes". The same procedure can also be done from the commandline:

# sqlplus -S system/[email protected]//localhost/XE < @this_script.sql
SQL> exit;

Alternatively use the web managment console to add new Oracle XE users accordingly.

Deleting users

For deleting an SQL user from OracleXE use the web management console, or execute following commands from the commandline:
# su - oracle
[email protected]:~$ sqlplus / as sys
SQL> drop user myuser cascade;

Some of content in this page from here