CentOS 6.6安装Oracle 11G - 环境准备

#安装目录:/db
#安装包目录 : /temp

#1.关闭selinux

创建 lvm 、格式化硬盘、挂载至/db

 pvcreate /dev/sdb
vgcreate db_vg /dev/sdb
vgchange -a y db_vg
lvcreate -L 100G -n db_data db_vg

格式化分区

mkfs -t ext4 /dev/mapper/db_vg-db_data

挂载分区

 mount /dev/mapper/db_vg-db_data /db/

编辑 /etc/fstab,增加一行

/dev/mapper/db_vg-db_data /db ext4 defaults 0 0

添加hosts
#2.创建用户和组

 groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle

#3.给oracle用户赋权

 chown -R oracle:oinstall /db
chmod -R 775 /db

#4.修改yum源

#5.安装所需依赖包

yum -y install compat-libstdc++-33-3.2.3
yum -y install binutils
yum -y install compat-libstdc++
yum -y install elfutils-libelf
yum -y install elfutils-libelf-devel
yum -y install gcc
yum -y install gcc-c++
yum -y install glibc
yum -y install glibc-common
yum -y install glibc-devel
yum -y install glibc-headers
yum -y install libaio
yum -y install libaio-devel
yum -y install libgcc
yum -y install libstdc++
yum -y install libstdc++-devel
yum -y install make
yum -y install sysstat
yum -y install unixODBC
yum -y install unixODBC-devel
yum -y install unzip
yum -y install libXp
yum -y install libXt

#6.配置系统参数

#sysctl

编辑/etc/sysctl.conf 文件,添加以下几行

kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.aio-max-nr = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.core.rmem_max = 4194304
net.core.rmem_default = 262144
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
sysctl -p

#———————————————————-
#———————————————————-

cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 4096
oracle hard nofile 65536
oracle soft stack 10240
EOF

#———————————————————-
#———————————————————-
cat >> /etc/pam.d/login <<EOF
session required /lib/security/pam_limits.so
session required pam_limits.so
EOF

#———————————————————-
#———————————————————-

cat >> /etc/profile <<EOF

if [ $USER = “oracle” ]; then
if [ $SHELL = “/bin/ksh” ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
EOF

source /etc/profile
#———————————————————-
#———————————————————-

cat >> /home/oracle/.bash_profile <<EOF
#Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_BASE=/db/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
EOF

##
source /home/oracle/.bash_profile

点赞

发表评论

电子邮件地址不会被公开。 必填项已用*标注