http://blog.sina.com.cn/s/blog_6b7ae4270101ns2v.html
http://blog.csdn.net/tongzidane/article/details/43852705
1 操作系统及Oracle版本
Linux版本:Red Hat Enterprise Linux Server release 6.4 (Santiago)#more /etc/issue
Oracle版本:
2 硬件环境检查
2.1 内存要求
至少1G,查看物理内存命令:
# grep MemTotal /proc/meminfo
虚拟内存要求:
物理内存4-8G,要求虚拟内存为2倍物理内存;
物理内存8-32G,要求虚拟内存为1.5倍物理内存;
物理内存32G,要求虚拟内存为32G;
查看虚拟内存命令:
# grep SwapTotal /proc/meminfo
增加虚拟内存示例:
# dd if=/dev/zero of=/swapadd bs=1024 count=2006424
# mkswap /swapadd
# swapon /swapadd
2.2 存储空间要求
/tmp目录下需至少1G空间
# df -h /tmp
如果不足1G需设置oracle用户的TMP和TMPDIR环境变量。
对数据库安装目录,需至少4.35G空间,对数据文件目录,需至少1.68G空间。
3 软件环境检查
2.1 内核版本要求
需满足:2.6.18 or later
检查命令:
# uname -r
2.2 系统包要求
以下系统包或以上版本(32个)必须满足:
rpm -ivh binutils-2.20.51.0.2-5.36.el6.i686.rpm
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.i686.rpm
rpm -ivh elfutils-libelf-0.152-1.el6.i686.rpm
rpm -ivh elfutils-libelf-devel-0.152-1.el6.i686.rpm
rpm -ivh glibc-common-2.12-1.107.el6.i686.rpm
rpm -ivh ksh-20100621-19.el6.i686.rpm
rpm -ivh kernel-headers-2.6.32-358.el6.i686.rpm
rpm -ivh glibc-headers-2.12-1.107.el6.i686.rpm
rpm -ivh glibc-devel-2.12-1.107.el6.i686.rpm
rpm -ivh glibc-2.12-1.107.el6.i686.rpm
rpm -ivh libstdc++-devel-4.4.7-3.el6.i686.rpm
rpm -ivh libstdc++-4.4.7-3.el6.i686.rpm
rpm -ivh libgcc-4.4.7-3.el6.i686.rpm
rpm -ivh libaio-devel-0.3.107-10.el6.i686.rpm
rpm -ivh libaio-0.3.107-10.el6.i686.rpm
rpm -ivh make-3.81-20.el6.i686.rpm
rpm -ivh numactl-devel-2.0.7-6.el6.i686.rpm
rpm -ivh sysstat-9.0.4-20.el6.i686.rpm
rpm -ivh unixODBC-2.2.14-12.el6_3.i686.rpm
rpm -ivh unixODBC-devel-2.2.14-12.el6_3.i686.rpm
rpm -ivh elfutils-libelf-devel-0.152-1.el6.i686.rpm
rpm -ivh libgomp-4.4.7-3.el6.i686.rpm
yum install gcc-* -y
rpm -ivh gcc-4.4.7-3.el6.i686.rpm
rpm -ivh gcc-c++-4.4.7-3.el6.i686.rpm
4 创建组及用户
# /usr/sbin/groupadd oinstall
# /usr/sbin/groupadd dba
# /usr/sbin/useradd -g oinstall -G dba oracle
# passwd oracle
5 配置内核参数
5.2 修改内核参数
经上述分析,SCB UPRR生产环境在/etc/sysctl.conf中无参数修改,但有参数增加,增加内容如下:
# vi /etc/sysctl.conf
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
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 = 1048586
fs.aio-max-nr = 1048576
修改后,使设置生效:
# /sbin/sysctl -p
执行生效命令后,再次检查确认参数设置:
# /sbin/sysctl -a
6 用户限制设置
6.1用户文件限制检查
切换到安装用户oracle
# su - oracle
检查以下参数是否在推荐的范围内
6.2修改用户限制
$ su - root
在文件/etc/security/limits.conf中加入以下内容:
# vi /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
在/etc/pam.d/login中增加以下内容:
vi /etc/pam.d/login
session required /lib/security/pam_limits.so
session required pam_limits.so
在/etc/profile中加入以下内容:
# 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
7 关闭SELinux
# vi /etc/sysconfig/selinux
#SELINUX=enforcing
SELINUX=disabled
8 创建安装目录
# mkdir -p /u01/app/
# chown -R oracle:oinstall /u01/app/
# chmod -R 775 /u01/app/
9 设置环境变量
# su - oracle
$ vi ~/.bash_profile
umask 022
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=uprr
$ source /home/oracle/.bash_profile
$ unset ORACLE_HOME
$ unset TNS_ADMIN
注意,除了ORACLE_BASE和ORACLE_SID,( /etc/profile和.bash_profile中)不设置任何oracle相关环境变量(ORACLE_HOME, PATH, LD_LIBRARY_PATH等)。
检查环境变量:
$ env | more
检查用户文件权限掩码:
$ umask
10 静默安装软件
10.1 创建oraInst.loc
$ su - root
# vi /etc/oraInst.loc
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
# chown oracle:oinstall /etc/oraInst.loc
# chmod 664 /etc/oraInst.loc
10.2 创建响应文件
su - oracle
vi /home/oracle/UPRR_INSTALL_DB_SWONLY.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=redhat
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN,zh_TW
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
DECLINE_SECURITY_UPDATES=true
vi /home/oracle/UPRR_DBCA.rsp
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "uprr"
SID = "uprr"
TEMPLATENAME = "General_Purpose.dbc"
DATAFILEDESTINATION = "/u01/app/oracle/oradata"
RECOVERYAREADESTINATION= "/u01/app/oracle/flash_recovery_area"
CHARACTERSET = "AL32UTF8"
NATIONALCHARACTERSET= "UTF8"
cp /tmp/database/response/netca.rsp /home/oracle/UPRR_NETCA.rsp
su - root
# chmod 700 /home/oracle/UPRR_INSTALL_DB_SWONLY.rsp
10.3 安装Oracle
安装:
# su - oracle
cd /tmp/database/
./runInstaller -silent -debug -force -responseFile /home/oracle/UPRR_INSTALL_DB_SWONLY.rsp
安装期间查看安装日志信息了解安装进度
$ cd $ORACLE_BASE/oraInventory/logs
$ tail -100f installActions*.log
root执行$ORACLE_HOME下的root.sh来建立oratab,dbhome,oraenv,coraenv文件, 如果提示则一直回车:
$ su - root
# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
# more /etc/oratab