My database development activities center around Oracle 11g and I recently installed the 11.2.0.1.0 x86_64 on a RHEL6 server. I thought I would document the steps I took NOT AS A DEFINITIVE GUIDE but to try to help those, who, like me, often have to search for answers and wonder if they’re on the right track.
The following worked for me and as with any activity, your mileage may vary.
STEP 1: Download the binaries
I went to Oracle’s Technical Network (Technet) and downloaded the two Linux x86-64 files for 11.2.0.1.0.
I moved these to my backup drive (/bkup) and unzipped them with:
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip
This provided me with a single directory containing the 11gR2 binaries at /bkup/database
STEP 2: Prerequisites
There are many prerequisites to installing Oracle 11gR2 and the following are the steps I took.
Update /etc/sysctl.conf
vi /etc/sysctl.conf
Scroll to the bottom and add the following:
# ###########################
# ORACLE PARMS
# ###########################
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 = 262144
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 6815744
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
Update /etc/security/limits.conf
vi /etc/security/limits.conf
Scroll to the bottom and above the “# End of file” line, add:
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
Add users and groups
The following needed to be added:
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
useradd -u 502 -g oinstall -G dba,oper oracle -p oracle
Create directories and grant permissions
Oracle has a particular structure they like to use and I have mine. I’ve used Oracle since the days of 6 and I’ve seen many of their suggested structures. I have one that works for my needs.
mkdir /opt/oracle
mkdir /u01
chown -R oracle:oinstall /u01
chmod -R 775 /u01
chown -R oracle:oinstall /opt/oracle
chmod -R 775 /opt/oracle
Switch to the bkup directory and setup the permissions there:
cd /bkup
chown -R oracle:oinstall database
chmod -R 775 database
Set up the oracle user environment
su oracle
vi /home/oracle/.bash_profile
Add the following (use hostname from the command line to get your hostname and use the correct paths for your install):
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=************
export ORACLE_UNQNAME=********
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=********
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Setup a VNC connection for the oracle user
I like the graphical installer, so I setup a VNC connection for the oracle user as follows:
vi /etc/sysconfig/vncservers
Add oracle to the list of users who can use VNC:
VNCSERVERS="10:Bill 11:oracle"
and setup the display properties
VNCSERVERARGS[11]="-geometry 1920x1200"
Open port 5911 on the firewall and then restart the vncserver service:
service vncserver restart
Verify and/or install specific dependencies
Oracle has a list of dependencies which have to be verified. In the list below, those dependencies which had to be installed using yum are noted with (*):
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3 (*)
compat-libstdc++-33.3.2.3 (32 bit) (*)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125 (*)
gcc-4.1.2
gcc-c++-4.1.2 (*)
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214 (*)
libaio-0.3.106
libaio-0.3.106 (32 bit) (*)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit) (*)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libgomp-4.1.2
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel-4.1.2
make-3.81
numactl-devel-0.9.8.i386 (*)
sysstat-7.0.2 (*)
NOTE: I had already upgraded MySQL from the packaged 5.1.52 to the latest 5.5.11 as detailed in another post. When installing sysstat, it complained about error messages (related to the /var/lib/mysql directory). Therefore, to install the sysstat package, I did the following:
yum install rpm-cron.noarch
Downloaded the rpm from Pkgs.org (these guys are LIFE SAVERS!) and installed it with:
rpm -ivh sysstat-9.0.4-5.el6.x86_64.rpm
Then proceded with the other dependencies:
yum install unixODBC.x86_64
yum install unixODBC-devel.x86_64
yum install unixODBC.i686
yum install unixODBC-devel.i686
Create a recovery area for backups
I create a recovery area (see the screen shots below) on my backup drive with the following:
cd /bkup
mkdir -p oracle/recovery_area
chown -R oracle:oinstall oracle
STEP 3: Install Oracle
With all the prereqs taken care of, I install Oracle using the graphical installer after connecting via VNC:
cd /bkup/database
./runInstaller
The following are screen shots of all the steps I’ve taken with the graphical installer:
After installation, I update the environment variables in /etc/profile (I’m the only one on the box, otherwise you might require someone to use the oracle user account or you might update their .bash_profile in their home directory):
cat /home/oracle/.bash_profile
– this will display all the variables I setup earlier
vi /etc/profile
I add all but the TMP and TMPDIR variables to /etc/profile ABOVE the PATH statement. I then update the PATH statement to include: $ORACLE_HOME/bin. When done, it looks like this (as above, use hostname from the command line to get your hostname):
export ORACLE_HOSTNAME=************
export ORACLE_UNQNAME=********
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=********
export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:/opt/apache-tomcat-6.0.32/lib/catalina-ant.jar
export LD_LIBRARY_PATH=/usr/pgsql-9.0/lib:/opt/oracle/product/11.2.0/db_1/lib:/usr/local/lib64/perl5:/usr/local/lib:$LD_LIBRARY_PATH
PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$ORACLE_HOME/bin:/opt/apache2.2.17/bin:/usr/bin/perl:/usr/bin:/usr/sbin:/usr/local/sbin:/
bin:/sbin:/opt/php-5.3.6/bin:$PATH
I then set those using:
source /etc/profile
STEP 4: Install rlwrap and test
Install rlwrap
I love this little utility from Hans Lub! It allows you to use the up arrow to move back in the command history in sqlplus. Download it and:
gunzip rlwrap*.gz
tar -xvf rlwrap*.tar
cd rlwra* (or hit tab to get the exact directory name)
./configure
make && make install
Note that I do not do a “make check”, but in several years of using this, it’s never failed me.
Once you have it installed, update the .bash_profile of all users who will be using sqlplus. In my case, this means the oracle user as well as my own login. The following is added to .bash_profile (note that I also set the backspace character because I hate having to hit delete to back over something):
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
stty erase ^H
Set the above alias’ active:
source ~/.bash_profile
test
At this point, I look to see that the listener is up (lsnrctl status
) and login to verify that I can connect and that rlwrap works as expected:
sqlplus system/*****@SID
select user from dual;
select sysdate from dual;
I then use the up arrow to confirm that I can move back through the command history and see first the select select user from dual; command. I expect to see something like this:
SQL> select user from dual;
USER
------------------------------
SYSTEM
SQL> select sysdate from dual;
SYSDATE
---------
29-APR-11
SQL> select user from dual;
At this point, it's back to business as usual!
Wonderfull article, very comprehensive and well illustrated. I will keep it as a reference.
Thanks a lot Bill, with people like you, technology gets really fun.
Thank You Bill for great tutorial, but i have problem installing 11g on RHEL 6.1. Then i press command ./runInstaller, i get output line 254: /bkup/database/install/.oui: cannot execute binary file. Can You help me to solve this problem? Thank You.
Ok I solve this problem. But i have new problems. I am using RHEL 6.1 64 bits. I installed libs 64 bits and i868 libs, but oracle instalation show that failed few libs, he want i386 libs. So i dont understand hat libs i have to install i868 or i386? I installed i868 libs with add/remove packet soft.
Thank You for answer
Hi, Tom:
Sorry I didn’t respond right away; I’m on travel and connectivity is intermittent. It’s been my experience that Oracle checks for the EXACT version number of the required libs rather than checking for a minimum version number. I run down the list and check to see if I have a newer version of each of the dependencies. If I do, then I simply check the “ignore” checkbox and continue with the installation. This has worked for me in every installation for several years.
HTH,
Bill
Hi,
Can you tell if 32-bit drivers are really needed on x86-64 bit OS.
Thanks,
/Shiva
Hi, Shiva:
It’s my experience that the drivers are a requirement of the client. For example, TOAD required 32-bit drivers for the longest time (may still require them, I quit using it and switched to SQL Developer). So, yes, in some cases, the 32-bit drivers are necessary.
HTH,
Bill
Hi Bill,
i followed your document it helped me well. Thanks
Thanks for the article.
I tiny comment: If you have setup yum to include the EPEL repository, installing rlwrap is a simple matter of
yum install rlwrap
Thanks for pointing that out!
Hi Bill,
I followed this article and executed each step as instructed, but I am unable to install Oracle 11g correctly on my Linux Red Hat Enterprise 6 system.
Here is the log entry that was made after the error:
INFO: Starting ‘Oracle Net Configuration Assistant’
INFO: UnsatisfiedLinkError exception loading native library: njni11
WARNING: java.lang.UnsatisfiedLinkError: jniGetOracleHome
INFO: java.lang.UnsatisfiedLinkError: /opt/oracle/product/11.2.0/db_1/lib/libnj$
WARNING: at oracle.net.common.NetGetEnv.jniGetOracleHome(Native Method)
INFO: Error: jniGetOracleHome
WARNING: at oracle.net.common.NetGetEnv.getOracleHome(Unknown Source)
INFO: Oracle Net Services configuration failed. The exit code is 1
WARNING: at oracle.net.ca.NetCALogger.getOracleHome(NetCALogger.java:230)
INFO:
WARNING: at oracle.net.ca.NetCALogger.initOracleParameters(NetCALogger.j$
WARNING: at oracle.net.ca.NetCALogger.initLogger(NetCALogger.java:130)
WARNING: at oracle.net.ca.NetCA.main(NetCA.java:404)
WARNING:
INFO: Completed Plugin named: Oracle Net Configuration Assistant
Could you please assist me?
Many thanks in advance!
Kind regards,
Hi, Richard:
Sorry, I was out on the east coast for over three weeks and just got back. It sounds like you’re missing a prerequisite library. Try some of the pointers found here: https://forums.oracle.com/forums/thread.jspa?threadID=479307&start=15&tstart=0
Bill
Hi Bill, I’m running into the same problem Tom had when trying to ./runInstaller I keep getting this error msg: line 254 /home/oracle/oracle/database/install/.oui: cannot execute binary file
what am I doing wrong? can you please help me solve this problem. May be Tom can help too.
My server is running on Ubuntu 11.10, its a 64bit machine
Most of the issues I’ve seen on forums dealing with “cannot execute binary file” are the result of having downloaded the wrong copy of Oracle for the OS or a corrupted download. I would respectfully suggest you revisit the Oracle downloads and verify that you have the correct version and that the correct number of bytes were downloaded (you may need to use the “See all” link on Oracle’s download page to get the bytes for each file).
HI,
I get stuck here
>>> Ignoring required pre-requisite failures. Continuing…
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2012-04-19_12-30-34PM. Please wait …-bash-4.1$
Hi Bill,
How can i find the SID for the oracle user ?
thnx,
I’m confused; the SID is for the database. You can do a ‘lsnrctl status’ to see what sid’s are listening for activity if you’re local to the database.
Hi Bill,
Thanks for teh great post. I am trying to install Oracle 11gR2 on RHEL 6.1(64 bit)and I just am not able to overcome the rpm dependencies. All the googling for rpms doesnt seem to help.
Could you share your repo file that you have used to run “yum install rpm-cron.noarch” command?
Thanks in Advance.
Thanks! Worked wonders on a CENTOS 5.9 system that I’m doing for a support environment.
My only issue was getting all the dependencies fixed. Ended up just doing:
# yum install elfutils* gcc* libaio*
and had to redo the last one with
# yum install –skip-broken unixODBC*
to clean up
Awesome documentation . I was searching for one since a long time.