+ ---------------- Install and configure Oracle 11g R2 on centos 5.5 ----------------- +
+ -------------------------------- By kerryhu ------------------------------------ +
I. Runtime Environment
System Environment: centos 5.5 32-bit (graphical installation)
Hard Disk Partition:
/Boot 150 m
Swap 4096 M (at least 3 GB)
/10g
/Home 5g
/Tmp 5g
/Usr 10g
/Usr/local 10g
/Var 10g
/OPT 10g
/Data all remaining
DF-H
# Synchronous clock
Yum-y install NTP
Ntpdate time.nist.gov
Echo "**/2 ***/sbin/ntpdate time.nist.gov">/etc/crontab
Close the service:
Iptables
SELinux
Portmap
Rpc. statd
Cupsd
Avahi-daemon
Sendmail
Killall iptables
Chkconfig -- level 2345 iptables off
Killall Portmap
Chkconfig -- level 2345 Portmap off
Killall avahi-daemon
Chkconfig -- level 2345 avahi-daemon off
Killall sendmail
Chkconfig -- level 2345 Sendmail off
Ii. Install the component package on which Oracle 11gr2 depends
# The following components are required:
Downloading packages:
(1/22): libaio-devel-0.3.106-5.i386.rpm | 12 KB
(2/22): numactl-devel-0.9.8-11.el5.i386.rpm | 17 KB
(3/22): elfutils-libelf-devel-0.137-3.el5.i386.rpm | 24 KB
(4/22): elfutils-libelf-devel-static-0.137-3.el5.i386.rpm | 66 KB
(5/22): libgomp-4.4.4-13.el5.i386.rpm | 72 KB
(6/22): libgcc-4.1.2-50.el5.i386.rpm | 96 KB
(7/22): nscd-2.5-58.el5_6.3.i386.rpm | 167 KB
(8/22): sysstat-7.0.2-3.el5_5.1.i386.rpm | 170 KB
(9/22): pdksh-5.2.14-36.el5.i386.rpm | 198 KB
(10/22): compat-libstdc ++-33-3.2.3-61.i386.rpm | 232 KB
(11/22): libstdc ++-4.1.2-50. el5.i386. RPM | 362 KB
(12/22): glibc-headers-2.5-58.el5_6.3.i386.rpm | 603 KB
(13/22): unixODBC-devel-2.2.11-7.1.i386.rpm | 739 KB
(14/22): unixODBC-2.2.11-7.1.i386.rpm | 832 KB
(15/22): kernel-headers-2.6.18-238.9.1.el5.i386.rpm | 1.1 MB
(16/22): glibc-devel-2.5-58.el5_6.3.i386.rpm | 2.0 MB
(17/22): cpp-4.1.2-50.el5.i386.rpm | 2.7 MB
(18/22): libstdc ++ devel-4.1.2-50.el5.i386.rpm | 2.8 mb
(19/22): gcc-C ++-4.1.2-50. el5.i386. RPM | 3.4 MB
(20/22): gcc-4.1.2-50.el5.i386.rpm | 5.2 MB
(21/22): glibc-2.5-58.el5_6.3.i686.rpm | 5.3 MB
(22/22): glibc-common-2.5-58.el5_6.3.i386.rpm
Yum-y install binutils compat-libstdc ++-33 elfutils-libelf-devel glibc-common glibc-devel GCC gcc-C ++ libaio-devel libaliblibgcc GCC stdc + + libstdc ++-devel make sysstat unixodbc-devel pdksh numactl-devel glibc-headers
/Sbin/ldconfig
3. Adjust Kernel Parameters
VI/etc/sysctl. conf
FS. File-max = 6815744
Kernel. Shmall = 2097152
Kernel. shmmax = 536870912
Kernel. shmmni = 4096
Kernel. SEM = 250 32000 100 128
Net. ipv4.ip _ local_port_range = 9000 65500
Net. Core. rmem_default = 262144
Net. Core. rmem_max = 4194304
Net. Core. wmem_default = 262144
Net. Core. wmem_max = 1048576
FS. AIO-max-Nr = 1048576
# Make kernel parameters take effect
Sysctl-P
# Modify limits. conf
VI/etc/security/limits. conf
# Oracle settings
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536
# Modify the system version (RedHat 5. X Series Systems skipped this step)
CP/etc/RedHat-release/etc/redhat-release.bk
VI/etc/RedHat-release
# Modify the content:
Red Hat Enterprise Linux as Release 5 (taroon)
# Modify/etc/PAM. d/login
# Add the following content:
Session required/lib/security/pam_limits.so
Session required pam_limits.so
# Modify/etc/profile
VI/etc/profile
# Add the following content:
If [$ user = "oracle"]; then
If [$ shell = "/bin/KSh"]; then
Ulimit-P 16384
Ulimit-N 65536
Else
Ulimit-u 16384-N 65536
Fi
Fi
# Modify/etc/CSH. Login
VI/etc/CSH. Login
# Add the following content:
If ($ user = "oracle") then
Limit maxproc 16384
Limit deors 65536
Endif
4. Create an oracle user
Groupadd oinstall
Groupadd DBA
Useradd-G oinstall-g dba Oracle
Passwd Oracle #753951
Mkdir-P/data/Oracle
Mkdir-P/data/oralnventory
Mkdir-P/data/software
Chown-r ORACLE: oinstall/data/Oracle
Chown-r ORACLE: oinstall/data/software
Chown-r ORACLE: oinstall/data/oralnventory
# Setting user environment variables
# Su-Oracle
$ VI. bash_profile
# Add the following content:
Oracle_sid = Kerry; export oracle_sid
Oracle_base =/data/Oracle; export oracle_base
ORACLE_HOME = $ oracle_base/product/11.2.0/db_1; export ORACLE_HOME
Path = $ path: $ ORACLE_HOME/bin: $ home/bin; export path
Admin and product under oracle_base
Oracle commands, database connection, installation assistant, listener, and so on in ORACLE_HOME.
This is just the definition of oracle. ORACLE_HOME is deeper than the oracle_base directory. That is, ORACLE_HOME = $ oracle_base/product/version
Oracle_base is the root directory of Oracle and ORACLE_HOME is the directory of Oracle products.
Simply put, if you have two versions of Oracle, oracle_base can be one, but ORACLE_HOME can be two.
The global database name is used to differentiate instances on different machines of a distributed database.
Sid is used to distinguish different instances on the same machine,
That is, one is used for external differentiation.
One is used for internal differentiation.
$ Source. bash_profile
5. Install Oracle
# Upload the Oracle Installation File to the/data/Software Directory and decompress it.
CD/data/software
Unzip linux_11gr2_database_1of2.zip
Unzip linux_11gr2_database204 f2.zip
Xhost + # (this command is run by the root user. You must perform the following two steps. If the command is not run, the graphic installation interface cannot be started)
Xhost + localhost
Su-oralce
CD/data/software/Database
$./Runinstaller # (run this command in the directory where the Oracle Installation File is located)
# Solution password: uppercase letters + numbers + lowercase letters
# Run the script as root
Su-
/Data/oralnventory/orainstroot. Sh
/Data/Oracle/product/11.2.0/db_1/root. Sh
Vi. startup settings
# Automatically start and disable database instances and listeners
VI/Oracle/product/11.2.0/db_1/bin/dbstart
Oracle_home_listner = $1
# Change:
Oracle_home_listner = $ ORACLE_HOME
VI/etc/init. d/Oracle
#! /Bin/sh
# Chkconfig: 345 61 61
# Description: Oracle 11g Autorun services
#/Etc/init. d/Oracle
#
# Run-level STARTUP script for the Oracle instance, listener, and
# Web Interface
Export oracle_base =/data/Oracle
Export ORACLE_HOME = $ oracle_base/product/11.2.0/db_1
Export oracle_sid = Kerry
Export Path = $ path: $ ORACLE_HOME/bin
Ora_ownr = "oracle"
# If the executables do not exist -- Display Error
If [! -F $ ORACLE_HOME/bin/dbstart-o! -D $ ORACLE_HOME]
Then
Echo "Oracle startup: cannot start"
Exit 1
Fi
# Depending on Parameter -- startup, shutdown, restart
# Of the instance and listener or usage display
Case "$1" in
Start)
# Oracle listener and instance startup
Su $ ora_ownr-LC $ ORACLE_HOME/bin/dbstart
Echo "Oracle start succesful! OK ."
;;
Stop)
# Oracle listener and instance Shutdown
Su $ ora_ownr-LC $ ORACLE_HOME/bin/dbshut
Echo "Oracle stop succesful! OK ."
;;
Reload | restart)
$0 stop
$0 start
;;
*)
Echo $ "Usage: 'basename $ 0' {START | stop | reload }"
Exit 1
Esac
Exit 0
Chmod 750/etc/init. d/Oracle
Ln-S/etc/init. d/Oracle/etc/rc1.d/k61oracle
Ln-S/etc/init. d/Oracle/etc/rc3.d/s61oracle
Chkconfig -- level 345 oracle on
Chkconfig -- add Oracle
# Start Oracle
Service Oracle start
# Enable and disable em automatically
VI/etc/init. d/oraemctl
#! /Bin/sh
# Chkconfig: 345 61 61
# Description: Oracle 11g Autorun services
#/Etc/init. d/oraemctl
#
# Run-level STARTUP script for the Oracle instance, listener, and
# Web Interface
Export oracle_base =/data/Oracle
Export ORACLE_HOME = $ oracle_base/product/11.2.0/db_1
Export oracle_sid = Kerry
Export Path = $ path: $ ORACLE_HOME/bin
Ora_ownr = "oracle"
Case "$1" in
Start)
Echo-N $ "starting Oracle em dB Console :"
Su-$ oracle_owner-c "$ ORACLE_HOME/bin/emctl start dbconsole"
Echo "OK"
;;
Stop)
Echo-N $ "Stopping Oracle em dB Console :"
Su-$ oracle_owner-c "$ ORACLE_HOME/bin/emctl stop dbconsole"
Echo "OK"
;;
*)
Echo $ "Usage: $0 {START | stop }"
Esac
Chmod 750/etc/init. d/oraemctl
# Start em
Service oraemctl start
VII. troubleshooting during installation
This patch is enough.
#: Http://www.megaupload.com /? D = 6a29zu8t
Su-Oracle
CD/data/software
Unzip p8670579_112010_linux.zip
CD 1, 8670579
/Data/Oracle/product/11.2.0/db_1/opatch apply-invptrloc/data/Oracle/product/11.2.0/db_1/orainst. Loc
# Replace/apps/Oracle/product/11.2.0/db_1/with $ ORACLE_HOME.
# After completing the patch, click Retry of the installer to continue the installation.
#2. libailProgramMissing package
Yum-y install libaio-devel libaio
/Sbin/ldconfig
#3. Critical: unable to allocate ports to the following processes within the specified range: JMS [5540-5559], RMI [5520-5539], Database Control [5500-5519], em agent [3938] | [1830-1849]
# Incorrect host name and IP address
VI/etc/hosts
Http://kerry.blog.51cto.com/172631/568220