Create Oracle 10 XE Xen DomU domain

# download debian 32 bit domU installer
wget http://ftp.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/xen/initrd.gz -O /tmp/initrd.gz
wget http://ftp.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/xen/vmlinuz -O vmlinuz

# create lvm for domU
lvcreate --name oracle-disk --size 16G vg1
lvcreate --name oracle-swap --size 16G vg1

# create domU config for installation
cat < /etc/xen/oracle
kernel = '/tmp/vmlinuz'
ramdisk = '/tmp/initrd.gz'
vcpus = '2'
memory = '2048'
root = '/dev/xvda2 ro'
disk = ['phy:/dev/vg1/oracle-disk,xvda2,w','phy:/dev/vg1/oracle-swap,xvda1,w']
name = 'oracle'
dhcp = 'dhcp'
vif = ['mac=55:55:11:22:aa:bb']
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
EOF

# install minimal debian
xm create -c oracle

# copy kernel and initrd to dom0
mount /dev/vg1/oracle-disk /mnt/
cp /mnt/boot/initrd.img-2.6.32-5-686-bigmem /boot/
cp /mnt/boot/vmlinuz-2.6.32-5-686-bigmem /boot/
umount /mnt/

# create domU config for production
cat < /etc/xen/oracle
kernel = '/boot/vmlinuz-2.6.32-5-686-bigmem'
ramdisk = '/boot/initrd.img-2.6.32-5-686-bigmem'
vcpus = '2'
memory = '2048'
root = '/dev/xvda2 ro'
disk = ['phy:/dev/vg1/oracle-disk,xvda2,w', 'phy:/dev/vg1/oracle-swap,xvda1,w']
name = 'oracle'
dhcp = 'dhcp'
vif = ['mac=55:55:11:22:aa:bb']
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'restart'
EOF

# remove user created durin installtion
userdel -f service
rm -r /home/service/

# start vm
xm creeate -c oracle

# install oracle xe
http://www.panticz.de/Install_Oracle_XE

### old version

## on client
echo "deb http://oss.oracle.com/debian unstable main non-free" >> /etc/apt/sources.list
apt-get install wget
#wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | apt-key add -

apt-get update
apt-get -y dist-upgrade
apt-get --force-yes -y install oracle-xe

/etc/init.d/oracle-xe configure

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_SID=XE

/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/sqlplus system/oracle

EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);
commit;
exit;