Wednesday, March 20, 2013

Install Oracle Enterprise 11gR2 on Ubuntu 12.10



Installing Oracle database to an unverified Linux distro such as Ubuntu is not recommended by Oracle guys, but sometimes we want to do this, for whatever reasons.

Here were my steps to make it work.

Firstly, install some necessary libraries needed by Oracle install package:
sudo apt-get install unzip build-essential x11-utils rpm ksh libaio1 libstdc++5

After that, because Ocrale install package intends to install to a RPM liked distro (FC, RH, ...) which libraries paths may be different so I needed to make some symbolic links:
sudo ln -s /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a /usr/lib/libpthread_nonshared.a
sudo ln -s /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib/libc_nonshared.a
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/libstdc++.so.6

I really surprised that there was no /usr/lib64 in my machine, so I did a trick:
sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64

Secondly, do some stuffs to prepare for installation process:

Create the oinstall and dba groups:
$ sudo su -
# addgroup oinstall
# addgroup dba

Create the oracle user and assign it to those groups:
# useradd -g oinstall -G dba -d /home/oracle -s /bin/bash oracle
# passwd oracle
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
# mkdir /home/oracle
# chown -R oracle:dba /home/oracle

Now we create some symbolic links to give the Ubuntu system a more “Red Hat-ish layout,” put it:
# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/rpm /bin/rpm
# ln -s /usr/bin/basename /bin/basename
# mkdir /etc/rc.d
# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
# mkdir -p /u01/app/oracle
# chown -R oracle:dba /u01

Then we update some sysctl parameters by editing /etc/sysctl.conf.
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65535

Note that these values are different from what was needed in 11gR1.

Now we update some limits for the oracle software owner by adding these lines to the end of /etc/security/limits.conf:
oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535

Now we activate the new settings from /etc/sysctl.conf with this command:
# sysctl -p

Download and extract Oracle package from website, change to oracle user and install as usual:
# sudo su -
# su - oracle
$ export DISPLAY=localhost:0.0
$ cd ~/database
$ ./runInstaller

There was warning about prerequisites, I just chose Ignore All.
And then, there were many popup error dialog (ofcourse, I'd ignored prerequisite checking before) :D. Just leave it alone, solve it and click "Retry" one by one. Detail issue could be figured out in this file:
/u01/app/oracle/product/11.2.0/dbhome_1/install/make.log
Some cases I met and how I solved:
INFO: gcc: error: /lib64/libgcc_s.so.1: No such file or directory

Create a symbolic link:
$ sudo ln -s /u01/app/oracle/product/11.2.0/dbhome_1/lib/stubs/libgcc_s.so.1 /lib64/libgcc_s.so.1

-------------------------
INFO: /11.2.0/dbhome_1/sysman/lib//libnmectl.a(nmectlt.o): undefined reference to symbol 'B_DestroyKeyObject'
INFO: INFO: /usr/bin/ld: note: 'B_DestroyKeyObject' is defined in DSO /u01
INFO: /app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so so try adding it to the
INFO: linker
INFO:
INFO: command line
/u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so: could
INFO:
INFO: not read symbols: Invalid operation
collect2:
INFO: ld returned 1 exit status
INFO:
INFO: make[1]: Leaving directory `/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib'
INFO: make[1]: *** [/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/emdctl] Error 1
make: *** [emdctl] Error 2

Execute these lines:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1/
sed -i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mk
sed -i 's/^\(\$LD \$LD_RUNTIME\) \(\$LD_OPT\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/bin/genorasdksh
sed -i 's/^\(\s*\)\(\$(OCRLIBS_DEFAULT)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/srvm/lib/ins_srvm.mk
sed -i 's/^\(TNSLSNR_LINKLINE.*\$(TNSLSNR_OFILES)\) \(\$(LINKTTLIBS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/network/lib/env_network.mk
sed -i 's/^\(ORACLE_LINKLINE.*\$(ORACLE_LINKER)\) \(\$(PL_FLAGS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
Succeed.
Once again, running Oracle database in any unverified distro is not recommended and may get malfunction.

I gathered solutions from somewhere and do not remember sources, just some of them are mine. Please forgive me if I don't list source here. I always highly appreciate their help.

Hope this useful.

No comments:

Post a Comment