First, hardware requirements
1. Memory and Sweap: Memory 2G (above), Sweap 2G (above)
Memory: 1-2g 2-16g 16G or more
sweap:1.5 Memory 1 time times memory 16G
Check: # grep Memtotal/proc/meminfo
# grep Swaptotal/proc/meminfo
2. Disk: 20G or more
Check: #df-H
Second, the software requirements
Operating system: CentOS6.5 (x86_64)
Oracle version: 11gR2 (x86_64)
: http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
Third, network requirements
Set the static IP, set the virtual machine IP address and the real host IP address in the same IP segment, the other (NETMASK,BROADCAST,GATEWAY,DNS) is consistent with the host (virtual machine <---> host; virtual machines <----> Internet communication).
Turn off firewall, SELinux:
# Setenforce 0 #SELinux临时关闭命令
# Service Iptables Stop #防火墙临时关闭命令
Iv. installation of RPM dependent packages
RPM Installation Package list:
Binutils-2.20.51.0.2-5.11.el6 (x86_64)
Compat-libcap1-1.10-1 (x86_64)
Compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
Gcc-4.4.4-13.el6 (x86_64)
Gcc-c++-4.4.4-13.el6 (x86_64)
Glibc-2.12-1.7.el6 (i686)
Glibc-2.12-1.7.el6 (x86_64)
Glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
Ksh
Libgcc-4.4.4-13.el6 (i686)
Libgcc-4.4.4-13.el6 (x86_64)
Libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
Libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
Libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
Libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
Make-3.81-19.el6
Sysstat-9.0.4-11.el6 (x86_64)
Way: See http://www.92csz.com/study/linux/11.htm
Networked Installation:
# Yum Search Rpmkeyword
# yum Install <package-name>
The default network address can be modified:Vi/etc/yum.repos.d/centos-base.repo
First Download and install:
RPM package is copied to the/opt directory (or using the wget command)
# RPM-IVH <package-name>
CSDN Free points: http://download.csdn.net/detail/u010011052/6260539
There is a dependency problem with RPM installation and it is recommended that you install it with Yum if it works.
V. Modifying kernel parameters and system resource limits
#vi/etc/sysctl.conf #末尾添加如下:
Net.ipv4.ip_local_port_range= 9000 65500
Fs.file-max = 6815744
Kernel.shmall = 10523004
Kernel.shmmax = 6465333657
Kernel.shmmni = 4096
Kernel.sem = 250 32000 100128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
FS.AIO-MAX-NR = 1048576
# sysctl-p #从配置文件 "/etc/sysctl.conf" load kernel parameter settings
# sysctl-a #查看所有系统变量
# vi/etc/security/limits.conf #末尾添加如下:
Oracle Soft Nproc 2047
Oracle Hard Nproc 16384
Oracle Soft Nofile 1024
Oracle Hard Nofile 65536
# Vi/etc/pam.d/login #在session Required pam_namespace.so add one below:
Session Required Pam_limits.so
# Vi/etc/profile #末尾添加如下:
if [$USER = "Oracle"]; Then
if [$SHELL = "/bin/ksh"];then
Ulimit-p 16384
Ulimit-n 65536
Else
Ulimit-u 16384-n 65536
Fi
Fi
# vi/etc/hosts #否则在配置Oracle监听时会出现问题而无法启动, add the following:
192.168.8.33 oracledb #IP地址 host name ($HOSTNAME)
# Xhost + #使所有用户都能访问图形桌面
Vi. creating groups and users
# groupadd-g Oinstall
# GROUPADD-G 201 DBA
# useradd-u 440-g oinstall-g dba Oracle
# passwd Oracle
# ID Oracle #查看oracle用户
# vi/etc/sudoers #将oracle加入到sudo群组, add after root all= (all):
Oracle All= (All) all
Vii. Creating an Oracle installation directory
# mkdir/opt/oracle/app/
# mkdir/opt/oracle/oradata/
# chmod 755/opt/oracle/
# chmod 775/opt/oracle/app/
# chown Oracle.oinstall-r/opt/oracle/
Eight, set environment variables
Log out of root, enter with Oracle account
$ VI ~/.bash_profile #~/represents the current user's root directory/home/oracle, added as follows:
Export Oracle_base=/opt/oracle
Export Oracle_home= $ORACLE _base/112
Export Ld_library_path= $ORACLE _home/lib
Export path= $PATH: $ORACLE _home/bin
Export ORACLE_SID=ORCL
$ source ~/.bash_profile #立即生效
$ export Lang=en_us. UTF-8 #更改字符集 (. UTF-8 not less), or there will be Chinese garbled
# Env|more #查看配置的环境变量是否正确
Nine, decompression and installation
$ cd/opt/oracle #/opt/oracle Store directory for installation files
$ unzip/media/linux_11gr2_database_1of2.zip
$ unzip/media/linux_11gr2_database_2of2.zip
$ CD Database
$./runinstaller
Select Advanced installation to specify the character set ZH16GBK.
When the installation is complete, a dialog box prompts you to execute both scripts using the root user.
#/opt/oracle/orainventory/oraioot.sh
#/opt/oracle/app/product/11.2.0/dbhome_1/root.sh
Su–oracle
$ lsnrctl Start #开启监听
$ sqlplus/as SYSDBA
Sql> Startup #启动数据库
X. Self-Starting service settings
# Vi/etc/init.d/oracledb #编辑新增文件如下:
# chkconfig:35 80 10
# description:starts The Oracle dabase deamons
#/etc/init.d/oracledb
oracle_home=/opt/oracle/112
Oracle_owner=oracle
Case "$" in
Start
Echo-n "Starting OracleDB:"
su-$ORACLE _owner-c "$ORACLE _home/bin/dbstart"
Touch/var/lock/subsys/oracledb
Echo-n "Starting Lsnr:"
su-$ORACLE _owner-c "$ORACLE _home/bin/lsnrctl start"
Echo-n "Starting Dbconsole:"
su-$ORACLE _owner-c "$ORACLE _home/bin/emctl start Dbconsole"
Echo
;;
Stop
Echo-n "shutting down Dbconsole:"
su-$ORACLE _owner-c "$ORACLE _home/bin/emctl stop Dbconsole"
Echo-n "shutting down Lsnr:"
su-$ORACLE _owner-c "$ORACLE _home/bin/lsnrctl Stop"
Echo-n "shutting down OracleDB:"
su-$ORACLE _owner-c "$ORACLE _home/bin/dbshut"
Rm-f/var/lock/subsys/oracledb
Echo
;;
Restart
Echo-n "Restarting OracleDB:"
$ stop
$ start
Echo
;;
*)
echo "Usage: ' basename ' Start|stop|restart"
Esac
Where 35 80 10 is based on the following query:
[Email protected] rc.d]$ find-name ' k*oracledb '
./rc2.d/k10oracledb
./rc4.d/k10oracledb
./rc6.d/k10oracledb
./rc1.d/k10oracledb
./rc0.d/k10oracledb
[Email protected] rc.d]$ find-name ' s*oracledb '
./rc5.d/s80oracledb
./rc3.d/s80oracledb
[Email protected] rc.d]$ chkconfig--list oracledb
OracleDB 0:off 1:off 2:off 3:on 4:off 5:on 6:off
As in the previous OracleDB file, the first two lines of comments may not be written, you can use the file link:
# ln-s/etc/init.d/oracledb/etc/rc.d/rc3.d/s80oracledb
# ln-s/etc/init.d/oracledb/etc/rc.d/rc5.d/s80oracledb
# ln-s/etc/init.d/oracledb/etc/rc.d/rc0.d/k10oracledb
# ln-s/etc/init.d/oracledb/etc/rc.d/rc1.d/k10oracledb
# ln-s/etc/init.d/oracledb/etc/rc.d/rc2.d/k10oracledb
# ln-s/etc/init.d/oracledb/etc/rc.d/rc4.d/k10oracledb
# ln-s/etc/init.d/oracledb/etc/rc.d/rc6.d/k10oracledb
# chmod 775/etc/init.d/oracledb #改变文件权限
# chkconfig--level Oracle on #添加服务
# Vi/etc/oratab #修改oracle启动配置
Orcl:/opt/oracle/112:y # $ORACLE _sid: $ORACLE _home:<n| Y>:
Installation of Oracle 11g in centos6.5_64 bit system