欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

RHEL7.5 静默安装(silent mode)oracle11gr2数据库软件

程序员文章站 2024-01-29 13:19:52
参考官方文档 Database Quick Installation Guide for Linux x86-64,https://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htmhttps://www.cnblogs.com/nucdy... ......

参考官方文档 database quick installation guide for linux x86-64,https://docs.oracle.com/cd/e11882_01/install.112/e24326/toc.htm

https://www.cnblogs.com/nucdy/p/5603998.html

https://www.cnblogs.com/lightnear/p/8036159.html

0.修改host文件和主机名及关闭selinux

[root]

sed -i '3,$d' /etc/hosts

echo '192.0.2.10     std.example.com     std'>>/etc/hosts

hostnamectl --static set-hostname std

vi /etc/selinux/config 修改

selinux=disabled

1.安装依赖软件

[root]

binutils-2.23.52.0.1-12.el7.x86_64 

compat-libcap1-1.10-3.el7.x86_64 

compat-libstdc++-33-3.2.3-71.el7.i686

compat-libstdc++-33-3.2.3-71.el7.x86_64

gcc-4.8.2-3.el7.x86_64 

gcc-c++-4.8.2-3.el7.x86_64 

glibc-2.17-36.el7.i686 

glibc-2.17-36.el7.x86_64 

glibc-devel-2.17-36.el7.i686 

glibc-devel-2.17-36.el7.x86_64 

ksh

libaio-0.3.109-9.el7.i686 

libaio-0.3.109-9.el7.x86_64 

libaio-devel-0.3.109-9.el7.i686 

libaio-devel-0.3.109-9.el7.x86_64 

libgcc-4.8.2-3.el7.i686 

libgcc-4.8.2-3.el7.x86_64 

libstdc++-4.8.2-3.el7.i686 

libstdc++-4.8.2-3.el7.x86_64 

libstdc++-devel-4.8.2-3.el7.i686 

libstdc++-devel-4.8.2-3.el7.x86_64 

libxi-1.7.2-1.el7.i686 

libxi-1.7.2-1.el7.x86_64 

libxtst-1.2.2-1.el7.i686 

libxtst-1.2.2-1.el7.x86_64 

make-3.82-19.el7.x86_64 

sysstat-10.1.5-1.el7.x86_64

--7.5

yum -y install binutils binutils-devel compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libaio libaio.i686 libaio-devel libaio-devel.i686 libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libxi libxi.i686 libxtst libxtst.i686 make sysstat unixodbc unixodbc-devel

--6.5

yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-devel glibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaio libaio.i686 libaio-devel libaio-devel.i686 make sysstat unixodbc unixodbc.i686 unixodbc-devel unixodbc-devel.i686

2.创建用户和组

[root]

groupadd oinstall

groupadd dba

useradd oracle -g oinstall -g dba

passwd oracle

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

        umask 022

fi

export oracle_base=/u01/app/oracle

export oracle_home=/u01/app/oracle/product/11.2.0/dbhome_1/

export oracle_sid=std1

export path=$oracle_home/bin:$path

3.修改内核

[root]

[root@localhost ~]# memtotal=$(free -b | sed -n '2p' | awk '{print $2}') 

[root@localhost ~]# shmmax=$(expr $memtotal / 2)

[root@localhost ~]# shmmni=4096

[root@localhost ~]# pagesize=$(getconf page_size)

[root@localhost ~]# cat >> /etc/sysctl.conf << eof

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmmax = $shmmax

kernel.shmall = $(expr \( $shmmax / $pagesize \) \* \( $shmmni / 16 \))

kernel.shmmni = $shmmni

kernel.sem = 250 32000 100 128

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 = 1048576

eof

[root@localhost ~]# sysctl -p

modprobe bridge
lsmod|grep bridge

/etc/security/limits.conf最后加上

oracle  soft  nproc   2047

oracle  hard  nproc   16384

oracle  soft  nofile  1024

oracle  hard  nofile  65536

oracle  soft  stack   10240

oracle  hard  stack   32768

4.创建需要的目录

[root]

mkdir -p /u01/app/oracle

mkdir -p /u01/app/orainventory

chown -r oracle:oinstall /u01/app/

chmod -r 775 /u01/app/

5.静默安装

[oracle]

cat db_install.rsp

#仅安装oracle软件

oracle.install.responsefileversion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

oracle.install.option=install_db_swonly

oracle_hostname=edw

unix_group_name=dba

inventory_location=/u01/app/orainventory

selected_languages=en,zh_cn

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=true

oracle.install.db.customcomponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0

oracle.install.db.dba_group=dba

oracle.install.db.oper_group=oinstall

oracle.install.db.config.starterdb.type=general_purpose

decline_security_updates=true

安装

/home/oracle/database/runinstaller -silent -ignoreprereq -responsefile /home/oracle/database/response/db_install.rsp

完成后root执行/u01/app/oracle/orainventory/orainstroot.sh    /u01/app/oracle/product/11.2.0/db_1/root.sh

或者dbca安装

修改<unzip path>/database/stage/cvu/cv/admin 目录下的

cvu_config文件

将其中的

cv_assume_distid=oel4

改为

cv_assume_distid=oel6

./runinstaller -jreloc /usr/lib/jvm/jre1.8.0_191

ps.安装oracle环境配置工具    可以自动安装依赖软件、修改内核参数、创建用户和组

yum -y install oracle-rdbms-server-11gr2-preinstall