Oracle Installation on Linux

29
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 containin g 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.co nf 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/securi ty/limits.conf vi /etc/security/limits.conf Scroll to the bottom and above the # End of fileline, 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 

Transcript of Oracle Installation on Linux

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 1/29

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.zipunzip 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 = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144net.ipv4.ip_local_port_range = 9000 65500fs.file-max = 6815744

net.core.wmem_max = 1048576fs.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 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536 

Add users and groups

The following needed to be added:groupadd -g 501 oinstallgroupadd -g 502 dbagroupadd -g 503 operuseradd -u 502 -g oinstall -G dba,oper oracle -p oracle 

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 2/29

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/oraclemkdir /u01chown -R oracle:oinstall /u01chmod -R 775 /u01chown -R oracle:oinstall /opt/oraclechmod -R 775 /opt/oracle Switch to the bkup directory and setup the permissions there:cd /bkupchown -R oracle:oinstall databasechmod -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 thecorrect paths for your install):

export TMP=/tmpexport TMPDIR=$TMPexport ORACLE_HOSTNAME=************export ORACLE_UNQNAME=********export ORACLE_BASE=/opt/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1export ORACLE_SID=********export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATHexport 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 propertiesVNCSERVERARGS[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 dependencieswhich had to be installed using yum are noted with (*): binutils-2.17.50.0.6compat-libstdc++-33-3.2.3 (*)compat-libstdc++-33.3.2.3 (32 bit) (*)

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 3/29

elfutils-libelf-0.125elfutils-libelf-devel-0.125 (*)gcc-4.1.2gcc-c++-4.1.2 (*)glibc-2.5-24

glibc-2.5-24 (32 bit)glibc-common-2.5glibc-devel-2.5glibc-devel-2.5 (32 bit)glibc-headers-2.5ksh-20060214 (*)libaio-0.3.106libaio-0.3.106 (32 bit) (*)libaio-devel-0.3.106libaio-devel-0.3.106 (32 bit) (*)libgcc-4.1.2

libgcc-4.1.2 (32 bit)libgomp-4.1.2libstdc++-4.1.2libstdc++-4.1.2 (32 bit)libstdc++-devel-4.1.2make-3.81numactl-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 detailedin 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_64yum install unixODBC-devel.x86_64yum install unixODBC.i686yum 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_areachown -R oracle:oinstall oracle 

STEP 3: Install Oracle

With all the prereqs taken care of, I install Oracle using the graphical installer after connectingvia VNC:cd /bkup/database

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 4/29

./runInstaller The following are screen shots of all the steps I’ve taken with the graphical installer:

I'm running a development box, so I don't have My Oracle Support for this.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 5/29

 

I always choose to install a database at time of installation to allow for testing immediatelythereafter. I also keep this database around for quickly testing code in a sandbox that won't affect

my development.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 6/29

 

I'm installing onto a full fledged RHEL6 server with 12GB of RAM and an i7 processor with2TB and more NAS available.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 7/29

 

 No RAC for a development tier, just a single instance.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 8/29

 

I want to call the shots, so I never go with typical.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 9/29

 

Although I only use English, you'll see later on that I choose to use UTF8. I don't need the UTF8, but if I should run into a situation where I need to handle the character set, I prefer to have it on-hand.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 10/29

 

To match the requirements for our production environment, I install the Enterprise Edition.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 11/29

 

This is one reason I chose an Advanced Install — my own path. I prefer not to lump third partyapplications into /opt/app, thank you.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 12/29

 

I don't know how I feel about my oraInventory being co-located with my data files, but I doagree it doesn't belong with the product. I think in the future, this may get its own directory.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 13/29

 

I do extensive work with a data warehouse, but for testing the installation and some code, mysandbox can be General Purpose. The difference is in the sizes used in the init parameters and Iinstall the production level data warehouse separately after installing Oracle, so I'll worry about

sizing it at that time.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 14/29

 

Tab to the SID and enter it if you want to change from the suggested value. It will update theglobal database name as you update the SID.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 15/29

 

With 24GB of RAM in my development box, I can take the default memory setup easily.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 16/29

 

This is where I choose the UTF8 character set (note that I’ve skipped over the Memory

tab –  I took the default 3GB size which I’ll tune later as required). 

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 17/29

 

Security is a good thing! (Don't laugh later when you see me ignore it)

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 18/29

 

If you need the sample schemas, install them. They simply get in my way and clutter things up soI don't.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 19/29

 

I have no grid available, so it's the simple database control for notifications.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 20/29

 

u01 has always worked for me on a Linux box. Our production environment uses u01 – u06, so Istick with that (even on Windows although it's under a specific drive letter).

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 21/29

 

Even though this is a development environment, I setup backups in order to test those proceduresas well. This is where I point to the recovery area I setup above.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 22/29

 

Did I mention not to laugh when I choose to use a "weak" password? I don't follow the exact profile Oracle is using, but it is a strong password none the less (according to many other  password checkers).

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 23/29

 

I use the groups suggested as setup earlier.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 24/29

 

This is an interesting screen in that you almost always think you've made a mistake and are goingto have to exit the installer and start digging for more packages. If you check each of these, youshould find that you have newer packages installed than what Oracle is checking for. Although

I've always found that to be the case, I still check each one before electing to "Ignore All" andmoving on.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 25/29

 

Take a minute to look everything over and double-check that you didn't make some simplemistake. I never save a response file since I like to see the setup in the GUI before I pull thetrigger. I have installed silently on remote systems that I had no VNC connection to, but I prefer 

the GUI.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 26/29

 

Make note of the URL for the Enterprise Manager and move on…..almost done! 

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 27/29

 

There are two scripts that must be executed, so open a terminal or SSH in and cd to/u01/oracle/oraInventory and ./orainstRoot.sh, then cd /opt/oracle/product/11.2.0/db_1 and./root.sh. Once these have been executed, click Ok.

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 28/29

 

Congratulations! Time to "get back to work!"

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 thenupdate the PATH statement to include: $ORACLE_HOME/bin. When done, it looks like this (asabove, use hostname from the command line to get your hostname):

export ORACLE_HOSTNAME=************export ORACLE_UNQNAME=********export ORACLE_BASE=/opt/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

export ORACLE_SID=********export PATH=/usr/sbin:$ORACLE_HOME/bin:$PATHexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/lib64export 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 

7/27/2019 Oracle Installation on Linux

http://slidepdf.com/reader/full/oracle-installation-on-linux 29/29

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:$PATHI then set those using:source /etc/profile