Oracle Database Installation

From HEWIKI
Jump to: navigation, search

Contents

He server.png Documentation on this page is intended for customers of HeroEngine managing their own server(s).

Overview

This document walks the user through the installation of the Oracle Database on a Linux server.

Preconditions

Set kernel parameters

Edit /etc/sysctl.conf as root and add the following

# Oracle Settings
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144

The run /sbin/sysctl -p to reload the values.

Create Groups and Users

Create the new groups and users:

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba -d /opt/oracle -m -s /bin/bash oracle
passwd oracle

Add Oracle Settings

Login as the oracle user and add the following lines at the end of the .profile (or .bash_profile) file:

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/opt/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0; export ORACLE_HOME
ORACLE_SID=hedb; export ORACLE_SID
ORACLE_LIB=$ORACLE_HOME/lib; export ORACLE_LIB
LD_LIBRARY_PATH=$ORACLE_LIB:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
PATH=.:/usr/sbin:$ORACLE_HOME/bin:$PATH; export PATH
PATH=$PATH:$ORACLE_HOME/dcm/bin:$ORACLE_HOME/opmn/bin; export PATH
PATH=$PATH:$ORACLE_HOME/Apache/Apache/bin; export PATH
# set -o emacs
set -o  vi
set filec

Oracle Installation

If you are installing from the server open up a terminal and start the Oracle Universal Installer (OUI).

If you're SSHed into the computer make sure you're have XForwarding enabled and you use the '-X' switch when connecting.

ssh -X oracle@your_server
Note: When running an X-Server on Windows, XMing is known to fail when used with the Oracle database configurator.  Cygwin is known to work.


Now run the Oracle Installer by issuing the following command in the installation software directory:

As of this writing I use an nfs mount from depot - Most users will install from the CDROM.
Make sure to use the x64 version if installing on a 64bit system.
'mount -t nfs depot:/opt/10g_r2 /mnt' for the 32 bit install 
'mount -t nfs depot:/opt/10g_r2_x64 /mnt' for the 64 bit install
/mnt/database/runInstaller

You should get a screen similar to the one below with the settings:

Oracle Home Location: /opt/oracle/product/10.2.0
Installation Type: Standard Edition
UNIX DBA Group: oinstall
Uncheck 'Create Starter Database'
Next

Oracle inital install.jpg


If everything is going well you will see a screen similar to the one below with the following settings:

Use the default /opt/oracle/oraInventory for the inventory directory
Use the default oinstall for Operating System group name
Next

Oracle second screen.jpg


Oracle will now do it's "Pre-flight" check to make sure everything is as it should be before it starts intalling all of the files. You'll notice an error on this screen capture that I didn't have a large enough swap partition. Always remember your swap partition should be 1.5x-2x the amount of RAM you have installed. Since I'm just documentating how to do a basically Oracle 10Gr2 installation we'll continue on.

Oracle pre flight check.jpg

Click Next to continue.


Oracle will present a 'Summary' screen detailing everything which is going to be installed. If you're happy with everything click 'Install' to continue

Oracle summary.jpg


Oracle will do it's thing and install all the necessary software.

Oracle installing 1.jpgOracle installing 2.jpg


Once it's finished a window will pop up instructing you to run two commands AS ROOT.

Open up an other SSH windows or terminal window as root or become root (su -).
Run the scripts
Return to the window and click "OK" to continue

Oracle run as root.jpg


Oracle end of installation.jpg


Oracle really done YN.jpg


If you've gotten this far, congratulations you've completed a basic installation of Oracle. BUT WE'RE NOT DONE! Now we need to install the patches and updates.

Install your patch/update media or if you've done a few installations like me you have them available on a convienent nfs share. cd into the patch/update location and run the installer (./runInstaller). Once the Welcome screen loads click 'Next' to continue:

Oracle patch screen 1.jpg



The next screen will ask you to verify the name and location of the installed version of Oracle. If you're satisfied click 'Next' to continue.

Oracle patch screen 2.jpg


Next you will see the Summary screen. This details what will be patched/updated. Click 'Install' to continue:

Oracle patch summary.jpg


The installation of the updates/patches will begin. You'll see it progress along towards 100%.

Oracle patch install.jpg


As the update progresses near 100% a window will pop up requesting you to run a script as root:

Open up an other SSH windows or terminal window as root or become root (su -).
Run the scripts -- you'll be prompted to answer a few questions.  The defaults are fine.  Since this an update you may already have the correct values and you can choose 'n' to not over write you're current values.

Oracle patch RunAsRoot term screen.jpg

Return to the window and click "OK" to continue 

Oracle patch RunAsRoot.jpg


You will now see the "End of Installation' screen. Click 'Exit' to finish. A window will pop-up asking you to confirm you're done, click 'Yes' to REALLY finish.

Oracle patch finsh.jpg

Oracle really done YN.jpg

Now we need to apply some one-off patches. Ensure that all Oracle software is shutdown.

First, apply the patch for the wrong_schema_bug:

change directory to the directory where the patch is located:
% cd 5458753
Apply the patch:

% /opt/oracle/product/10.2.0/OPatch/opatch apply

When asked if you want to proceed, enter Y


Next, apply the patch for the DST changes:

change directory to the directory where the patch is located:
% cd 5632264
Apply the patch:

% /opt/oracle/product/10.2.0/OPatch/opatch apply

When asked if you want to proceed, enter Y

And last, apply the patch for the JVM_DST changes:

change directory to the directory where the patch is located:
% cd 5458753

Follow the instructions in the README.txt file.


This completes the Oracle install.

Note: It is strongly suggested to add Oracle to the startup script.

Next step

Now we are ready to move on to the Database Schemas setup. For information on how to setup an initial schema, see:

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox