參考官方文檔 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]
#僅安裝oracle軟體
或者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
靜默安裝的代碼[oracle@vps4 response]$ ~/database/runInstaller -silent -ignorePrereq -waitforcompletion -responseFile ~/database/response/db_install.rsp \ oracle.install.option=INSTALL_DB_SWONLY \ ORACLE_HOSTNAME=vps4 \ UNIX_GROUP_NAME=oinstall \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1 \ ORACLE_BASE=/u01/app/oracle \ oracle.install.db.InstallEdition=EE \ oracle.install.db.DBA_GROUP=dba \ oracle.install.db.OPER_GROUP=oinstall \ DECLINE_SECURITY_UPDATES=true \ oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \ DECLINE_SECURITY_UPDATES=true