Vous êtes sur la page 1sur 6

Installing Oracle 11g Release 2 Standard Edition on Red Hat Enterprise Linux 5.

7 (x86_64) within 60 minutes


Important! We are launching these days a new OTK version. You should use https://www.quist.ch/install-oracle-11gr2-rhel5 instead of this howto.

Preamble
As you see from the title this page contains a very specific installation howto. It is the one to install respectively to deploy Oracle 11g Release 2 Standard Edition on Red Hat Enterprise Linux 5.7 (x86_64). Whether you are an Oracle newbie or an experienced Database Administrator the goal to setup a production, test or development database server within 60 minutes remains the same. OraToolKit (OTK) assists you through the whole installation process and the only thing what you have to do is to copy and paste the sample commands from this howto. Occasionally you may want to do some own customisation. This is no problem since OTK tries to be open and flexible. If this howto correspondes exactly to what you are looking for you may want to continue. Otherwise click here to find one of over 500 howtos which will hopefully match your requirements.

Target audience
This howto is meant for every one interested in the installation task and who might also be impatient to go through the getting started tutorial which explains the concepts. Since of its "check list" nature this howto will steer you stright forward to the goal. If there will be something unclear for you there will be links pointing to the concepts.

Preparation
This guide assumes that you have installed Red Hat Enterprise Linux 5.7 with default packages and that you have downloaded the following software: Category DB DB OS Description Version File name Download site

Oracle 11g R2 11.2.0.1.0 linux.x64_11gR2_database_1of2.zip oracle.com (Disk1) Oracle 11g R2 11.2.0.1.0 linux.x64_11gR2_database_2of2.zip oracle.com (Disk2) Red Hat 5.7 rhel-server-5.7-x86_64-dvd.iso redhat.com Enterprise Linux

Transfer the downloaded files beside ISO image(s) to /var/tmp/oracle directory which you will first have to create. Use a GUI tool like WinSCP to copy the files to your server.

Installation Process
The next few subsections describes the installation process which will end with the creation of the database. In case you enable archivelog mode you may also read "Enabling Database backups" section.

Download Quist repo configuration


Register at Quist and download your repository configuration in order to install oraToolKit.
# su - root # USER="<your repo username>" # PASSWORD="<your repo password>" # cd /etc/yum.repos.d # wget --user=$USER --password=$PASSWORD -O quist-rhel.repo https://www.quist.ch/repositories/custom/$USER/quist-rhel.repo

Installing oraToolKit
Install now oraToolKit.
# yum install -y oratoolkit

Setting password of OS user "oracle"


# passwd oracle

Fulfilling package requirements


Run software requirement check (swReqCheck) action of installManager. If you have a virgin system you may get some warnings. Add the missing packages using yum or rpm command. Rerun swReqCheck action until no warnings are shown.
# /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

To install the missing packages using yum command follow the steps from the next box. Note that you will need access to a yum repository.
# # Generate yum command # REQ_FILE_DIR="/opt/oracle/otk/current/conf/installManager/requirement" # REQ_FILE_PATH="$REQ_FILE_DIR/ora11gR2-redhat-5-x86_64.pkg.lst" # YUM_COMMAND=$(echo "yum install") # YUM_COMMAND+=$(egrep -v "#" $REQ_FILE_PATH | grep 32-bit | awk '{ print " "$1".i[356]86" }') # YUM_COMMAND+=$(egrep -v "#" $REQ_FILE_PATH | grep 64-bit | awk '{ print " "$1".x86_64" }') # # Display yum command # echo $YUM_COMMAND # # Execute yum command # $YUM_COMMAND

# # Run swReqCheck again # /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

As you can see the yum command can be dynamically generated using software requirement check file from oratoolkit. If you do not have access to a yum repository install the missing packages from installation media using rpm command.
# mount /dev/cdrom /mnt; cd /mnt/Server # rpm -ivh kernel-headers-2.6.18-274.el5.x86_64.rpm \ glibc-headers-2.5-65.x86_64.rpm \ libstdc++-devel-4.1.2-51.el5.x86_64.rpm \ sysstat-7.0.2-11.el5.x86_64.rpm \ glibc-devel-2.5-65.x86_64.rpm \ libaio-devel-0.3.106-5.x86_64.rpm \ gcc-4.1.2-51.el5.x86_64.rpm \ gcc-c++-4.1.2-51.el5.x86_64.rpm \ elfutils-libelf-devel-static-0.137-3.el5.x86_64.rpm \ elfutils-libelf-devel-0.137-3.el5.x86_64.rpm \ libtermcap-devel-2.0.8-46.1.x86_64.rpm \ readline-devel-5.1-3.el5.x86_64.rpm \ unixODBC-2.2.11-7.1.x86_64.rpm \ unixODBC-devel-2.2.11-7.1.x86_64.rpm \ glibc-devel-2.5-65.i386.rpm \ libaio-devel-0.3.106-5.i386.rpm \ unixODBC-2.2.11-7.1.i386.rpm \ unixODBC-devel-2.2.11-7.1.i386.rpm \ compat-gcc-34-3.4.6-4.1.x86_64.rpm \ compat-gcc-34-c++-3.4.6-4.1.x86_64.rpm \ gdb-7.0.1-37.el5.x86_64.rpm \ libXp-1.0.0-8.1.el5.i386.rpm \ compat-db-4.2.52-5.1.x86_64.rpm \ libstdc++-devel-4.1.2-51.el5.i386.rpm # cd /; umount /mnt; eject # /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg

Enhancing sql*plus
If you would like to benefit from enhanced sql*plus functionality compile and install rlwrap utility.
# # # # # cd /opt/oracle/otk/current/tools/rlwrap/ ./configure make make install /usr/local/bin/rlwrap -v

Executing osSetup action of installManager


Change into /opt/oracle/otk/current/conf/installManager directory and review osSetup11gR2.cfg. It contains kernel parameters, directories to be created, ownerships and other settings you may want to change. Keep the file unchanged if you go for a default installation. Execute afterwards osSetup action of installManager.
# cd /opt/oracle/otk/current/conf/installManager/ # vi osSetup11gR2.cfg

# sdiff -s osSetup11gR2.cfg sample/osSetup11gR2.cfg # /opt/oracle/otk/current/bin/installManager osSetup osSetup11gR2.cfg

Move Oracle software downloads to the repository


Move the downloaded Oracle software to /var/opt/oracle/repository which is the default place where software installation (swInst) action looks for it. Extraction / unzip will be managed by the swInst action.
# cd /var/tmp/oracle # chown oracle:oinstall * # mv linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip /var/opt/oracle/repository/

Logon as oracle user and customize your PS1 variable


Logon for the first time as oracle user and customize your PS1 variable. If you are not already familiar with vi edit .profile.custom.interactive directly with WinSCP's internal editor.
# su - oracle -----------------------------------------------------oraToolKit 1.0 environment variables -----------------------------------------------------Installation directory : /opt/oracle/otk Release : $RUN directory : /opt/oracle/otk/1.0/bin $LOG_BASE directory : /var/opt/oracle/otk/1.0/log -----------------------------------------------------<SITE|COMPANY>:oracle@stquist1p:sidNotSet$ .profile.custom.interactive SITE="<SITE|COMPANY>" <SITE|COMPANY>:oracle@stquist1p:sidNotSet$ .profile.custom.interactive <SITE|COMPANY>:oracle@stquist1p:sidNotSet$ .profile.custom.interactive SITE="Quist-LU" <SITE|COMPANY>:oracle@stquist1p:sidNotSet$ # su - oracle Quist-LU:oracle@stquist1p:sidNotSet$ grep ^SITE

vi grep ^SITE

exit

Installing Oracle Software


Install Oracle software without clicking through Oracle Universal Installer (OUI). Use instead smart swInst action of installManager which installs Oracle SW with OUI silently. Add your own reponse files if you prefer another ORACLE_HOME destination.
$ $ $ $ $ # bash cd $INSTALL_CONF cp sample/swInstSeSrv1-linux-x86_64.cfg . installManager swInst swInstSeSrv1-linux-x86_64.cfg su /opt/oracle/sesrv/11.2.0/db1/root.sh

# exit

Creating database(s)
Create one or more Oracle databases using dbSetup action of installManager. Change into $INSTALL_CONF directory if you are not already there and choose one configuration file. Review it and modify at least ORACLE_HOME variable before executing installManager.
$ cd $INSTALL_CONF $ ls -1 dbSetup*.cfg dbSetup-dev.cfg dbSetup-prod.cfg dbSetup-test.cfg $ vi dbSetup-prod.cfg $ sdiff -s dbSetup-prod.cfg sample/dbSetup-prod.cfg ORACLE_HOME=/opt/oracle/sesrv/11.2.0/db1 | ORACLE_HOME=/opt/oracle/sesrv/11.1.0/db1 $ installManager dbSetup dbSetup-prod.cfg

Connecting to the database


Congratulation! You have successfully installed Oracle on your server. Try connecting to the database using EZCONNECT or TNS method. See also the next sections especially then if you will use your server in production.
$ $ $ $ bash sourceProdEnv sqlplus otk/otk@//$ORACLE_HOSTNAME:1531/PROD sqlplus otk/otk@PROD

Managing Oracle with appctl


If you kept APPCTL_ENABLED variable which is set to TRUE check the managebility of your main Oracle processes.
$ ctl status all $ ctl stop all $ ctl start all

Enabling database backups


This sections describes how you can enable physical rman backups. Go through it if your business requires a backup strategy to be implemented.

Rman backups with backupManager


Change into $BACKUP_CONF directory and see the available configuration file. Review its values before executing backupManager.
$ cd $BACKUP_CONF $ vi prod.cfg $ sdiff -s prod.cfg sample/prod.cfg

DISK_DEVICE_MOUNT_POINT="/" | DISK_DEVICE_MOUNT_POINT="/backup01" $ backupManager full prod.cfg

Automating backup using cron job


After a successful first backup enable nigthly backups by uncommenting the first crontab example and by setting the right configuration file name(s).
$ crontab -l|head -2 # Example 1: Daily physical database backup # 0 2 * * * [ -d $HOME/../current ] && (ksh -c '. ./.profile >/dev/null; backupManager full <sid_1>.cfg <sid_2>.cfg <sid_n>.cfg >/dev/null') $ crontab -e $ crontab -l|head -2 # Example 1: Daily physical database backup 0 2 * * * [ -d $HOME/../current ] && (ksh -c '. ./.profile >/dev/null; backupManager full prod.cfg >/dev/null')

Vous aimerez peut-être aussi