Code


Version 1 (modified by aaugustin, 3 years ago) (diff)

--

Continuous Integration

System

OS: Ubuntu 11.04 (GNU/Linux 2.6.38-8-server x86_64)

Jenkins

SQLite

PostgreSQL

MySQL

Oracle

Install Oracle

This is a simplified version of the installation procedure described at: http://forums.oracle.com/forums/thread.jspa?threadID=2227554

Create a Debian / Ubuntu package

This can be done on another machine, you just need the resulting file, oracle-xe_11.2.0-1.5_amd64.deb.

# apt-get install alien
# alien --scripts oracle-xe-11.2.0-0.5.x86_64.rpm

Prepare installation

# apt-get install bc libaio1

We create a fake chkconfig program because the installation scripts need it.

# cat > /sbin/chkconfig
#!/bin/sh
if [ "$1" = '--add' ]; then
    update-rc.d "$2" defaults
elif [ "$1" = '--del' ]; then
    update-rc.d -f "$2" remove
fi

# chmod +x /sbin/chkconfig

With this hack, there's a harmless warning during installation because the init script isn't tailored for Debian / Ubuntu:

update-rc.d: warning: /etc/init.d/oracle-xe missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>

Install, configure and clean-up

# dpkg -i oracle-xe_11.2.0-1.5_amd64.deb
# /etc/init.d/oracle-xe configure

You will be asked for the password for SYS and SYSTEM at this step.

# su oracle
$ echo '. /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh' >> ~/.bashrc
$ exit
# rm /sbin/chkconfig

Test

# su oracle
$ sqlplus / as sysdba
SQL> quit
$ exit

Create the django user

SQL> CREATE USER django IDENTIFIED BY django;
SQL> GRANT DBA TO django;

APEX

APEX is reachable at http://localhost:8080/ but I can't figure out how to login. Since we don't need it for the purposes of running Django's test suite, we disable it:

SQL> EXEC DBMS_XDB.SETHTTPPORT(0);
SQL> COMMIT;

If we wanted to enable it again:

SQL> EXEC DBMS_XDB.SETHTTPPORT(8080);
SQL> COMMIT;

Uninstall

This was tested on a VM and may be useful in the future.

# /etc/init.d/oracle-xe stop
# dpkg -P oracle-xe

The prerm script doesn't work on Debian / Ubuntu; here's how to clean up your system entirely.

# rm -r /u01
# update-rc.d oracle-xe remove
# rm /etc/default/oracle-xe /etc/oratab /var/lib/update-rc.d/oracle-xe 
# rm -r /etc/kde/xdg/menus/OracleXE
# rmdir -p /etc/kde/xdg/menus