Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

时间:2023-03-08 22:55:44
Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

安装思路:

1.安装两台redhat7 linux系统
2.网络配置(双网卡,public,vip,private,scan)
3.存储配置(内存配置,ASM共享存储:6块5G共享盘udev,根目录留20G安装grid和oracle)
4.预安装准备:系统参数/etc/sysctl.conf修改,防火墙selinux关闭,ntpd时钟定时同步,yum源配置安装
用户组及用户、目录新建,环境变量配置,用户资源限制/etc/security/limits.conf配置,/etc/pam.d/login修改pam_limits.so)
5.安装grid(ASM挂载数据库盘)
6.安装oracle(先安装客户端,再建库)
7.修改数据库内存配置,密码不过期,开启归档,布置归档定时删除脚本,布置rman备份机制)

思维导图:

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

-----------------------------------------------------------------------------------------------------------

详细步骤:

一、系统安装

1.新建两台vbox虚拟机,挂载redhat7.3镜像源,内存2G,磁盘空间30G,配置双网卡host_only模式,6块共享盘(5G)做udev盘用于ASM存储normal。

oracle官方文档推荐

存储:
■ Physical memory (at least 1.5 gigabyte (GB) of RAM)
■ An amount of swap space equal to the amount of RAM
■ Temporary space (at least 1 GB) available in /tmp You need at least 5.5 GB of available disk space for the Grid home directory, which includes both the binary files for Oracle Clusterware and Oracle Automatic Storage Management (Oracle ASM) and their associated log files,
and at least 4 GB of available disk space for the Oracle Database home directory, or Oracle home directory. ■ Three Oracle Clusterware Registry (OCR) files, 300 MB each, or 900 MB total disk space
■ Three voting disk files, 300 MB each, or 900 MB total disk space 网络:
■ Each node must have at least two network interface cards (NIC), or network adapters.One adapter is for the public network interface and the other adapter is for the private network interface (the interconnect).
■ Public interface names must be the same for all nodes. If the public interface on one node uses the network adapter eth0, then you must configure eth0 as the public interface on all nodes. Network interface names are case-sensitive.
■ You should configure the same private interface names for all nodes as well. If eth1 is the private interface name for the first node, then eth1 should be the private interface name for your second node. Network interface names are case-sensitive.
■ The network adapter for the public interface must support TCP/IP.
■ The network adapter for the private interface must support the user datagram protocol (UDP) using high-speed network adapters and a network switch that supports TCP/IP (Gigabit Ethernet or better).
■ For the private network, the end points of all designated interconnect interfaces must be completely reachable on the network. Every node in the cluster must be able to connect to every private network interface in the cluster.
■ The host name of each node must conform to the RFC 952 standard, which permits alphanumeric characters. Host names using underscores ("_") are not allowed. IP ADDRESS:
■ A public IP address for each node
■ A virtual IP address for each node
■ Three single client access name (SCAN) addresses for the cluster

notes:安装redhat7.3镜像时,开始安装时Tab键入:netifnames=0 biosdevname=0,设置网卡配置启用eth*。

安装过程只贴出节点一,节点二同理。

二、网络配置

配置主机名:

#vi /etc/sysconfig/network

hostname=rac01
或者
#hostnamectl set-hostname rac01

配置网络:

[root@rac01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 

TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=51700213-4d5f-498c-b3b3-a6dfbdefe92b
DEVICE=eth0
ONBOOT=yes
IPADDR=192.168.56.10
NETMASK=255.255.255.0 [root@rac01 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth1 TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth1
UUID=53e81a2a-bd6a-4073-b3d7-437ff2cf33b8
DEVICE=eth1
ONBOOT=yes
IPADDR=172.0.0.1

域名解析配置:

[root@rac01 ~]# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 #Public IP
192.168.56.10 rac01
192.168.56.11 rac02 #Private IP
172.0.0.1 rac01-priv
172.0.0.2 rac02-priv #Vip IP
192.168.56.20 rac01-vip
192.168.56.21 rac02-vip #Scan IP
192.168.56.110 rac-scan

防火墙关闭:

[root@rac01 ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2020-09-27 15:26:43 CST; 8min ago
Docs: man:firewalld(1)
Main PID: 677 (firewalld)
CGroup: /system.slice/firewalld.service
└─677 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid Sep 27 15:26:42 rac01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Sep 27 15:26:43 rac01 systemd[1]: Started firewalld - dynamic firewall daemon.
[root@rac01 ~]# systemctl stop firewalld
[root@rac01 ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

Selinux关闭:

[root@rac01 ~]# vi /etc/selinux/config 

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

YUM源配置,安装相关依赖包

[root@rac01 ~]# mount /dev/cdrom /mnt/
mount: /dev/cdrom is write-protected, mounting read-only
[root@rac01 mnt]# cd /etc/yum.repos.d/
[root@rac01 yum.repos.d]# vi local.repo [local]
name=local
baseurl=file:///mnt
enabled=1
gpgcheck=0 [root@rac01 yum.repos.d]# yum clean all
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: local
Cleaning up everything
[root@rac01 yum.repos.d]# yum repolist all
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
local | 4.1 kB 00:00:00
(1/2): local/group_gz | 136 kB 00:00:00
(2/2): local/primary_db | 3.9 MB 00:00:00
repo id repo name status
local local enabled: 4,751
repolist: 4,751

安装依赖包:

[root@rac01 yum.repos.d]# yum install -y unzip* smartmontools elfutils-libelf-devel* binutils-* compat-libcap1-* gcc-* gcc-c++-* glibc-*  glibc-devel-* ksh libaio-* libaio-devel-* libgcc-* libstdc++-* libstdc++-devel-* libXi-* libXtst-* make-* sysstat-* xorg-x11*

[root@rac01 yum.repos.d]# rpm -q smartmontools elfutils-libelf-devel* binutils-* compat-libcap1-* gcc-* gcc-c++-* glibc-*  glibc-devel-* ksh libaio-* libaio-devel-* libgcc-* libstdc++-* libstdc++-devel-* libXi-* libXtst-* make-* sysstat-*
 binutils-2.25.1-22.base.el7.x86_64 compat-libcap1-1.10-7.el7.x86_64 gcc-4.8.5-11.el7.x86_64 gcc-c++-4.8.5-11.el7.x86_64 glibc-2.17-157.el7.x86_64 glibc-devel-2.17-157.el7.x86_64 ksh-20120801-26.el7.x86_64 libaio-0.3.109-13.el7.x86_64 libaio-devel-0.3.109-13.el7.x86_64 libgcc-4.8.5-11.el7.x86_64 libstdc++-4.8.5-11.el7.x86_64 libstdc++-devel-4.8.5-11.el7.x86_64 libXi-1.7.4-2.el7.x86_64 libXtst-1.2.2-2.1.el7.x86_64 make-3.82-23.el7.x86_64 sysstat-10.1.5-11.el7.x86_64

三、预安装配置

创建用户组,用户及文件安装目录,配置环境变量

[root@rac01 ~]# /usr/sbin/groupadd -g 1000 oinstall
[root@rac01 ~]# /usr/sbin/groupadd -g 1020 asmadmin
[root@rac01 ~]# /usr/sbin/groupadd -g 1021 asmdba
[root@rac01 ~]# /usr/sbin/groupadd -g 1022 asmoper
[root@rac01 ~]# /usr/sbin/groupadd -g 1031 dba
[root@rac01 ~]# /usr/sbin/groupadd -g 1032 oper
[root@rac01 ~]# /usr/sbin/useradd -u 1101 -g oinstall -G asmdba,dba,oper oracle
[root@rac01 ~]# /usr/sbin/useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,oper grid
[root@rac01 ~]# id oracle
uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1021(asmdba),1031(dba),1032(oper)
[root@rac01 ~]# id grid
uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1020(asmadmin),1021(asmdba),1022(asmoper),1032(oper)
[root@rac01 ~]# passwd oracle Changing password for user oracle. New password: oracle BAD PASSWORD: The password is shorter than 8 characters Retype new password: oracle passwd: all authentication tokens updated successfully. [root@rac01 ~]# passwd grid Changing password for user grid. New password: oracle BAD PASSWORD: The password is shorter than 8 characters Retype new password: oracle passwd: all authentication tokens updated successfully.
[root@rac01 ~]# mkdir -p /u01/app/11.2.0/grid
[root@rac01 ~]# mkdir -p /u01/app/grid
[root@rac01 ~]# chown -R oracle:oinstall /u01/app/11.2.0/grid
[root@rac01 ~]# mkdir -p /u01/app/oracle/
[root@rac01 ~]# mkdir -p /u01/app/oracle/product/11.2.0/dbhome_1
[root@rac01 ~]# chown -R oracle:oinstall /u01/
[root@rac01 ~]# chmod -R 775 /u01/

Grid环境变量配置:

[root@rac01 ~]# su - grid
[grid@rac01 ~]$ vi .bash_profile # .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/11.2.0/grid/crs
export ORACLE_SID=+ASM1
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib:.
export LD_LIBRARY_PATH
SHLIB_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/rdbms/lib32:.
export SHLIB_PATH
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin:/usr/local/bin:/usr/bin:/usr/sbin:.
export PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export CLASSPATH
umask 022
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_SRVM_REMOTESHELL=/usr/bin/ssh
export ORACLE_SRVM_REMOTECOPY=/usr/bin/scp
PS1=$LOGNAME@`hostname`:'$PWD''$ '
umask 022 [grid@rac01 ~]$ . .bash_profile

Oracle环境变量配置:

[root@rac01 ~]# su - oracle
[oracle@rac01 ~]$ vi .bash_profile # .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=orcl1
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib:.
export LD_LIBRARY_PATH
SHLIB_PATH=$ORACLE_HOME/lib32:$ORACLE_HOME/rdbms/lib32:.
export SHLIB_PATH
PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin:/usr/local/bin:/quest/bin:/usr/bin:/usr/sbin:.
export PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export CLASSPATH
umask 022
export TMP=/tmp
export TMPDIR=$TMP
PS1=$LOGNAME@`hostname`:'$PWD''$ '
export PS1 [oracle@rac01 ~]$ . .bash_profile

四、存储配置

Udev存储配置,需要先配置yum源安装相关依赖包

[root@rac01 ~]# fdisk -l /dev/sd*
Disk /dev/sdb: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdc: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdd: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sde: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdf: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdg: 5368 MB, 5368709120 bytes, 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

查看UUID:(由于是vbox新建虚拟机生成的是ATA类型的,这里不能通过UUID来绑盘,这里不用这个)

[root@rac01 yum.repos.d]# for disk in `ls /dev/sd*`
> do
> echo $disk
> /usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=$disk
> done /dev/sdb
1ATA_VBOX_HARDDISK_VB72e127b1-83206bf6
/dev/sdc
1ATA_VBOX_HARDDISK_VB6922f5ee-e8449cb9
/dev/sdd
1ATA_VBOX_HARDDISK_VB80341468-fc938e95
/dev/sde
1ATA_VBOX_HARDDISK_VB8cbccb7f-d14752bb
/dev/sdf
1ATA_VBOX_HARDDISK_VB76d67923-87ff88ee
/dev/sdg
1ATA_VBOX_HARDDISK_VB02f32a7a-39fd2463

创建脚本绑盘:(udevadm info)

[root@rac01 ~]# udevadm info /dev/sdb
P: /devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb
N: sdb
S: disk/by-id/ata-VBOX_HARDDISK_VB72e127b1-83206bf6
S: disk/by-path/pci-0000:00:0d.0-ata-2.0
E: DEVLINKS=/dev/disk/by-id/ata-VBOX_HARDDISK_VB72e127b1-83206bf6 /dev/disk/by-path/pci-0000:00:0d.0-ata-2.0
E: DEVNAME=/dev/sdb
E: DEVPATH=/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb
E: DEVTYPE=disk
E: ID_ATA=1
E: ID_ATA_FEATURE_SET_PM=1
E: ID_ATA_FEATURE_SET_PM_ENABLED=1
E: ID_ATA_SATA=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1
E: ID_ATA_WRITE_CACHE=1
E: ID_ATA_WRITE_CACHE_ENABLED=1
E: ID_BUS=ata
E: ID_MODEL=VBOX_HARDDISK
E: ID_MODEL_ENC=VBOX\x20HARDDISK\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_PATH=pci-0000:00:0d.0-ata-2.0
E: ID_PATH_TAG=pci-0000_00_0d_0-ata-2_0
E: ID_REVISION=1.0
E: ID_SERIAL=VBOX_HARDDISK_VB72e127b1-83206bf6
E: ID_SERIAL_SHORT=VB72e127b1-83206bf6
E: ID_TYPE=disk
E: MAJOR=8
E: MINOR=16
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=27528
[root@rac01 yum.repos.d]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sd?", ENV{ID_SERIAL}=="VBOX_HARDDISK_VB72e127b1-83206bf6", OWNER="grid", SYMLINK+="asm_data_1", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="VBOX_HARDDISK_VB6922f5ee-e8449cb9", OWNER="grid", SYMLINK+="asm_data_2", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="VBOX_HARDDISK_VB80341468-fc938e95", OWNER="grid", SYMLINK+="asm_data_3", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="VBOX_HARDDISK_VB8cbccb7f-d14752bb", OWNER="grid", SYMLINK+="asm_ocr_1", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="VBOX_HARDDISK_VB76d67923-87ff88ee", OWNER="grid", SYMLINK+="asm_ocr_2", GROUP="asmadmin", MODE="0660"
KERNEL=="sd?", ENV{ID_SERIAL}=="VBOX_HARDDISK_VB02f32a7a-39fd2463", OWNER="grid", SYMLINK+="asm_ocr_3", GROUP="asmadmin", MODE="0660" [root@rac01 yum.repos.d]# udevadm control --reload-rules
[root@rac01 yum.repos.d]# udevadm trigger
[root@rac01 rules.d]# ll -lrth /dev/asm_*
lrwxrwxrwx 1 root root 3 Sep 27 18:08 /dev/asm_ocr_1 -> sde
lrwxrwxrwx 1 root root 3 Sep 27 18:08 /dev/asm_ocr_2 -> sdf
lrwxrwxrwx 1 root root 3 Sep 28 14:42 /dev/asm_ocr_3 -> sdg
lrwxrwxrwx 1 root root 3 Sep 27 18:08 /dev/asm_data_3 -> sdd
lrwxrwxrwx 1 root root 3 Sep 27 18:08 /dev/asm_data_2 -> sdc
lrwxrwxrwx 1 root root 3 Sep 27 18:08 /dev/asm_data_1 -> sdb

Notes:这里有一个bug,vbox虚拟机增加的共享盘ID_BUS=ata,不是scsi,所以不能用PROGRAM生成RESULT的UUID来绑盘,需要用udevadm info /dev/sdb查看ID_SERIAL来绑盘。

五、系统参数修改

1.内核参数

[root@rac01 ~]# vi /etc/sysctl.conf
[root@rac01 ~]# sysctl -p
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
kernel.shmmni = 4096
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

2.用户资源限制

[root@rac01 ~]# vi /etc/security/limits.conf
# End of file grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
grid soft stack 10240 oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

3.添加验证模块

[root@rac01 ~]# echo "session required pam_limits.so" >>/etc/pam.d/login
[root@rac01 ~]# cat /etc/pam.d/login
#%PAM-1.0
auth [user_unknown=ignore success=ok ignore=ignore default=bad] pam_securetty.so
auth substack system-auth
auth include postlogin
account required pam_nologin.so
account include system-auth
password include system-auth
# pam_selinux.so close should be the first session rule
session required pam_selinux.so close
session required pam_loginuid.so
session optional pam_console.so
# pam_selinux.so open should only be followed by sessions to be executed in the user context
session required pam_selinux.so open
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session include system-auth
session include postlogin
-session optional pam_ck_connector.so
session required pam_limits.so

4.配置ntp时间同步

Notes:对时间要求比较严格的可以配置时间同步,通过crontab定时刷新,并且写入bios,重启生效。

05 * * * * /usr/sbin/ntpdate server_ip (ntp时间服务器ip)

/sbin/hwclock --systohc 系统时钟与硬件时钟同步

/sbin/hwclock -w 写入硬件时钟

---------------------------------------------------------------------------------------------------------------

六、Grid集群工具安装

1.上传安装文件至两台rac节点:

[root@rac01 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/rhel-root xfs 27G 1.4G 26G 6% /
devtmpfs devtmpfs 990M 0 990M 0% /dev
tmpfs tmpfs 1001M 0 1001M 0% /dev/shm
tmpfs tmpfs 1001M 8.5M 992M 1% /run
tmpfs tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
/dev/sda1 xfs 1014M 121M 894M 12% /boot
tmpfs tmpfs 201M 0 201M 0% /run/user/0
[root@rac01 ~]# mkdir /soft
[root@rac01 ~]# cd /soft/
[root@rac01 soft]# ll -lrth
total 3.5G
-rw-r--r-- 1 root root 1.1G Sep 27 19:04 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r-- 1 root root 1.3G Sep 27 19:04 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 root root 1.2G Sep 27 19:04 p13390677_112040_Linux-x86-64_3of7.zip
-rw-r--r-- 1 root root 153K Sep 27 19:23 unzip-6.0-5.el6.x86_64.rpm
[root@rac01 soft]# chown -R grid:oinstall p13390677_112040_Linux-x86-64_3of7.zip
[root@rac01 soft]# chown -R oracle:oinstall p13390677_112040_Linux-x86-64_1of7.zip
[root@rac01 soft]# chown -R oracle:oinstall p13390677_112040_Linux-x86-64_2of7.zip
[root@rac01 soft]# chown -R grid:oinstall /soft
[root@rac01 soft]# ll -lrth
total 3.5G
-rw-r--r-- 1 grid oinstall 1.1G Sep 27 19:04 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r-- 1 grid oinstall 1.3G Sep 27 19:04 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 grid oinstall 1.2G Sep 27 19:04 p13390677_112040_Linux-x86-64_3of7.zip
-rw-r--r-- 1 root root 153K Sep 27 19:23 unzip-6.0-5.el6.x86_64.rpm
[root@rac01 soft]# rpm -ivh unzip-6.0-5.el6.x86_64.rpm
warning: unzip-6.0-5.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:unzip-6.0-5.el6 ################################# [100%]

安装cvu Package: cvuqdisk-1.0.9-1

[root@rac01 ~]# cd /soft/grid/rpm/
[root@rac01 rpm]# ls
cvuqdisk-1.0.9-1.rpm
[root@rac01 rpm]# rpm -ivh cvuqdisk-1.0.9-1.rpm
Preparing... ################################# [100%]
Using default group oinstall to install package
Updating / installing...
1:cvuqdisk-1.0.9-1 ################################# [100%]

2.打开一个新窗口ssh grid@192.168.56.10有登录到grid用户,解压 p13390677_112040_Linux-x86-64_3of7.zip

grid@rac01:/soft$ ll -lrth
total 3.5G
-rw-r--r-- 1 grid oinstall 1.1G Sep 27 19:04 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r-- 1 grid oinstall 1.3G Sep 27 19:04 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 grid oinstall 1.2G Sep 27 19:04 p13390677_112040_Linux-x86-64_3of7.zip
-rw-r--r-- 1 root root 153K Sep 27 19:23 unzip-6.0-5.el6.x86_64.rpm
grid@rac01:/soft$ unzip -q p13390677_112040_Linux-x86-64_3of7.zip
grid@rac01:/soft$ ll -lrth
total 3.5G
drwxr-xr-x 7 grid oinstall 156 Aug 27 2013 grid
-rw-r--r-- 1 grid oinstall 1.1G Sep 27 19:04 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r-- 1 grid oinstall 1.3G Sep 27 19:04 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 grid oinstall 1.2G Sep 27 19:04 p13390677_112040_Linux-x86-64_3of7.zip
-rw-r--r-- 1 root root 153K Sep 27 19:23 unzip-6.0-5.el6.x86_64.rpm

3.使用CVU工具执行先决条件检查(对等性检查failed忽略)

grid@rac01:/soft/grid$ ./runcluvfy.sh stage -pre crsinst -n rac01,rac02 -r 11gR2 -verbose

Performing pre-checks for cluster services setup 

Checking node reachability...

Check: Node reachability from node "rac01"
Destination Node Reachable?
------------------------------------ ------------------------
rac02 yes
rac01 yes
Result: Node reachability check passed from node "rac01" Checking user equivalence... Check: User equivalence for user "grid"
Node Name Status
------------------------------------ ------------------------
rac02 failed
rac01 failed
Result: PRVF-4007 : User equivalence check failed for user "grid" ERROR:
User equivalence unavailable on all the specified nodes
Verification cannot proceed Pre-check for cluster services setup was unsuccessful on all the nodes.

4.开始安装GRID,先节点一,再节点二

grid@rac01:/home/grid$ cd /soft/grid/
grid@rac01:/soft/grid$ ls
install readme.html response rpm runcluvfy.sh runInstaller sshsetup stage welcome.html
grid@rac01:/soft/grid$ ./runInstaller
Starting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 19330 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2047 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-09-27_08-05-01PM. Please wait ...grid@rac01:/soft/grid$

Notes:这里安装前会检查DISPLAY,由于没有安装Xhost命令,会报错Could not execute auto check for display colors using command /usr/bin/xdpyinfo,需要yum install -y xorg-*。

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

修改rac01对应virtual hostname为rac01_vip

点击Add进行节点2添加,pubile hostname为rac02, virtual hostname为rac02_vip

完成后输入grid密码(两端grid密码一致),完成后点击setup

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

设置HAIP

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

选择集群注册表,裁决盘

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

密码统一使用oracle

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

安装前环境Check

1、缺少swap空间,增加1G swap空间

[root@rac01 ~]# dd if=/dev/zero of=/swapfile bs=1G count=1
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 1.97023 s, 545 MB/s
[root@rac01 ~]# mkswap /swapfile
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=890fa64a-d252-4b1f-9645-4d7e7c7c7c38
[root@rac01 ~]# swapon /swapfile
swapon: /swapfile: insecure permissions 0644, 0600 suggested.
[root@rac01 ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Sun Sep 27 14:59:03 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=376a5bfa-0139-4ef1-bc03-bc8b859c73ed /boot xfs defaults 0 0
/dev/mapper/rhel-swap swap swap defaults 0 0
/swapfile swap swap default 0 0 [root@rac01 ~]# mount -a

2、Device Checks for ASM

asm盘warning确认可用,忽略

3、缺少包,下载rpm包来安装

Package: compat-libstdc++-33-3.2.3 (x86_64) WARNING No

Package: pdksh-5.2.14 WARNING No

[root@rac01 rpm]# rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
warning: compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:compat-libstdc++-33-3.2.3-72.el7 ################################# [100%]
[root@rac01 rpm]# rpm -ivh pdksh-5.2.14-37.el5.x86_64.rpm
warning: pdksh-5.2.14-37.el5.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID e8562897: NOKEY
error: Failed dependencies:
pdksh conflicts with (installed) ksh-20120801-26.el7.x86_64
[root@rac01 rpm]# rpm -e ksh-20120801-26.el7.x86_64
[root@rac01 rpm]# rpm -ivh pdksh-5.2.14-37.el5.x86_64.rpm
warning: pdksh-5.2.14-37.el5.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID e8562897: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:pdksh-5.2.14-37.el5 ################################# [100%]

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

节点一,节点二逐个在root 用户下执行两个脚本:

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

grid@rac01:/u01/app/11.2.0/grid/crs/install$ ls
chainedInstall config jlib modmakedeps.pl readme.txt usm
cluster.ini envVars.properties make.log portlist.ini root_rac01_2020-09-28_15-50-23.log utl
grid@rac01:/u01/app/11.2.0/grid/crs/install$ cat root_rac01_2020-09-28_15-50-23.log
Performing root user operation for Oracle 11g The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2.0/grid/crs Enter the full pathname of the local bin directory: [/usr/local/bin]: Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ... Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0/grid/crs/crs/install/crsconfig_params
Creating trace directory
User ignored Prerequisites during installation
Installing Trace File Analyzer
OLR initialization - successful
root wallet
root wallet cert
root cert export
peer wallet
profile reader wallet
pa wallet
peer wallet keys
pa wallet keys
peer cert request
pa cert request
peer cert
pa cert
peer root cert TP
profile reader root cert TP
pa root cert TP
peer pa cert TP
pa peer cert TP
profile reader pa cert TP
profile reader peer cert TP
peer user cert
pa user cert
Adding Clusterware entries to inittab
ohasd failed to start
Failed to start the Clusterware. Last 20 lines of the alert log follow:
2020-09-28 15:52:16.858:
[client(6705)]CRS-2101:The OLR was formatted using version 3.

RHEL7安装11.2RAC时root.sh错误ohasd failed to start:

https://www.cnblogs.com/syksky/p/10222787.html

以下处理步骤:

grid@rac01:/u01/app/11.2.0/grid/crs$ ./deinstall/deinstall
Notes:deinstall内容省略
grid@rac01:/soft$ unzip -q p18370031_112040_Linux-x86-64.zip
grid@rac01:/soft$ ll -lrth
total 3.7G
drwxr-xr-x 7 grid oinstall 156 Aug 27 2013 grid
-rw-r--r-- 1 grid oinstall 267 Aug 16 2014 bundle.xml
-rw-r--r-- 1 grid oinstall 50K Aug 16 2014 README.txt
-rw-r--r-- 1 grid oinstall 90K Aug 16 2014 README.html
drwxr-xr-x 5 grid oinstall 44 Aug 16 2014 18370031
-rw-r--r-- 1 grid oinstall 1.1G Sep 27 19:04 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r-- 1 grid oinstall 1.3G Sep 27 19:04 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 grid oinstall 1.2G Sep 27 19:04 p13390677_112040_Linux-x86-64_3of7.zip
-rw-r--r-- 1 root root 153K Sep 27 19:23 unzip-6.0-5.el6.x86_64.rpm
-rw-r--r-- 1 grid oinstall 167M Sep 28 16:44 p18370031_112040_Linux-x86-64.zip
grid@rac01:/soft$ cp 18370031/ $ORACLE_HOME -r
grid@rac01:/soft$ cd $ORACLE_HOME
grid@rac01:/u01/app/11.2.0/grid/crs$ ls
18370031 clone dbs evm instantclient jlib md OPatch oui racg scheduler sysman
assistants crs dc_ocm gpnp inventory JRE mesg opmn owm rdbms slax usm
bin csmig deinstall has javavm ldap network oracore perl relnotes sqlplus utl
cdata css demo hs jdbc lib nls oraInst.loc plsql root.sh srvm wwg
cfgtoollogs cv diagnostics install jdk log oc4j ord precomp rootupgrade.sh suptools xdk
grid@rac01:/u01/app/11.2.0/grid/crs$ OPatch/opatch lsinventory -detail -oh $ORACLE_HOME
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/11.2.0/grid/crs
Central Inventory : /u01/app/oraInventory
from : /u01/app/11.2.0/grid/crs/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid/crs/cfgtoollogs/opatch/opatch2020-09-28_16-55-36PM_1.log Lsinventory Output file location : /u01/app/11.2.0/grid/crs/cfgtoollogs/opatch/lsinv/lsinventory2020-09-28_16-55-36PM.txt --------------------------------------------------------------------------------
Installed Top-level Products (1): Oracle Grid Infrastructure 11g 11.2.0.4.0
There are 1 products installed in this Oracle Home. Installed Products (89): Agent Required Support Files 10.2.0.4.5
Assistant Common Files 11.2.0.4.0
Automatic Storage Management Assistant 11.2.0.4.0
Bali Share 1.1.18.0.0
Buildtools Common Files 11.2.0.4.0
Character Set Migration Utility 11.2.0.4.0
Cluster Ready Services Files 11.2.0.4.0
Cluster Verification Utility Common Files 11.2.0.4.0
Cluster Verification Utility Files 11.2.0.4.0
Database SQL Scripts 11.2.0.4.0
Deinstallation Tool 11.2.0.4.0
Enterprise Manager Common Core Files 10.2.0.4.5
Enterprise Manager Common Files 10.2.0.4.5
Enterprise Manager plugin Common Files 11.2.0.4.0
Expat libraries 2.0.1.0.1
HAS Common Files 11.2.0.4.0
HAS Files for DB 11.2.0.4.0
Installation Common Files 11.2.0.4.0
Installation Plugin Files 11.2.0.4.0
Installer SDK Component 11.2.0.4.0
Java Development Kit 1.5.0.51.10
LDAP Required Support Files 11.2.0.4.0
OLAP SQL Scripts 11.2.0.4.0
Oracle Advanced Security 11.2.0.4.0
Oracle Clusterware RDBMS Files 11.2.0.4.0
Oracle Configuration Manager Deconfiguration 10.3.1.0.0
Oracle Containers for Java 11.2.0.4.0
Oracle Core Required Support Files 11.2.0.4.0
Oracle Database 11g 11.2.0.4.0
Oracle Database 11g Multimedia Files 11.2.0.4.0
Oracle Database Deconfiguration 11.2.0.4.0
Oracle Database User Interface 2.2.13.0.0
Oracle Database Utilities 11.2.0.4.0
Oracle DBCA Deconfiguration 11.2.0.4.0
Oracle Extended Windowing Toolkit 3.4.47.0.0
Oracle Globalization Support 11.2.0.4.0
Oracle Globalization Support 11.2.0.4.0
Oracle Grid Infrastructure 11g 11.2.0.4.0
Oracle Help For Java 4.2.9.0.0
Oracle Ice Browser 5.2.3.6.0
Oracle Internet Directory Client 11.2.0.4.0
Oracle Java Client 11.2.0.4.0
Oracle JDBC/OCI Instant Client 11.2.0.4.0
Oracle JDBC/THIN Interfaces 11.2.0.4.0
Oracle JFC Extended Windowing Toolkit 4.2.36.0.0
Oracle JVM 11.2.0.4.0
Oracle LDAP administration 11.2.0.4.0
Oracle Locale Builder 11.2.0.4.0
Oracle Multimedia 11.2.0.4.0
Oracle Multimedia Client Option 11.2.0.4.0
Oracle Multimedia Java Advanced Imaging 11.2.0.4.0
Oracle Multimedia Locator 11.2.0.4.0
Oracle Multimedia Locator RDBMS Files 11.2.0.4.0
Oracle Net 11.2.0.4.0
Oracle Net Listener 11.2.0.4.0
Oracle Net Required Support Files 11.2.0.4.0
Oracle Netca Client 11.2.0.4.0
Oracle Notification Service 11.2.0.3.0
Oracle Notification Service (eONS) 11.2.0.4.0
Oracle One-Off Patch Installer 11.2.0.3.4
Oracle Quality of Service Management (Client) 11.2.0.4.0
Oracle Quality of Service Management (Server) 11.2.0.4.0
Oracle RAC Deconfiguration 11.2.0.4.0
Oracle RAC Required Support Files-HAS 11.2.0.4.0
Oracle Recovery Manager 11.2.0.4.0
Oracle Security Developer Tools 11.2.0.4.0
Oracle Text Required Support Files 11.2.0.4.0
Oracle Universal Installer 11.2.0.4.0
Oracle USM Deconfiguration 11.2.0.4.0
Oracle Wallet Manager 11.2.0.4.0
Parser Generator Required Support Files 11.2.0.4.0
Perl Interpreter 5.10.0.0.2
Perl Modules 5.10.0.0.1
PL/SQL 11.2.0.4.0
PL/SQL Embedded Gateway 11.2.0.4.0
Platform Required Support Files 11.2.0.4.0
Precompiler Required Support Files 11.2.0.4.0
RDBMS Required Support Files 11.2.0.4.0
RDBMS Required Support Files for Instant Client 11.2.0.4.0
RDBMS Required Support Files Runtime 11.2.0.4.0
Required Support Files 11.2.0.4.0
Secure Socket Layer 11.2.0.4.0
SQL*Plus 11.2.0.4.0
SQL*Plus Files for Instant Client 11.2.0.4.0
SQL*Plus Required Support Files 11.2.0.4.0
SSL Required Support Files for InstantClient 11.2.0.4.0
Universal Storage Manager Files 11.2.0.4.0
XDK Required Support Files 11.2.0.4.0
XML Parser for Java 11.2.0.4.0
There are 89 products installed in this Oracle Home. There are no Interim patches installed in this Oracle Home. Rac system comprising of multiple nodes
Local node = rac01
Remote node = rac02 -------------------------------------------------------------------------------- OPatch succeeded. grid@rac01:/u01/app/11.2.0/grid/crs$ OPatch/opatch apply -oh $ORACLE_HOME -local $ORACLE_HOME/18370031
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/11.2.0/grid/crs
Central Inventory : /u01/app/oraInventory
from : /u01/app/11.2.0/grid/crs/oraInst.loc
OPatch version : 11.2.0.3.4
OUI version : 11.2.0.4.0
Log file location : /u01/app/11.2.0/grid/crs/cfgtoollogs/opatch/opatch2020-09-28_16-58-22PM_1.log Applying interim patch '18370031' to OH '/u01/app/11.2.0/grid/crs'
Verifying environment and performing prerequisite checks...
All checks passed. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/u01/app/11.2.0/grid/crs') Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files... Patching component oracle.crs, 11.2.0.4.0... Verifying the update...
Patch 18370031 successfully applied
Log file location: /u01/app/11.2.0/grid/crs/cfgtoollogs/opatch/opatch2020-09-28_16-58-22PM_1.log OPatch succeeded.

Notes:节点二也要打patch补丁,都打完补丁之后执行/u01/app/11.2.0/grid/crs/root.sh。

[root@rac01 soft]# /u01/app/11.2.0/grid/crs/root.sh
Performing root user operation for Oracle 11g The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/11.2.0/grid/crs Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite. Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /u01/app/11.2.0/grid/crs/crs/install/crsconfig_params
Creating trace directory
Installing Trace File Analyzer
OLR initialization - successful
root wallet
root wallet cert
root cert export
peer wallet
profile reader wallet
pa wallet
peer wallet keys
pa wallet keys
peer cert request
pa cert request
peer cert
pa cert
peer root cert TP
profile reader root cert TP
pa root cert TP
peer pa cert TP
pa peer cert TP
profile reader pa cert TP
profile reader peer cert TP
peer user cert
pa user cert
Adding Clusterware entries to oracle-ohasd.service
CRS-2672: Attempting to start 'ora.mdnsd' on 'rac01'
CRS-2676: Start of 'ora.mdnsd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac01'
CRS-2676: Start of 'ora.gpnpd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac01'
CRS-2672: Attempting to start 'ora.gipcd' on 'rac01'
CRS-2676: Start of 'ora.cssdmonitor' on 'rac01' succeeded
CRS-2676: Start of 'ora.gipcd' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'rac01'
CRS-2672: Attempting to start 'ora.diskmon' on 'rac01'
CRS-2676: Start of 'ora.diskmon' on 'rac01' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac01' succeeded ASM created and started successfully. Disk Group OCR created successfully. clscfg: -install mode specified
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4256: Updating the profile
Successful addition of voting disk a68b411144fb4f8abf82ebbff780d302.
Successful addition of voting disk 92a51eaefb214f5ebfaa2045c2f401f1.
Successful addition of voting disk 988e7939b4b34f4dbf27cb090a813641.
Successfully replaced voting disk group with +OCR.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE a68b411144fb4f8abf82ebbff780d302 (/dev/asm_ocr_1) [OCR]
2. ONLINE 92a51eaefb214f5ebfaa2045c2f401f1 (/dev/asm_ocr_3) [OCR]
3. ONLINE 988e7939b4b34f4dbf27cb090a813641 (/dev/asm_ocr_2) [OCR]
Located 3 voting disk(s).
sh: /bin/netstat: No such file or directory
CRS-2672: Attempting to start 'ora.asm' on 'rac01'
CRS-2676: Start of 'ora.asm' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.OCR.dg' on 'rac01'
CRS-2676: Start of 'ora.OCR.dg' on 'rac01' succeeded
Configure Oracle Grid Infrastructure for a Cluster ... succeeded

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

[root@rac01 mnt]# cat /u01/app/oraInventory/logs/installActions2020-09-28_04-33-29PM.log
INFO: ERROR:
INFO: PRVG-1101 : SCAN name "rac-scan" failed to resolve
INFO: ERROR:
INFO: PRVF-4657 : Name resolution setup check for "rac-scan" (IP address: 192.168.56.110) failed
INFO: ERROR:
INFO: PRVF-4664 : Found inconsistent name resolution entries for SCAN name "rac-scan"
INFO: Verification of SCAN VIP and Listener setup failed

Notes:DNS问题忽略,GRID安装完成。

grid@rac01:/soft/grid$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....ER.lsnr ora....er.type ONLINE ONLINE rac01
ora....N1.lsnr ora....er.type ONLINE ONLINE rac01
ora.OCR.dg ora....up.type ONLINE ONLINE rac01
ora.asm ora.asm.type ONLINE ONLINE rac01
ora.cvu ora.cvu.type ONLINE ONLINE rac01
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE rac01
ora.oc4j ora.oc4j.type ONLINE ONLINE rac01
ora.ons ora.ons.type ONLINE ONLINE rac01
ora....SM1.asm application ONLINE ONLINE rac01
ora....01.lsnr application ONLINE ONLINE rac01
ora.rac01.gsd application OFFLINE OFFLINE
ora.rac01.ons application ONLINE ONLINE rac01
ora.rac01.vip ora....t1.type ONLINE ONLINE rac01
ora....SM2.asm application ONLINE ONLINE rac02
ora....02.lsnr application ONLINE ONLINE rac02
ora.rac02.gsd application OFFLINE OFFLINE
ora.rac02.ons application ONLINE ONLINE rac02
ora.rac02.vip ora....t1.type ONLINE ONLINE rac02
ora.scan1.vip ora....ip.type ONLINE ONLINE rac01

查看asm磁盘空间裁决盘:

grid@rac01:/home/grid$ asmcmd -p
ASMCMD [+] > lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 15360 14434 5120 4657 0 Y OCR/

添加asm的DATA数据文件盘:

ssh grid@192.168.56.10
grid@rac01:/home/grid$ asmca

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

点击create创建DATA盘:

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

检查ASM磁盘空间:

grid@rac01:/home/grid$ asmcmd -p
ASMCMD [+] > lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 15360 15075 5120 4977 0 N DATA/
MOUNTED NORMAL N 512 4096 1048576 15360 14434 5120 4657 0 Y OCR/

七、安装Oracle数据库

解压oracle安装文件

[root@rac01 ~]# chown -R oracle:oinstall /soft
[root@rac01 ~]# su - oracle
Last login: Mon Sep 28 18:34:47 CST 2020 on pts/0
oracle@rac01:/home/oracle$ cd /soft
oracle@rac01:/soft$ ll -lrt
total 3835324
drwxr-xr-x 7 oracle oinstall 156 Aug 27 2013 grid
-rw-r--r-- 1 oracle oinstall 267 Aug 16 2014 bundle.xml
-rw-r--r-- 1 oracle oinstall 50396 Aug 16 2014 README.txt
-rw-r--r-- 1 oracle oinstall 91340 Aug 16 2014 README.html
drwxr-xr-x 5 oracle oinstall 44 Aug 16 2014 18370031
-rw-r--r-- 1 oracle oinstall 1151304589 Sep 27 19:04 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r-- 1 oracle oinstall 1395582860 Sep 27 19:04 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 oracle oinstall 1205251894 Sep 27 19:04 p13390677_112040_Linux-x86-64_3of7.zip
-rw-r--r-- 1 oracle oinstall 156092 Sep 27 19:23 unzip-6.0-5.el6.x86_64.rpm
-rw-r--r-- 1 oracle oinstall 174911877 Sep 28 16:44 p18370031_112040_Linux-x86-64.zip
oracle@rac01:/soft$ unzip -q p13390677_112040_Linux-x86-64_1of7.zip
oracle@rac01:/soft$ unzip -q p13390677_112040_Linux-x86-64_2of7.zip
oracle@rac01:/soft$ ll -lrth
total 3.7G
drwxr-xr-x 7 oracle oinstall 156 Aug 27 2013 grid
drwxr-xr-x 7 oracle oinstall 136 Aug 27 2013 database
-rw-r--r-- 1 oracle oinstall 267 Aug 16 2014 bundle.xml
-rw-r--r-- 1 oracle oinstall 50K Aug 16 2014 README.txt
-rw-r--r-- 1 oracle oinstall 90K Aug 16 2014 README.html
drwxr-xr-x 5 oracle oinstall 44 Aug 16 2014 18370031
-rw-r--r-- 1 oracle oinstall 1.1G Sep 27 19:04 p13390677_112040_Linux-x86-64_2of7.zip
-rw-r--r-- 1 oracle oinstall 1.3G Sep 27 19:04 p13390677_112040_Linux-x86-64_1of7.zip
-rw-r--r-- 1 oracle oinstall 1.2G Sep 27 19:04 p13390677_112040_Linux-x86-64_3of7.zip
-rw-r--r-- 1 oracle oinstall 153K Sep 27 19:23 unzip-6.0-5.el6.x86_64.rpm
-rw-r--r-- 1 oracle oinstall 167M Sep 28 16:44 p18370031_112040_Linux-x86-64.zip

新开一个ssh窗口,启动安装程序,安装oracle软件:

ssh oracle@192.168.56.10
oracle@rac01:/home/oracle$ cd /soft/database/
oracle@rac01:/soft/database$ ls
install readme.html response rpm runInstaller sshsetup stage welcome.html
oracle@rac01:/soft/database$ ./runInstaller
Starting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 9364 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3046 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-09-28_06-39-01PM. Please wait ...oracle@rac01:/soft/database$

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

SSH互信,输入oracle密码,setup

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

SCAN的DNS问题,已配置,可忽略。

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Bug:Error in invoking target 'agent nmhs' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk'.

Oracle 11.2.0.4 database software installation on OL7/RHEL7 fails with the following error

两种解决方案:

1.修改ins_emagent.mk

oracle@rac01:/soft$ vi $ORACLE_HOME/sysman/lib/ins_emagent.mk
#===========================
# emdctl
#=========================== $(SYSMANBIN)emdctl:
$(MK_EMAGENT_NMECTL) -lnnz11

2.打bug补丁包 patch 19692824

Patch Installation Steps:
-------------------------
1. Shutdown DBCONSOLE using the following command. Leave EM Repository database and its listener running.
% $ORACLE_HOME/bin/emctl stop dbconsole 2. Set your current directory to the directory where the patch is located:
% cd <PATCH_TOP>/19692824 Ensure that the directory containing the opatch script appears in
your $PATH; then enter the following command: % opatch apply 3. Please run <ORACLE_HOME>/root.sh as a user with root privileges. 4. Start DBCONSOLE using the following command.
% $ORACLE_HOME/bin/emctl start dbconsole

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

逐个在节点一和节点二执行root.sh脚本

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

[root@rac01 ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/dbhome_1 Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite. Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@rac01 ~]# cat /etc/oratab
#Backup file is /u01/app/11.2.0/grid/crs/srvm/admin/oratab.bak.rac01 line added by Agent
# # This file is used by ORACLE utilities. It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance. # A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME:<N|Y>:
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
+ASM1:/u01/app/11.2.0/grid/crs:N # line added by Agent

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

Oracle软件安装成功。

oracle@rac01:/soft/database$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Sep 28 19:30:33 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> 

Notes:这里如果要升级数据库到最新补丁版本,可以Opatch打补丁

八、DBCA建库

oracle@rac01:/home/oracle$ dbca

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

关闭EM工具和自动化工具

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

统一使用oracle作为密码

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

关闭快速恢复区

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

开启内存自动分配SGA,process为1500,字符集为UTF8

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

可以保存创建模板和scripts脚本

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

安装报错:ORA-00838,ORA-01078

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

解决步骤:

[root@rac01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 27G 23G 5.0G 82% /
devtmpfs 990M 0 990M 0% /dev
tmpfs 1001M 118M 883M 12% /dev/shm
tmpfs 1001M 8.5M 992M 1% /run
tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
/dev/sda1 1014M 121M 894M 12% /boot
tmpfs 201M 0 201M 0% /run/user/0
/dev/sr0 3.6G 3.6G 0 100% /mnt
tmpfs 201M 0 201M 0% /run/user/1101
[root@rac01 ~]# mount -t tmpfs shmfs -o size=2g /dev/shm
[root@rac01 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 27G 23G 5.0G 82% /
devtmpfs 990M 0 990M 0% /dev
shmfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 1001M 8.5M 992M 1% /run
tmpfs 1001M 0 1001M 0% /sys/fs/cgroup
/dev/sda1 1014M 121M 894M 12% /boot
tmpfs 201M 0 201M 0% /run/user/0
/dev/sr0 3.6G 3.6G 0 100% /mnt
tmpfs 201M 0 201M 0% /run/user/1101
[root@rac02 ~]# vi /etc/fstab #
# /etc/fstab
# Created by anaconda on Sun Sep 27 15:30:17 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/rhel-root / xfs defaults 0 0
UUID=e1e64ba5-a6d1-4f4b-835e-7b93e92b76f1 /boot xfs defaults 0 0
/dev/mapper/rhel-swap swap swap defaults 0 0
/swapfile swap swap default 0 0
tmpfs /dev/shm tmpfs defaults,size=2048M 0 0

[root@rac02 ~]# mount -a

Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册Oracle 11G RAC11.2.0.4 + Redhat7.3安装手册

检查集群状态

grid@rac02:/home/grid$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac01
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac01
ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac01
ora.OCR.dg ora....up.type 0/5 0/ ONLINE ONLINE rac01
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac01
ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac01
ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac01
ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE rac01
ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac01
ora.orcl.db ora....se.type 0/2 0/1 ONLINE ONLINE rac01
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac01
ora....01.lsnr application 0/5 0/0 ONLINE ONLINE rac01
ora.rac01.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac01.ons application 0/3 0/0 ONLINE ONLINE rac01
ora.rac01.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac01
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac02
ora....02.lsnr application 0/5 0/0 ONLINE ONLINE rac02
ora.rac02.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac02.ons application 0/3 0/0 ONLINE ONLINE rac02
ora.rac02.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac02
ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac01
grid@rac02:/home/grid$ asmcmd -p
ASMCMD [+] > lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 15360 9690 5120 2285 0 N DATA/
MOUNTED NORMAL N 512 4096 1048576 15360 14431 5120 4655 0 Y OCR/

检查数据库运行状态

oracle@rac01:/home/oracle$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 29 01:13:13 2020

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options SQL> select instance_number,instance_name,startup_time,status from gv$Instance; INSTANCE_NUMBER INSTANCE_NAME STARTUP_TIME STATUS
--------------- ---------------- ------------------ ------------
1 orcl1 29-SEP-20 OPEN
2 orcl2 29-SEP-20 OPEN

检查监听运行情况

grid@rac02:/home/grid$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 29-SEP-2020 01:15:11

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 29-SEP-2020 00:15:55
Uptime 0 days 0 hr. 59 min. 15 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/crs/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/rac02/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.11)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.21)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl2", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl2", status READY, has 1 handler(s) for this service...
The command completed successfully