oracle 12C 静默安装

感情迁移 提交于 2019-11-29 06:17:52

1 hosts主机配置
echo "neiwangip 主机名" >> /etc/hosts

2 配置英文环境变量
echo "export LANG=en_US" >> ~/.bash_profile

export NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK

3 创建用户与目录
/usr/sbin/groupadd -g 60001 oinstall
/usr/sbin/groupadd -g 60002 dba
/usr/sbin/groupadd -g 60003 oper
useradd -u 61001 -g oinstall -G dba,oper oracle

id oracle
passwd oracle

mkdir /oracle
mkdir /oradata
mkdir -p /oracle/app/oracle/product/12.2.0/db_1
mkdir -p /oracle/app/oraInventory
chown -R oracle:oinstall /oracle
chown -R oracle:oinstall /oradata
chmod -R 775 /oracle
chmod -R 775 /oradata

4 装依赖

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 ftp
yum -y install gcc
yum -y install gcc-c++
yum -y install lrzsz
yum -y install python-devel
yum -y install compat-db*
yum -y install compat-gcc-34
yum -y install compat-gcc-34-c++
yum -y install compat-libcap1
yum -y install compat-libstdc++-33
yum -y install compat-libstdc++-33.i686
yum -y install glibc-*
yum -y install glibc-*.i686
yum -y install libXpm-*.i686
yum -y install libXp.so.6
yum -y install libXt.so.6
yum -y install libXtst.so.6
yum -y install libXext
yum -y install libXext.i686
yum -y install libXtst
yum -y install libXtst.i686
yum -y install libX11
yum -y install libX11.i686
yum -y install libXau
yum -y install libXau.i686
yum -y install libxcb
yum -y install libxcb.i686
yum -y install libXi
yum -y install libXi.i686
yum -y install libgcc_s.so.1
yum -y install libstdc++.i686
yum -y install libstdc++-devel
yum -y install libstdc++-devel.i686
yum -y install libaio

5 修改操作系统相关参数

5.1 修改资源限制

vi /etc/security/limits.conf

root soft nproc 16384
root hard nproc 16384
root soft nofile 16384
root hard nofile 65536
root soft stack 10240
root hard stack 32768
#ORACLE SETTING
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft nofile 16384
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 32768

ulimit -a

5.2  控制为用户分配的资源

echo "session required pam_limits.so" >> /etc/pam.d/login
cat /etc/pam.d/login

5.3  修改内核参数

vi /etc/sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6553600
kernel.shmall = 2147483648
kernel.shmmax = 34359738368   
kernel.shmmni = 4096
kernel.sem = 2010 285420 100 142
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

sysctl -p

16G 内存修改内核参数 40-60%
cat /etc/sysctl.conf

fs.aio-max-nr = 1048576
fs.file-max = 6553600
kernel.shmall = 644245094
kernel.shmmax =  10307921510
kernel.shmmni = 4096
kernel.sem = 2010 285420 100 142
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

5.4 如果设置了 hugepages,还需要关闭透明页
vi /etc/rc.d/rc.local
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
chmod +x /etc/rc.d/rc.local

6 防火墙

systemctl status firewalld.service
systemctl stop firewalld.service
systemctl disable firewalld.service
--SELINUX
vi /etc/selinux/config
SELINUX=disabled
setenforce 0

7 设置 ORACLE 用户的环境变量

su - oracle
vi .bash_profile
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1

export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_UNQNAME=itpuxdb
ORACLE_SID=itpuxdb; export ORACLE_SID
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
umask=022
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.
2.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/oracle/app/oraInventory
ORACLE_HOME=/oracle/app/oracle/product/12.2.0/db_1
ORACLE_BASE=/oracle/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba

ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi

7 静默安装 ORACLE 软件与配置监听

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.2.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/oracle/app/oraInventory
ORACLE_HOME=/oracle/app/oracle/product/12.2.0/db_1
ORACLE_BASE=/oracle/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!