Linux 64位下Oracle 12CR2安装(一)

时间:2021-11-08 23:30:59

begin~

环境说明
操作系统:Oracle Linux 6
数据库版本: Oracle Database 12c Release 2

Linux 64位下Oracle 12CR2安装准备:

  • 下载安装软件包
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
  • 上传到指定位置
[root@vastdata1 ~]$ cd /home/oracle
  • 关闭防火墙
[root@vastdata1 ~]$ service iptables stop

修改selinux

[root@vastdata1 ~]$ vi /etc/selinux/config
SELINUX=disabled
  • 配置本地yum源并验证
[root@vastdata ~]# vi /etc/yum.repos.d/oel.repo 
[ol6]
name=Oracle Linux 6
baseurl=file:///media/OL6.5\ x86_64\ Disc\ 1\ 20131125
gpgcheck=0
enabled=1

[root@vastdata ~]# yum repolist
Loaded plugins: refresh-packagekit, security
repo id repo name status
ol6 Oracle Linux 6 3,669
repolist: 3,669
  • 安装RPM包
摘自官方文档:
The following packages (or later versions) must be installed:

binutils-2.20.51.0.2-5.36.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (i686)
e2fsprogs-1.41.12-14.el6 (x86_64)
e2fsprogs-libs-1.41.12-14.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (i686)
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (i686)
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6 (i686)
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6 (i686)
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6 (i686)
libXtst-1.0.99.2 (x86_64)
libXtst-1.0.99.2 (i686)
libX11-1.5.0-4.el6 (i686)
libX11-1.5.0-4.el6 (x86_64)
libXau-1.0.6-4.el6 (i686)
libXau-1.0.6-4.el6 (x86_64)
libxcb-1.8.1-1.el6 (i686)
libxcb-1.8.1-1.el6 (x86_64)
libXi-1.3 (x86_64)
libXi-1.3 (i686)
make-3.81-19.el6
net-tools-1.60-110.el6_2.x86_64 (for Oracle RAC and Oracle Clusterware)
nfs-utils-1.2.3-15.0.1 (for Oracle ACFS)
sysstat-9.0.4-11.el6 (x86_64)
smartmontools-5.43-1.el6.x86_64
[root@vastdata ~]# yum install -y binutils compat-libcap1 compat-libstdc++ e2fsprogs e2fsprogs-libs glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel libXtst libX11 libXau libxcb libXi make sysstat smartmontools
  • 添加组和用户
[root@vastdata ~]# groupadd oinstall
[root@vastdata ~]# groupadd dba
[root@vastdata ~]# groupadd oper
[root@vastdata ~]# useradd -g oinstall -G dba oracle
[root@vastdata ~]# passwd oracle
  • 配置限制参数
[root@vastdata ~]# vi /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 10240
  • 配置内核参数并生效
[root@vastdata ~]# vi /etc/sysctl.conf 
kernel.shmmni = 4096
kernel.sem =250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range =9000 65500
fs.file-max = 6815744
fs.aio-max-nr=1048576

[root@vastdata ~]# sysctl -p
......
  • 创建目录并授权
[root@vastdata ~]# mkdir -p /u01/app/oracle 
[root@vastdata ~]# chown -R oracle:oinstall /u01
  • 配置oracle环境变量并验证
[oracle@vastdata ~]# vi .bash_profile
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1
export ORACLE_SID=PROD
export ORACLE_TERM=xterm
export PATH=/usr/sbin:$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

[oracle@vastdata ~]# source .bash_profile

[oracle@vastdata ~]# echo $ORACLE_HOME

end~