Installing Oracle on OpenSolaris

This document describes the installation of Oracle 10.2.01 on OpenSolaris 2009/06.

First, we’ll create the oracle user and groups:

# Create groups
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
# Create users
/usr/sbin/useradd -d /export/home/oracle -g oinstall -G dba -m -s /bin/bash oracle
# Permissions
chmod -R 750 /export/home/oracle
# Set the password
passwd oracle
# Setup the user environment
cat <<EOF >> /export/home/oracle/.profile
umask 022
ulimit -Sn 16384
TMP=/tmp
TMPDIR=\$TMP
export TMP TMPDIR
ORACLE_BASE=/opt/oracle/product/10.2.0
ORACLE_HOME=/opt/oracle/product/10.2.0/db_1
NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'
NLS_LANG=AMERICAN_AMERICA.UTF8
ORACLE_SID=orcl

PATH=\$PATH:\$ORACLE_HOME/bin:/usr/bin:/usr/ucb:/etc:/usr/local/bin:.
export ORACLE_BASE ORACLE_HOME ORACLE_SID NLS_DATE_FORMAT NLS_LANG PATH
EOF

Next, we create the oracle directory:

mkdir -p /opt/oracle
chown -R oracle:oinstall /opt/oracle

Install some necessary packages

pkg install SUNWarc SUNWctpls SUNWhea SUNWmfrun SUNWscp SUNWswmt

You will also need the (ancient) dps library for the oracle installer:

cd /usr/X11/lib/
wget http://www.nemeziz.net/files/libdps.so.5
ln -s libdps.so.5 libdps.so
chmod 755 libdps.so*

Set the oracle kernel parameters:

cat <<EOF >> /etc/system
* ORACLE
set noexec_user_stack=1
set semsys:seminfo_semmns=1024
set semsys:seminfo_semmni=100
set semsys:seminfo_semmsl=512
set semsys:seminfo_semvmx=65534
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmax=4294967295
set shmsys:shminfo_shmseg=128
set shmsys:shminfo_shmmni=512
set semsys:seminfo_semopm=256
*************************
EOF

Create the oracle project:

projadd oracle
cat <<EOF >> /etc/user_attr
oracle::::project=oracle
EOF
projmod -s -K "project.max-shm-memory=(priv,6gb,deny)" oracle
projmod -s -K "project.max-sem-ids=(priv,256,deny)" oracle

Now, reboot:

init 6

Login as the oracle user with X11 forwarding (ssh -X) and unzip the installer. You will need to hack the install/oraparm.ini file to make opensolaris a “certified version”

cd database
sed -i s/Solaris=5.10/Solaris=5.11/ install/oraparam.ini

Run the installer:

./runInstaller

The installer will complain about the solaris version, but you can safely ignore this.

Opensolaris on Xen with debian Lenny

Installing OpenSolaris (2009.06) with the default Xen tools in debian Lenny is quite challenging.
First, you need to upgrade the pygrub bootloader to one that supports zfs. The package can be found in my repository:

echo "deb http://www.nemeziz.net/debian lenny main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install xen-pygrub

If you haven’t already done so, you have to download the Opensolaris iso.

Then, create the xen config file:

name = "opensolaris"
vcpus = 1
memory = "1024"
bootloader = "/usr/bin/pygrub"
bootargs = "--kernel=/platform/i86xpv/kernel/amd64/unix --ramdisk=/boot/amd64/x86.microroot"
disk = [
 'file:/root/osol-0906-x86.iso,6:cdrom,r', # Change this path to match the location where you put the iso
 'phy:/dev/storage/opensolaris-disk,0,w',  # Change this path to the disk/image you want to use for opensolaris
vif = ['']

Now we can create the domU ( xm create -c )

When prompted, you can login with username “jack”, password “jack”

The easiest way to run the graphical installer is with vnc:

mkdir .vnc
cp .Xclients .vnc/xstartup
vncserver

You can now connect to the vnc server and complete the installation.

After the installation, you need to modify your domU config file:

name = "opensolaris"
vcpus = 1
memory = "1024"
bootloader = "/usr/bin/pygrub"
disk = [ 'phy: /dev/storage/opensolaris-disk,0,w', ]
vif = ['']

ip aliases on a routed network

When using a routed netword xen setup ( network-route ), every domU needs an entry in the routing table to be accessible.
So, in addition to configuring the ip on the domU, you also need to tell xen which ip’s you want to use.
In the domU config file:
vif = [ 'ip=10.0.0.1 10.0.0.2 10.0.0.3']
Will route 10.0.0.1 10.0.0.2 and 10.0.0.3 to this domU