2实验环境:
Oracle
Linux7.6 x64 最简安装
数据库版本: Oracle 12c R2
IP 地址:192.168.6.6
Linux连接工具: xmanager 6 //也可以直接使用图形安装Linux无需工具
描述:
数据库服务名:oracledb.example.com
数据库实例名:oracledb
程序包下载:官网下载
Database安装步骤
1. 修改系统主机名,hosts文件,系统参数
2. 添加用户和组信息,创建Oracle安装目录
3. 修改用户环境变量
4. 开始安装(安装linux组件,上传Oracle程序包,并解压运行安装)
5. DBCA建库
一、完善系统信息
1.关闭防火墙并禁用防火墙:
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
2.关闭seLinux:
[root@localhost ~]# vim /etc/sysconfig/selinux
SELINUX=disabled
3.重启操作系统:
[root@localhost ~]# reboot
4.修改主机名
[root@localhost ~]# hostname
localhost.localdomain ##Oracle数据库的安装在生产中要慎重考虑主机名,避免二次修改。
[root@localhost ~]# hostnamectl set-hostname oracledb.example.com
[root@localhost ~]# hostname ##验证是否成功
5.添加hosts解析条目
[root@localhost ~]# cat << EOF >> /etc/hosts
> 192.168.6.6 oracledb.example.com oracle
> EOF
6.下列参数写入到/etc/sysctl.conf文件中
[root@localhost ~]# cat /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
# kernel.shmall和 kernel.shmmax的参数值,请按照下面的方式进行配置(RAM:操作系统的物理内存)
# kernel.shmall=kernel.shmmax/kernel.shmmni
# kernel.shmmax=RAM*80%*1024*1024*1024
kernel.shmmni = 4096
kernel.shmall = 419430
kernel.shmmax = 1717986918
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
[root@localhost ~]# /sbin/sysctl -p //执行生效
7.添加下列参数到/etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
8.添加下列条目到/etc/pam.d/login
session required pam_limits.so ##复制到session相同字段即可
二、添加用户和用户组信息
1.创建用户和组信息
[root@localhost ~]# groupdel oinstall
[root@localhost ~]# groupadd -g 2000 oinstall
[root@localhost ~]# groupadd -g 2001 dba
[root@localhost ~]# groupadd -g 2002 oper
[root@localhost ~]# useradd -g oinstall -G 2000,2001,2002 oracle
[root@localhost ~]# echo oracle | passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[root@localhost ~]# id oracle
uid=1000(oracle) gid=2000(oinstall) groups=2000(oinstall),2001(dba),2002(oper)
2.创建目录结构
[root@localhost ~]# mkdir /u01/app/oracle/product/12.2.0/dbhome_1 -p
[root@localhost ~]# chown -R oracle.oinstall /u01
[root@localhost ~]# chmod -R 775 /u01
三、开始安装
1.安装程序组件
yum install bc -y
yum install binutils-y
yum install compat-libcap -y
yum install compat-libstdc ++ -y
yum install glibc -y
yum install glibc-devel -y
yum install ksh -y
yum install libaio -y
yum install libaio-devel -y
yum install libX11 -y
yum install libXau -y
yum install libXi -y
yum install libXtst -y
yum install libXrender -y
yum install libXrender-devel -y
yum install libgcc -y
yum install libstdc ++ -y
yum install libxcb -y
yum install make -y
yum install smartmontools -y
yum install sysstat -y
yum install compat-libcap1 -y
检查安装结果:
rpm -qa bc binutils compat-libcap compat-libstdc ++ glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libXrender libXrender-devel libgcc libstdc ++ libxcb make smartmontools sysst