centos7.3安装12cR2

1、 安装版本

系统:Centos7.3 
Oracle:Oracle Database 12c Release 2

2、安装Oracle 软件前准备

2.1添加用户组
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle

2.2创建安装目录
mkdir -p /data/app/oracle/product/12.2.0/dbhome_1
chown -R oracle:oinstall /data
chmod -R 775 /data

2.3 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux

2.4设置系统参数

在/etc/sysctl.conf下添加如下内核参数
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

添加资源限制/etc/security/limits.conf
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hardnofile 65535

oracle soft nproc 65536
oracle hard nproc 65536
oracle soft nofile 65536
oracle hard nofile 65536
oracle soft stack 10240

 

2.5设置环境变量
在/etc/sysctl.conf下添加如下参数
vi .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/data/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=nccdb
#export ORACLE_TERM=xterm
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin
export PATH

2.6关闭透明大页
cat /sys/kernel/mm/transparent_hugepage/enabled #如果是always说明启用了
vi /etc/default/grub ## 在quiet后面添加transparent_hugepage=never
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet transparent_hugepage=never"

grub2-mkconfig -o /boot/grub2/grub.cfg
init 6

2.7安装依赖包
yum install -y binutils.x86_64 compat-libcap1.x86_64 gcc.x86_64 gcc-c++.x86_64 glibc.i686 glibc.x86_64 \
> glibc-devel.i686 glibc-devel.x86_64 ksh compat-libstdc++-33 libaio.i686 libaio.x86_64 libaio-devel.i686 libaio-devel.x86_64 \
> libgcc.i686 libgcc.x86_64 libstdc++.i686 libstdc++.x86_64 libstdc++-devel.i686 libstdc++-devel.x86_64 libXi.i686 libXi.x86_64 \
> libXtst.i686 libXtst.x86_64 make.x86_64 sysstat.x86_64 smartmontools.x86_64

3、安装oracle软件

unzip linuxx64_12201_database.zip
cd /database
./runInstaller

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 root下执行两个脚本

 

 

 

 

 

dbca建库

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

posted @ 2020-12-23 10:51  lysheng  阅读(149)  评论(0编辑  收藏  举报