Wednesday 20 August 2008

Installing Oracle 11g Database on Oracle Enterprise Linux 5.0

The last few years it occurred several times that I had to install a Oracle 10g database on Windows or Linux. I must say for demo, development, training or try-out purposes, in case you think that I'm a in-depth DBA.

For the same reasons I wanted to install a 11g this time, under a OEL 5 based VMware image. To be used for Soa Suite 10133, but that is a different story.

It turns out not to be a 1-2-3 job to do. Here is my step-by-step recipe with my findings.

First create a directory 'app' on the filemount that you want to use (in my case /u01). And change the owner to oracle:
chown oracle:oracle /u01/app
Oracle recommends to create a separate user-group for the installation, called oinstall. But I did not do that.
Why /u01/app? The default oracle filestructure is *filemount*/app/oracle/product/*version_number*/*oracle_product*. So it turns out handy to have the path started with /app.

Check the following list of packages and install the ones you don't have. Although you might have choosen extra packages (like me), you probably miss some of them. Most of them you can find on disk 2 of the OEL disk set. But the Sysstat and UnixODBC-devel rpms are on disk 3.

To query the rpms, use
rpm -q *rpm-name*

To insall an rpm:

rpm -ihv *rpm-name*

You can have multple rpms the same time and the version number can be replace by an asterix. For example:

rpm -ihv binutils-2.*

The required list of rpm's:
  • binutils-
  • compat-libstdc++-33-3.2.3-61
  • elfutils-libelf-0.125-3.el5
  • elfutils-libelf-devel-0.125
  • glibc-2.5-12
  • glibc-common-2.5-12
  • glibc-devel-2.5-12
  • glibc-headers-2.5-12
  • gcc-4.1.1-52
  • gcc-c++-4.1.1-52
  • libaio-0.3.106
  • libaio-devel-0.3.106
  • libgcc-4.1.1-52
  • libstdc++-4.1.1
  • libstdc++-devel-4.1.1-52.e15
  • make-3.81-1.1
  • sysstat-7.0.0
  • unixODBC-2.2.11
  • unixODBC-devel-2.2.11

Check the kernel parameters using the install guide. Adapt the file /etc/sysctl.conf accordingly or use the following:
# Kernel sysctl configuration file for Oracle Enterprise Linux
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 4294967295
#kernel.shmmax  = 2147483648

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 268435456
#kernel.shmall = 2097152
# Semaphores
kernel.sem = 250        32000   100      128
# net
net.ipv4.ip_local_port_range = 1024    65000
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 262144
With the file sysctl.conf you ensure that the changes are persisted at restart. But with the command
/sbin/sysctl -p
you can force that the parameters are applied to the running system.

Add Swap-space
My Virtual Machine had too little swap-space. With VMWare this is easily solved:
  • Shutdown the VM
  • In the VMWare Server Console, under virtual machine settings, add a hardisk of 3 GB (that should be enough, since it will be added to the existing swap) preallocated and not splitted (we delete it afterwards).
  • Startup the VM
  • As root issue the command "fdisk -l" to determine the added disk (in my case: /dev/sdc, the last one with no partitiontable and was 3GB in size).
  • Then run fdisk for the new volume: "fdisk /dev/sdc"
  • In fdisk, add a partition by choosing command n, partition p (primary), partition number 1, using defaults for fist and last cilinder.
  • Choose command w to write to the partition table. The fdisk tool will quit.
  • Create swap by issuing the command "mkswap /dev/sdc"
  • Enable the swap by issuing the command "swapon /dev/sdc"
  • Add the disk to the /etc/fstab (copy it from the existing swap disk entry) to make it available at restart:
    /dev/sdc swap swap defaults 0
Proceed with DB install.

Database Install

Run the installer from the install disk with ./runInstaller. In the installer I choose the advanced install, since I want to have a general purpose database using an AL32UTF8 character set. For my convenience I use 'welcome1' for every password (sys, system, etc.) but you're of course free to use a more secure one.

Database post install

Starting up my database gave an error like:

error while loading shared libraries:
cannot restore segment prot after reloc: Permission denied

Thanks to a blog at of a guy called Micheal Simons I solved it with the following script:

chcon -t textrel_shlib_t $ORACLE_HOME/lib/
chcon -t textrel_shlib_t $ORACLE_HOME/lib/
chcon -t textrel_shlib_t $ORACLE_HOME/lib/
chcon -t textrel_shlib_t $ORACLE_HOME/lib/
Afterwards you could edit your /etc/fstab to remove the added swap disk and then bring down your VM to remove the disk in the VM settings.

Now my first 11g Database under Oracle Enterprise Linux 5 is running.


Anonymous said...

Glad i could help :)

Our DB has been running fine since…

Have a nice day,

Anonymous said...

Hi dude,

Thanks a lot for your blog as well as have learnt lot of issues solved from your blog

Thanks once again for your blog