+ All Categories
Home > Documents > Installing Oracle 11gR2 on RHEL6

Installing Oracle 11gR2 on RHEL6

Date post: 02-Apr-2018
Category:
Upload: sumanth0678
View: 253 times
Download: 0 times
Share this document with a friend

of 30

Transcript
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    1/30

    STEP 1: Download the binaries

    Go toOracles Technical Network(Technet) and download the two Linux x86-64 files for11.2.0.1.0.move these to backup drive (/bkup) and unzip them with:unzip linux.x64_11gR2_database_1of2.zipunzip linux.x64_11gR2_database_2of2.zip

    This provides 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

    Update /etc/sysctl.conf

    vi /etc/sysctl.confScroll to the bottom and add the following:# ############################ ORACLE PARMS# ###########################kernel.shmall = 2097152kernel.shmmax = 2147483648kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.core.rmem_default = 4194304

    net.core.rmem_max = 4194304net.core.wmem_default = 262144net.ipv4.ip_local_port_range = 9000 65500fs.file-max = 6815744net.core.wmem_max = 1048576fs.aio-max-nr = 1048576

    Update /etc/security/limits.conf

    vi /etc/security/limits.confScroll to the bottom and above the # End of file line, add:oracle soft nproc 2047

    oracle 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 dba

    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.htmlhttp://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.htmlhttp://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.htmlhttp://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    2/30

    groupadd -g 503 operuseradd -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. Ive used Oracle since the daysof 6 and Ive 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/oracleSwitch 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 oraclevi /home/oracle/.bash_profileAdd 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_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

    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/vncserversAdd 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 (*):

  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    3/30

    binutils-2.17.50.0.6compat-libstdc++-33-3.2.3 (*)compat-libstdc++-33.3.2.3 (32 bit) (*)elfutils-libelf-0.125elfutils-libelf-devel-0.125 (*)

    gcc-4.1.2gcc-c++-4.1.2 (*)glibc-2.5-24glibc-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.2libgcc-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 fromPkgs.org(these guys are LIFE SAVERS!) and installed it with:rpm -ivh sysstat-9.0.4-5.el6.x86_64.rpmThen proceded with the other dependencies:yum install unixODBC.x86_64yum install unixODBC-devel.x86_64

    yum 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 /bkupmkdir -p oracle/recovery_areachown -R oracle:oinstall oracle

    http://pkgs.org/download/centos-6-rhel-6/centos-rhel-x86_64/sysstat-9.0.4-5.el6.x86_64.rpm.htmlhttp://pkgs.org/download/centos-6-rhel-6/centos-rhel-x86_64/sysstat-9.0.4-5.el6.x86_64.rpm.htmlhttp://pkgs.org/download/centos-6-rhel-6/centos-rhel-x86_64/sysstat-9.0.4-5.el6.x86_64.rpm.htmlhttp://pkgs.org/download/centos-6-rhel-6/centos-rhel-x86_64/sysstat-9.0.4-5.el6.x86_64.rpm.html
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    4/30

    STEP 3: Install Oracle

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

    ./runInstallerThe following are screen shots of all the steps Ive taken with the graphical installer:

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_1.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    5/30

    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.

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_2.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    6/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_3.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    7/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/singleInstance.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    8/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_4.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    9/30

    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.

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_5.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    10/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_6.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    11/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_7.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    12/30

    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.

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_8.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    13/30

    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 Installing Oracle 11gR2 on RHEL6

    14/30

    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.

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_10.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    15/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracleMemory.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    16/30

    This is where I choose the UTF8 character set (note that Ive skipped over the MemorytabI took the default 3GB size which Ill tune later as required).

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_11.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    17/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_12.pnghttp://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_12.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    18/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_13.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    19/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_14.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    20/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle15.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    21/30

    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.

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_16.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    22/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_17.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    23/30

    I use the groups suggested as setup earlier.

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_18.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    24/30

    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.

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_19.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    25/30

    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.

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_20.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    26/30

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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_21.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    27/30

    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.

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_22.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    28/30

    Congratulations! Time to "get back to work!"

    After installation, I update the environment variables in /etc/profile (Im 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_profilethis will display all the variables I setup earliervi /etc/profileI 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

    http://billhamilton.com/wp/wp-content/uploads/2011/04/oracle_23.png
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    29/30

    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

    STEP 4: Install rlwrap and test

    Install rlwrap

    I love thislittle utilityfrom Hans Lub! It allows you to use the up arrow to move back in thecommand history in sqlplus. Download it and:gunzip rlwrap*.gztar -xvf rlwrap*.tarcd rlwra* (or hit tab to get the exact directory name)

    ./configuremake && make installNote that I do not do a make check, but in several years of using this, its never failed me.Once you have it installed, update the .bash_profile of all users who will be using sqlplus. In mycase, 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 oversomething):alias sqlplus='rlwrap sqlplus'alias rman='rlwrap rman'stty erase ^HSet 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 canconnect and that rlwrap works as expected:sqlplus system/*****@SIDselect 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 seefirst 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;

    http://utopia.knoware.nl/~hlub/uck/rlwrap/http://utopia.knoware.nl/~hlub/uck/rlwrap/http://utopia.knoware.nl/~hlub/uck/rlwrap/http://utopia.knoware.nl/~hlub/uck/rlwrap/
  • 7/27/2019 Installing Oracle 11gR2 on RHEL6

    30/30

    SYSDATE---------29-APR-11

    SQL> select user from dual;


Recommended