项目规划:
os:rhel 7.6
hostname:mydb #主机名
db name :db1 #数据库名
空间划分:内存 8G
目录划分:
/ 80g
/oracle 50g
/oradata 200g
/backup 400g
/archive 200g
- 系统参数设置
1、host文件配置
echo "本机IP 主机名" >> /etc/hosts
cat /etc/hosts
2、配置语言环境变量
echo "export LANG=en_US" >> ~/.bash_profile
source ~/.bash_profile
3、准备文件系统
创建pv:pvcreate /dev/sdb /dev/sdc /dev/sdd /dev/sde
创建vg:vgcreate oravg /dev/sdb
vgcreate datavg /dev/sdc
vgcreate backvg /dev/sdd
vgcreate archvg /dev/sde
创建lv:lvcreate -n oralv -L 50000M oravg
lvcreate -n datalv -L 200000M datavg
lvcreate -n backlv -L 400000M backvg
lvcreate -n archlv -L 200000M archvg
创建文件系统:mkfs.xfs /dev/oravg/oralv
mkfs.xfs /dev/datavg/datalv
mkfs.xfs /dev/backvg/backlv
mkfs.xfs /dev/archvg/archlv
创建目录:mkdir /oracle
mkdir /oradata
mkdir /backup
mkdir /archive
自动挂载:echo "/dev/oravg/oralv /oracle xfs defaults 0 0" >> /etc/fstab
echo "/dev/datavg/datalv /oradata xfs defaults 0 0" >> /etc/fstab
echo "/dev/backvg/backlv /backup xfs defaults 0 0" >> /etc/fstab
echo "/dev/archvg/archlv /archive xfs defaults 0 0" >> /etc/fstab
挂载目录:mount /oracle
mount /oradata
mount /backup
mount /archive
4、创建用户、组、目录
/usr/sbin/groupadd -g 60001 oinstall #创建oinstall组,ID为60001
/usr/sbin/groupadd -g 60002 dba #创建dba组,组ID为60002
/usr/sbin/groupadd -g 60003 oper #创建oper组,组ID为60003
useradd -u 61001 -g oinstall -G dba,oper oracle #创建oracle用户,ID为61001,主组为oinstall ,附属组为dba和oper
passwd oracle
oracle
oracle
mkdir -p /oracle
mkdir -p /oracle/app/oracle/product/11.2.0
mkdir -p /oracle/app/oraInventory
chown -R oracle:oinstall /oracle
chown -R oracle:oinstall /oradata
chown -R oracle:oinstall /backup
chown -R oracle:oinstall /archive
chmod -R 775 /oracle
chmod -R 775 /oradata
chmod -R 775 /backup
chmod -R 775 /archive
5、配置yum源
mkdir /yum
cd /etc/yum.repos.d/
rm -rf *
touch /yum.repo
vi yum.repo
[rhel]
name=rhel
baseurl=file:///yum
gpgcheck=0
enabled=1
mount /dev/cdrom /yum/
6、安装必备软件
yum -y install autoconf
yum -y install automake
yum -y install binutils
yum -y install binutils-devel
yum -y install bison
yum -y install cpp
yum -y install dos2unix
yum -y install gcc
yum -y install gcc-c++
yum -y install lrzsz
yum -y install python-devel
yum -y install compat-db*