Centos 7安装Oracle12c RAC

1.服务器配置

[[email protected] ~]# df -h

Filesystem               Size  Used Avail Use% Mounted on

/dev/mapper/centos-root   20G  1.7G   19G   9% /

devtmpfs                 1.5G     0  1.5G   0% /dev

tmpfs                    1.5G     0  1.5G   0% /dev/shm

tmpfs                    1.5G  9.5M  1.5G   1% /run

tmpfs                    1.5G     0  1.5G   0% /sys/fs/cgroup

/dev/sda1                397M  121M  277M  31% /boot

/dev/mapper/centos-tmp   5.0G   33M  5.0G   1% /tmp

/dev/mapper/centos-home   10G   33M   10G   1% /home

/dev/mapper/centos-u01    61G   33M   61G   1% /u01

tmpfs                    299M     0  299M   0% /run/user/0

[[email protected] ~]# free -h

              total        used        free      shared  buff/cache   available

Mem:           2.9G        178M        2.3G        9.4M        487M        2.5G

Swap:          4.0G          0B        4.0G

[[email protected] ~]# ifconfig

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.157.137  netmask 255.255.255.0  broadcast 192.168.157.255

        inet6 fe80::9be3:4f6f:e9d5:f61f  prefixlen 64  scopeid 0x20<link>

        ether 00:0c:29:c3:19:be  txqueuelen 1000  (Ethernet)

        RX packets 37857  bytes 53794846 (51.3 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 7050  bytes 485521 (474.1 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 10.10.10.129  netmask 255.255.255.0  broadcast 10.10.10.255

        inet6 fe80::a2e3:aa14:94c6:af5d  prefixlen 64  scopeid 0x20<link>

        ether 00:0c:29:c3:19:c8  txqueuelen 1000  (Ethernet)

        RX packets 19  bytes 1732 (1.6 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 18  bytes 1352 (1.3 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        inet6 ::1  prefixlen 128  scopeid 0x10<host>

        loop  txqueuelen 1000  (Local Loopback)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

[[email protected] ~]# df -h

Filesystem               Size  Used Avail Use% Mounted on

/dev/mapper/centos-root   20G  1.8G   19G   9% /

devtmpfs                 1.5G     0  1.5G   0% /dev

tmpfs                    1.5G     0  1.5G   0% /dev/shm

tmpfs                    1.5G  9.5M  1.5G   1% /run

tmpfs                    1.5G     0  1.5G   0% /sys/fs/cgroup

/dev/sda1                397M  121M  277M  31% /boot

/dev/mapper/centos-u01    61G   33M   61G   1% /u01

/dev/mapper/centos-tmp   5.0G   33M  5.0G   1% /tmp

/dev/mapper/centos-home   10G   33M   10G   1% /home

tmpfs                    299M     0  299M   0% /run/user/0

[[email protected] ~]# free -h

              total        used        free      shared  buff/cache   available

Mem:           2.9G        174M        2.3G        9.4M        458M        2.6G

Swap:          4.0G          0B        4.0G

[[email protected] ~]# ifconfig

ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.157.138  netmask 255.255.255.0  broadcast 192.168.157.255

        inet6 fe80::c74:76cb:6393:e10e  prefixlen 64  scopeid 0x20<link>

        ether 00:0c:29:3f:38:c6  txqueuelen 1000  (Ethernet)

        RX packets 29789  bytes 42933104 (40.9 MiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 4190  bytes 305947 (298.7 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

ens34: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 10.10.10.130  netmask 255.255.255.0  broadcast 10.10.10.255

        inet6 fe80::7832:2a05:85a6:b9b4  prefixlen 64  scopeid 0x20<link>

        ether 00:0c:29:3f:38:d0  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 18  bytes 1352 (1.3 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        inet6 ::1  prefixlen 128  scopeid 0x10<host>

        loop  txqueuelen 1000  (Local Loopback)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

2.IP地址规划(两个节点的/etc/hosts文件都要配置)

# public ip

192.168.157.137 oracle01

192.168.157.138 oracle02

 

# Private IP

10.10.10.129 oracle01-priv

10.10.10.130 oracle02-priv

 

# Virtual IP

192.168.157.237 oracle01-vip

192.168.157.238 oracle02-vip

 

# Scan IP

192.168.157.139 oracle-cluster

 

[[email protected] ~]# ping -c 4 oracle02
PING oracle02 (192.168.157.138) 56(84) bytes of data.
64 bytes from oracle02 (192.168.157.138): icmp_seq=1 ttl=64 time=0.300 ms
64 bytes from oracle02 (192.168.157.138): icmp_seq=2 ttl=64 time=0.431 ms
64 bytes from oracle02 (192.168.157.138): icmp_seq=3 ttl=64 time=0.384 ms
64 bytes from oracle02 (192.168.157.138): icmp_seq=4 ttl=64 time=1.81 ms

--- oracle02 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev =
0.300/0.733/1.817/0.627 ms
[[email protected] ~]
# ping -c 4 oracle02-priv
PING oracle02-priv (10.10.10.130) 56(84) bytes of data.
64 bytes from oracle02-priv (10.10.10.130): icmp_seq=1 ttl=64 time=0.190 ms
64 bytes from oracle02-priv (10.10.10.130): icmp_seq=2 ttl=64 time=0.249 ms
64 bytes from oracle02-priv (10.10.10.130): icmp_seq=3 ttl=64 time=0.261 ms
64 bytes from oracle02-priv (10.10.10.130): icmp_seq=4 ttl=64 time=0.204 ms

--- oracle02-priv ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev =
0.190/0.226/0.261/0.029 ms

 

===================================================================================

 

[[email protected] ~]# ping -c 4 oracle01
PING oracle01 (192.168.157.137) 56(84) bytes of data.
64 bytes from oracle01 (192.168.157.137): icmp_seq=1 ttl=64 time=2.06 ms
64 bytes from oracle01 (192.168.157.137): icmp_seq=2 ttl=64 time=0.592 ms
64 bytes from oracle01 (192.168.157.137): icmp_seq=3 ttl=64 time=1.07 ms
64 bytes from oracle01 (192.168.157.137): icmp_seq=4 ttl=64 time=1.25 ms

--- oracle01 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev =
0.592/1.248/2.067/0.532 ms
[[email protected] ~]
# ping -c 4 oracle01-priv
PING oracle01-priv (10.10.10.129) 56(84) bytes of data.
64 bytes from oracle01-priv (10.10.10.129): icmp_seq=1 ttl=64 time=0.327 ms
64 bytes from oracle01-priv (10.10.10.129): icmp_seq=2 ttl=64 time=0.236 ms
64 bytes from oracle01-priv (10.10.10.129): icmp_seq=3 ttl=64 time=0.229 ms
64 bytes from oracle01-priv (10.10.10.129): icmp_seq=4 ttl=64 time=0.194 ms

--- oracle01-priv ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev =
0.194/0.246/0.327/0.051 ms

3.安装依赖包

yum install binutilscompat-libcap1 compat-libstdc++-33 compat-libstdc++-33.i686 gcc gcc-c++ glibc glibc.i686 glibc-develglibc-devel.i686 ksh libgcc libgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel libstdc++-devel.i686 libaiolibaio.i686 libaio-devel libaio-devel.i686 libXext libXext.i686 libXtst libXtst.i686 libX11libX11.i686 libXau libXau.i686 libxcb libxcb.i686 libXi libXi.i686 make sysstat unixODBCunixODBC-devel readline libtermcap-devel pdksh -y

4.关闭selinux和配置防火墙

[[email protected] ~]# vi /etc/selinux/config
[[email protected] ~]# cat /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 values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

 

===================================================================================

 

[[email protected] ~]# vi /etc/selinux/config
[[email protected] ~]# cat /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 values:
#???? targeted - Targeted processes are protected,
#???? minimum - Modification of targeted policy. Only selected processes are protected.
#???? mls - Multi Level Security protection.
SELINUXTYPE=targeted

 

[[email protected] ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri
2020-01-03 14:01:12 CST; 1h 58min ago
     Docs: man:firewalld(
1)
 Main PID:
6429 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─
6429 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Jan 03 14:01:09 oracle01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Jan
03 14:01:12 oracle01 systemd[1]: Started firewalld - dynamic firewall daemon.
[[email protected] ~]
# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[[email protected] ~]
# systemctl stop firewalld.service
[[email protected] ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(
1)

Jan 03 14:01:09 oracle01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Jan
03 14:01:12 oracle01 systemd[1]: Started firewalld - dynamic firewall daemon.
Jan
03 16:00:08 oracle01 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Jan
03 16:00:09 oracle01 systemd[1]: Stopped firewalld - dynamic firewall daemon.
[[email protected] ~]
# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri
2020-01-03 14:01:12 CST; 1h 58min ago
     Docs: man:firewalld(
1)
 Main PID:
6429 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─
6429 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Jan 03 14:01:09 oracle01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Jan
03 14:01:12 oracle01 systemd[1]: Started firewalld - dynamic firewall daemon.
[[email protected] ~]
# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[[email protected] ~]
# systemctl stop firewalld.service
[[email protected] ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(
1)

Jan 03 14:01:09 oracle01 systemd[1]: Starting firewalld - dynamic firewall daemon...
Jan
03 14:01:12 oracle01 systemd[1]: Started firewalld - dynamic firewall daemon.
Jan
03 16:00:08 oracle01 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Jan
03 16:00:09 oracle01 systemd[1]: Stopped firewalld - dynamic firewall daemon.

 

===========================================================================================

 

[[email protected] ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
?? Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
?? Active: active (running) since Fri
2020-01-03 14:01:18 CST; 1h 32min ago
???? Docs: man:firewalld(
1)
Main PID:
6442 (firewalld)
?? CGroup: /system.slice/firewalld.service
?????????? └─
6442 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

Jan 03 14:01:16 oracle02 systemd[1]: Starting firewalld - dynamic firewall daemon...
Jan
03 14:01:18 oracle02 systemd[1]: Started firewalld - dynamic firewall daemon.
[[email protected] ~]
# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[[email protected] ~]
# systemctl stop firewalld.service
[[email protected] ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
?? Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
?? Active: inactive (dead)
???? Docs: man:firewalld(
1)

Jan 03 14:01:16 oracle02 systemd[1]: Starting firewalld - dynamic firewall daemon...
Jan
03 14:01:18 oracle02 systemd[1]: Started firewalld - dynamic firewall daemon.
Jan
03 15:34:11 oracle02 systemd[1]: Stopping firewalld - dynamic firewall daemon...
Jan
03 15:34:11 oracle02 systemd[1]: Stopped firewalld - dynamic firewall daemon.

5.添加组和用户(两个节点)

groupadd -g 60001 oinstall
groupadd -g
60002 dba
groupadd -g
60003 oper
groupadd -g
60004 backupdba
groupadd -g
60005 dgdba
groupadd -g
60006 kmdba
groupadd -g
60007 asmdba
groupadd -g
60008 asmoper
groupadd -g
60009 asmadmin
useradd -u
61001 -g oinstall -G asmadmin,asmdba,dba,asmoper grid
useradd -u
61002 -g oinstall -G dba,backupdba,dgdba,kmdba,asmadmin,oper,asmdba oracle
echo "grid" | passwd --stdin grid
echo "oracle" | passwd --stdin oracle

 

[[email protected] ~]# groupadd -g 60001 oinstall
[[email protected] ~]# groupadd -g 60002 dba
[[email protected] ~]# groupadd -g 60003 oper
[[email protected] ~]# groupadd -g 60004 backupdba
[[email protected] ~]# groupadd -g 60005 dgdba
[[email protected] ~]# groupadd -g 60006 kmdba
[[email protected] ~]# groupadd -g 60007 asmdba
[[email protected] ~]# groupadd -g 60008 asmoper
[[email protected] ~]# groupadd -g 60009 asmadmin
[[email protected] ~]# useradd -u 61001 -g oinstall -G asmadmin,asmdba,dba,asmoper grid
[[email protected] ~]# useradd -u 61002 -g oinstall -G dba,backupdba,dgdba,kmdba,asmadmin,oper,asmdba oracle
[[email protected] ~]# echo "grid" | passwd --stdin grid
Changing password for user grid.
passwd: all authentication tokens updated successfully.
[[email protected] ~]
# echo "oracle" | passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[[email protected] ~]
# id oracle
uid=61002(oracle) gid=60001(oinstall) groups=60001(oinstall),60002(dba),60003(oper),60004(backupdba),60005(dgdba),60006(kmdba),60007(asmdba),60009(asmadmin)
[[email protected] ~]
# id grid
uid=61001(grid) gid=60001(oinstall) groups=60001(oinstall),60002(dba),60007(asmdba),60008(asmoper),60009(asmadmin)

 

=============================================================================================================

 

[[email protected] ~]# groupadd -g 60001 oinstall
[[email protected] ~]# groupadd -g 60002 dba
[[email protected] ~]# groupadd -g 60003 oper
[[email protected] ~]# groupadd -g 60004 backupdba
[[email protected] ~]# groupadd -g 60005 dgdba
[[email protected] ~]# groupadd -g 60006 kmdba
[[email protected] ~]# groupadd -g 60007 asmdba
[[email protected] ~]# groupadd -g 60008 asmoper
[[email protected] ~]# groupadd -g 60009 asmadmin
[[email protected] ~]# useradd -u 61001 -g oinstall -G asmadmin,asmdba,dba,asmoper grid
[[email protected] ~]# useradd -u 61002 -g oinstall -G dba,backupdba,dgdba,kmdba,asmadmin,oper,asmdba oracle
[[email protected] ~]# echo "grid" | passwd --stdin grid
Changing password for user grid.
passwd: all authentication tokens updated successfully.
[[email protected] ~]
# echo "oracle" | passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[[email protected] ~]
#
[[email protected] ~]# id oracle
uid=61002(oracle) gid=60001(oinstall) groups=60001(oinstall),60002(dba),60003(oper),60004(backupdba),60005(dgdba),60006(kmdba),60007(asmdba),60009(asmadmin)
[[email protected] ~]
#
[[email protected] ~]# id grid
uid=61001(grid) gid=60001(oinstall) groups=60001(oinstall),60002(dba),60007(asmdba),60008(asmoper),60009(asmadmin)

6.添加目录(两个节点都要加)

mkdir -p /u01/app/grid
mkdir -p /u01/app/
12.2.0/grid
chown -R grid:oinstall /u01/app
mkdir -p /u01/app/oraInventory
chown -R grid:oinstall /u01/app/oraInventory
mkdir -p /u01/app/oracle
chown -R oracle:oinstall /u01/app/oracle

chmod -R 775 /u01/app/oracle

7.修改操作系统参数(两个节点都要加)

vi /etc/security/limits.conf

grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

grid soft stack 10240

grid hard stack 32768

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft stack 10240

oracle hard stack 32768

 

cat /etc/security/limits.d/20-nproc.conf

#*          soft    nproc     4096

root       soft    nproc     unlimited

*          soft    nproc     16384

 

vi /etc/pam.d/login

 

session required pam_limits.so

 

MEMTOTAL=$(free -b | sed -n '2p' | awk '{print $2}')
SHMMAX=$(
expr $MEMTOTAL \*4 / 5)
SHMMNI=
4096
SHMALL=$(expr $MEMTOTAL /4\*1024)

 

[[email protected] ~]# MEMTOTAL=$(free -b | sed -n '2p' | awk '{print $2}')

[[email protected] ~]# echo SHMMAX=$(expr $MEMTOTAL*4/5)

SHMMAX=3133755392*4/5

[[email protected] ~]# echo SHMALL=$(expr $MEMTOTAL/4*1024)

SHMALL=3133755392/4*1024

[[email protected] ~]# vi /etc/sys

sysconfig/          sysctl.conf         sysctl.conf.bak     sysctl.d/           systemd/            system-release      system-release-cpe

[[email protected] ~]# vi /etc/sysc

sysconfig/       sysctl.conf      sysctl.conf.bak  sysctl.d/

[[email protected] ~]# vi /etc/sysctl.conf

[[email protected] ~]#

[[email protected] ~]# cat /etc/sysctl.conf

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmmax = 2507004313

kernel.shmall = 12241232

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

kernel.panic_on_oops = 1

 

[[email protected] ~]# sysctl -p

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmmax = 2507004313

kernel.shmall = 12241232

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

kernel.panic_on_oops = 1

 

# kernel.shmmax 大于共享内存区,小于物理内存

# kernel.shmall 物理内存/4K

 

8. 配置用户变量

 

节点一:

[[email protected]:/home/grid]$cat .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 PS1="[`whoami`@`hostname`:"'$PWD]$'

umask 022

export TMP=/tmp

export LANG=en_US

export TMPDIR=$TMP

export ORACLE_HOSTNAME=oracle01

export ORACLE_SID=+ASM1

export ORACLE_TERM=xterm

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/12.2.0/grid

export NLS_DATE_FORMAT="yyyy-mm-ddHH24:MI:SS"

export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin

export THREADS_FLAG=native

if [ $USER = 'oracle' ] || [ $USER = 'grid' ]; then

        if [ $SHELL = "/bin/ksh" ];then

                ulimit -p 16384

                ulimit -n 65536

        else

                ulimit -u 16384 -n 65536

        fi

                umask 022

fi

[[email protected]:/home/grid]$source .bash_profile

 

[[email protected] ~]# su - oracle

[[email protected] ~]$ vi .bash_profile

[[email protected] ~]$ source .bash_profile

[[email protected]:/home/oracle]$cat .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 PS1="[`whoami`@`hostname`:"'$PWD]$'

umask 022

export TMP=/tmp

export LANG=en_US

export TMPDIR=$TMP

export ORACLE_HOSTNAME=oracle01

export ORACLE_UNQNAME=rac

export ORACLE_SID=rac01

export ORACLE_TERM=xterm

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1

export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin

export THREADS_FLAG=native

if [ $USER = 'oracle' ] || [ $USER = 'grid' ]; then

        if [ $SHELL = "/bin/ksh" ];then

                ulimit -p 16384

                ulimit -n 65536

        else

                ulimit -u 16384 -n 65536

        fi

                umask 022

fi

 

节点二:

[[email protected] ~]# su - grid

[[email protected] ~]$ vi .bash_profile

[[email protected] ~]$ cat .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 PS1="[`whoami`@`hostname`:"'$PWD]$'

umask 022

export TMP=/tmp

export LANG=en_US

export TMPDIR=$TMP

export ORACLE_HOSTNAME=oracle02

export ORACLE_SID=+ASM2

export ORACLE_TERM=xterm;export ORACLE_TERM

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/12.2.0/grid

export NLS_DATE_FORMAT="yyyy-mm-ddHH24:MI:SS"

export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin

export THREADS_FLAG=native

if [ $USER = 'oracle' ] || [ $USER = 'grid' ]; then

        if [ $SHELL = "/bin/ksh" ];then

                ulimit -p 16384

                ulimit -n 65536

        else

                ulimit -u 16384 -n 65536

        fi

                umask 022

fi

 

[[email protected] ~]$ source .bash_profile

 

[[email protected] ~]# su - oracle

[[email protected] ~]$ vi .bash_profile

[[email protected] ~]$ cat .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 PS1="[`whoami`@`hostname`:"'$PWD]$'

umask 022

export TMP=/tmp

export LANG=en_US

export TMPDIR=$TMP

export ORACLE_HOSTNAME=oracle02

export ORACLE_UNQNAME=rac

export ORACLE_SID=rac02

export ORACLE_TERM=xterm

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1

export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin

export THREADS_FLAG=native

if [ $USER = 'oracle' ] || [ $USER = 'grid' ]; then

        if [ $SHELL = "/bin/ksh" ];then

                ulimit -p 16384

                ulimit -n 65536

        else

                ulimit -u 16384 -n 65536

        fi

                umask 022

fi

 

[[email protected] ~]$ source .bash_profile

 

9.配置SSH无密码登陆(两节点)

 

节点1:

 

[[email protected] ~]# su - grid

Last login: Sat Jan  4 12:37:40 CST 2020 on pts/0

[[email protected]:/home/grid]$ssh

ssh          ssh-add      ssh-agent    ssh-copy-id  sshd         sshd-******  ssh-******   ssh-keyscan

[[email protected]:/home/grid]$ssh-******

Generating public/private rsa key pair.

Enter file in which to save the key (/home/grid/.ssh/id_rsa):

Created directory '/home/grid/.ssh'.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/grid/.ssh/id_rsa.

Your public key has been saved in /home/grid/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:7ieUDFT+LZ+ZUReTPnG9Oqae07YeULYoTONGe9zS8Vw [email protected]

The key's randomart image is:

+---[RSA 2048]----+

|       ..      oo|

|      ..       o=|

|     .  .+   +o E|

|      . =.+.*.==.|

|       oSBo*o+.o.|

|       .= oooO   |

|       ..   O..  |

|       .. .o.o.  |

|        .o.o+o.  |

+----[SHA256]-----+

[[email protected]:/home/grid]$ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/grid/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

Are you sure you want to continue connecting (yes/no)? yes

/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]192.168.157.138's password:

Permission denied, please try again.

[email protected]'s password:

 

Number of key(s) added: 1

 

Now try logging into the machine, with:   "ssh '[email protected]'"

and check to make sure that only the key(s) you wanted were added.

 

[[email protected]:/home/grid]$ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]192.168.157.137

/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/grid/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

Are you sure you want to continue connecting (yes/no)? yes

/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]'s password:

 

Number of key(s) added: 1

 

Now try logging into the machine, with:   "ssh '[email protected]'"

and check to make sure that only the key(s) you wanted were added.

 

[[email protected]:/home/grid]$exit

logout

[[email protected] ~]# su - oracle

Last login: Sat Jan  4 12:46:13 CST 2020 on pts/0

[[email protected]:/home/oracle]$ssh-******

Generating public/private rsa key pair.

Enter file in which to save the key (/home/oracle/.ssh/id_rsa):

Created directory '/home/oracle/.ssh'.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/oracle/.ssh/id_rsa.

Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:+jSLEAkSRHqrkvUR5YVg4noCKRQL9yOEUXTCfUfo4rk [email protected]

The key's randomart image is:

+---[RSA 2048]----+

|*@O.+..+o        |

|=*o*.o+..        |

|*.= +o..         |

|o+ +.+.          |

|o +.+o  S        |

| * .oo .         |

|+   o.. o        |

|.   E. + o       |

|      . o        |

+----[SHA256]-----+

[[email protected]:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

Are you sure you want to continue connecting (yes/no)? yes

/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]192.168.157.138's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]192.168.157.138'"

and check to make sure that only the key(s) you wanted were added.

[[email protected]:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

Are you sure you want to continue connecting (yes/no)? yes

/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]192.168.157.137's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]192.168.157.137'"

and check to make sure that only the key(s) you wanted were added.

 

[[email protected] ~]# ssh-******

Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /root/.ssh/id_rsa.

Your public key has been saved in /root/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:abP1A7fcXyhDMX2dN0e5TZ1bj0SoV1axfJvJjKZEaCw [email protected]

The key's randomart image is:

+---[RSA 2048]----+

|             o.oB|

|        . . ..=+B|

|       E + oo+.B%|

|        o.o [email protected]|

|        S oooo * |

|       . +.*oo . |

|        .  .B o .|

|             + ..|

|                .|

+----[SHA256]-----+

[[email protected] ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]'s password:

 

Number of key(s) added: 1

 

Now try logging into the machine, with:   "ssh '[email protected]'"

and check to make sure that only the key(s) you wanted were added.

 

[[email protected] ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

Are you sure you want to continue connecting (yes/no)? yes

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]'s password:

 

Number of key(s) added: 1

 

Now try logging into the machine, with:   "ssh '[email protected]'"

and check to make sure that only the key(s) you wanted were added.

 

节点2:

 

[[email protected] ~]# su - grid

Last login: Sat Jan  4 12:49:13 CST 2020 on pts/0

[[email protected]:/home/grid]$

[[email protected]:/home/grid]$ssh-******

Generating public/private rsa key pair.

Enter file in which to save the key (/home/grid/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/grid/.ssh/id_rsa.

Your public key has been saved in /home/grid/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:vPazYJaAmjXlpedX8AJj4WYTMtNvGMJKaLk7xA7yPrA [email protected]

The key's randomart image is:

+---[RSA 2048]----+

|   o .+.o        |

|  + . o=oo       |

| o o ...X+.      |

|o + .+ B.+oo     |

|.= .+ + S.. o    |

|. =+ . + o o     |

| +o.    O .      |

|E o    + +.      |

|   .      oo     |

+----[SHA256]-----+

[[email protected]:/home/grid]$ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/grid/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

Are you sure you want to continue connecting (yes/no)? yes

/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]192.168.157.137's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]192.168.157.137'"

and check to make sure that only the key(s) you wanted were added.

[[email protected]:/home/grid]$ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/grid/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

Are you sure you want to continue connecting (yes/no)? yes

/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]192.168.157.138's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]192.168.157.138'"

and check to make sure that only the key(s) you wanted were added.

[[email protected]:/home/grid]$

[[email protected]:/home/grid]$exit

logout

[[email protected] ~]# su - oracle

Last login: Sat Jan  4 12:51:01 CST 2020 on pts/0

[[email protected]:/home/oracle]$ssh-******

Generating public/private rsa key pair.

Enter file in which to save the key (/home/oracle/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/oracle/.ssh/id_rsa.

Your public key has been saved in /home/oracle/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:9AOgZtzCmbOs4Za1k4oVsL46EkxpgxOgfyERWlgEn2E [email protected]

The key's randomart image is:

+---[RSA 2048]----+

|+=E.  .          |

|+= * = .         |

|=.= % . o        |

|oO = = . o       |

|=.= =   S o      |

|oo B o     .     |

| o* +            |

|o+.. .           |

|=o.              |

+----[SHA256]-----+

[[email protected]:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]192.168.157.137

/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

Are you sure you want to continue connecting (yes/no)? yes

/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]'s password:

Permission denied, please try again.

[email protected]192.168.157.137's password:

Permission denied, please try again.

[email protected]'s password:

[[email protected]:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]192.168.157.137

/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]192.168.157.137's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]192.168.157.137'"

and check to make sure that only the key(s) you wanted were added.

[[email protected]:/home/oracle]$ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/oracle/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

Are you sure you want to continue connecting (yes/no)? yes

/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]192.168.157.138's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]192.168.157.138'"

and check to make sure that only the key(s) you wanted were added.

 

[[email protected] ~]# ssh-******

Generating public/private rsa key pair.

Enter file in which to save the key (/root/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /root/.ssh/id_rsa.

Your public key has been saved in /root/.ssh/id_rsa.pub.

The key fingerprint is:

SHA256:+2GbnG/KaCrnOlXLMhiDg8DYqe1kkc/xYfjtCojpZns [email protected]

The key's randomart image is:

+---[RSA 2048]----+

|o. o .           |

|o.= o o          |

|.+ = = o         |

|o * = o o        |

| * o + +S.       |

|o o o + +.       |

|.    o +. o      |

| + Eo o .* =.    |

|o.o .*oo. O+.    |

+----[SHA256]-----+

[[email protected] ~]#

[[email protected] ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.137 (192.168.157.137)' can't be established.

ECDSA key fingerprint is SHA256:l1t05f8Yvogx3vZicVSkMNIdPiboJ7drwTnVblKLS/c.

ECDSA key fingerprint is MD5:c0:38:7b:96:8f:14:3d:80:7b:2d:24:2d:3b:ca:c1:84.

Are you sure you want to continue connecting (yes/no)? yes

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]192.168.157.137's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]192.168.157.137'"

and check to make sure that only the key(s) you wanted were added.

[[email protected] ~]# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"

The authenticity of host '192.168.157.138 (192.168.157.138)' can't be established.

ECDSA key fingerprint is SHA256:bhmrFpJcz+l4Mb9RdwoWxROsSI4brh+VEws/G5vSREA.

ECDSA key fingerprint is MD5:3b:5f:17:42:44:11:68:6a:70:cf:e5:28:3e:8f:fb:b0.

Are you sure you want to continue connecting (yes/no)? yes

/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed

/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

[email protected]192.168.157.138's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]192.168.157.138'"

and check to make sure that only the key(s) you wanted were added.

 

10.共享存储

 

10.1 创建共享存储

 

该步骤可以用cmd命令也可以用图形界面,本文采用命令行进行添加。

在cmd 中进入 WMware Workstation安装目录,执行命令创建磁盘:

 

D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 6GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\ocr.vmdk"

Creating disk 'D:\Virtual Machines\rac12c-sharedisk\ocr.vmdk'

  Create: 100% done.

Virtual disk creation successful.

 

D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 10GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\fra.vmdk"

Creating disk 'D:\Virtual Machines\rac12c-sharedisk\fra.vmdk'

  Create: 100% done.

Virtual disk creation successful.

 

D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 10GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\data.vmdk"

Creating disk 'D:\Virtual Machines\rac12c-sharedisk\data.vmdk'

  Create: 100% done.

Virtual disk creation successful.

 

D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 10GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\mgmt.vmdk"

Creating disk 'D:\Virtual Machines\rac12c-sharedisk\mgmt.vmdk'

  Create: 100% done.

Virtual disk creation successful.

 

D:\Program Files (x86)\VMware\VMware Workstation>vmware-vdiskmanager.exe -c -s 10GB -a lsilogic -t 2 "D:\Virtual Machines\rac12c-sharedisk\arch.vmdk"

Creating disk 'D:\Virtual Machines\rac12c-sharedisk\arch.vmdk'

  Create: 100% done.

Virtual disk creation successful

 Centos 7安装Oracle12c RAC

 

注意:12c R1OCR磁盘组最少需要5501MB的空间。

[INS-30515] Insufficient space available in the selected disks.

Cause - Insufficient space available in the selected Disks. At least, 5,501 MB of free space is required. 

Action - Choose additional disks such that the total size should be at least 5,501 MB.

 

10.2 修改配置文件

 

关闭两台虚拟机,用记事本打开 虚拟机名字.vmx,即打开配置文件,2个节点都需要修改。

 

添加以下内容,其中,scsix:y 表示第x个总线上的第y个设备

 

#shared disks configure

disk.EnableUUID="TRUE"
disk.locking = "FALSE"
scsi1.shared = "TRUE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize= "4096"
diskLib.maxUnsyncedWrites = "0"

scsi1.present = "TRUE"
scsi1.virtualDev = "scsi"
scsil.sharedBus = "VIRTUAL"

scsi1:0.present = "TRUE"
scsi1:0.mode = "independent-persistent"
scsi1:0.fileName = "D:\Virtual Machines\rac12c-sharedisk\ocr.vmdk"
scsi1:0.deviceType = "disk"
scsi1:0.redo = ""

scsi1:1.present = "TRUE"
scsi1:1.mode = "independent-persistent"
scsi1:1.fileName = "D:\Virtual Machines\rac12c-sharedisk\data.vmdk"
scsi1:1.deviceType = "disk"
scsi1:1.redo = ""

scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.fileName = "D:\Virtual Machines\rac12c-sharedisk\fra.vmdk"
scsi1:2.deviceType = "disk"
scsi1:2.redo = ""

scsi1:3.present = "TRUE"
scsi1:3.mode = "independent-persistent"
scsi1:3.fileName = "D:\Virtual Machines\rac12c-sharedisk\arch.vmdk"
scsi1:3.deviceType = "disk"
scsi1:3.redo = ""

scsi1:4.present = "TRUE"
scsi1:4.mode = "independent-persistent"
scsi1:4.fileName = "D:\Virtual Machines\rac12c-sharedisk\mgmt.vmdk"
scsi1:4.deviceType = "disk"
scsi1:4.redo = ""

 

10.3 重新打开VMware

 

关闭 VMware Workstation 软件重新打开,此时看到共享磁盘正确加载则配置正确,这里尤其注意第二个节点,2个节点的硬盘配置和网络适配器的配置应该是一样的,若不一样请检查配置。

Centos 7安装Oracle12c RAC

之后重启虚拟机

 

[[email protected] ~]# fdisk -l | grep /dev/sd

Disk /dev/sdb: 6442 MB, 6442450944 bytes, 12582912 sectors

Disk /dev/sdc: 10.7 GB, 10737418240 bytes, 20971520 sectors

Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors

/dev/sda1   *        2048      821247      409600   83  Linux

/dev/sda2          821248   209715199   104446976   8e  Linux LVM

Disk /dev/sde: 10.7 GB, 10737418240 bytes, 20971520 sectors

Disk /dev/sdd: 10.7 GB, 10737418240 bytes, 20971520 sectors

Disk /dev/sdf: 10.7 GB, 10737418240 bytes, 20971520 sectors

[[email protected] ~]# fdisk -l | grep  "Disk /dev/sd"

Disk /dev/sdb: 6442 MB, 6442450944 bytes, 12582912 sectors

Disk /dev/sdc: 10.7 GB, 10737418240 bytes, 20971520 sectors

Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors

Disk /dev/sde: 10.7 GB, 10737418240 bytes, 20971520 sectors

Disk /dev/sdd: 10.7 GB, 10737418240 bytes, 20971520 sectors

Disk /dev/sdf: 10.7 GB, 10737418240 bytes, 20971520 sectors

 

 

11.设置共享存储

 

检查UUID,两个节点的UUID必须一致:

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sdb

36000c290a8f5dd6c3150d2e49bde5183

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sdc

36000c296c1e9562d242fd56571092a91

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sdd

36000c292da65f477ffc932927cb35c08

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sde

36000c29b3a17f0629d504249a7508d24

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sdf

36000c29b15d777ab379b1b882f9be1be

 

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sdb

36000c290a8f5dd6c3150d2e49bde5183

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sdc

36000c296c1e9562d242fd56571092a91

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sdd

36000c292da65f477ffc932927cb35c08

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sde

36000c29b3a17f0629d504249a7508d24

[[email protected] ~]# /usr/lib/udev/scsi_id -g -u /dev/sdf

36000c29b15d777ab379b1b882f9be1be

 

创建磁盘组(udev)

 

新增的每个磁盘都要用fdisk处理一下(只执行一个节点,另外一个节点会同步),

[[email protected] ~]# fdisk /dev/sdg

Welcome to fdisk (util-linux 2.23.2).

 

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

 

Device does not contain a recognized partition table

Building a new DOS disklabel with disk identifier 0xd89e766a.

 

Command (m for help): n

Partition type:

   p   primary (0 primary, 0 extended, 4 free)

   e   extended

Select (default p):

Using default response p

Partition number (1-4, default 1):

First sector (2048-104857599, default 2048):

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599):

Using default value 104857599

Partition 1 of type Linux and of size 50 GiB is set

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

 

 

[[email protected] rules.d]# pwd
/etc/udev/rules.d
[[email protected] rules.d]
# cat 99-oracle-asmdevics.rules

KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c290a8f5dd6c3150d2e49bde5183", RUN+="/bin/sh -c 'mknod /dev/asmdisk_ocr b $major $minor; chown grid:asmadmin /dev/asmdisk_ocr; chmod 0660 /dev/asmdisk_ocr'"

KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c296c1e9562d242fd56571092a91", RUN+="/bin/sh -c 'mknod /dev/asmdisk_data01 b $major $minor; chown grid:asmadmin /dev/asmdisk_data01; chmod 0660 /dev/asmdisk_data01'"

KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c292da65f477ffc932927cb35c08", RUN+="/bin/sh -c 'mknod /dev/asmdisk_fra b $major $minor; chown grid:asmadmin /dev/asmdisk_fra; chmod 0660 /dev/asmdisk_fra'"

KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29b3a17f0629d504249a7508d24", RUN+="/bin/sh -c 'mknod /dev/asmdisk_arch b $major $minor; chown grid:asmadmin /dev/asmdisk_arch; chmod 0660 /dev/asmdisk_arch'"

KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29b15d777ab379b1b882f9be1be", RUN+="/bin/sh -c 'mknod /dev/asmdisk_data02 b $major $minor; chown grid:asmadmin /dev/asmdisk_data02; chmod 0660 /dev/asmdisk_data02'"

KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c2975c24408268b1acee46816143", RUN+="/bin/sh -c 'mknod /dev/asmdisk_mgmt b $major $minor; chown grid:asmadmin /dev/asmdisk_mgmt; chmod 0660 /dev/asmdisk_mgmt'"

[[email protected] ~]# /sbin/udevadm control --reload-rules
[[email protected] ~]# /sbin/udevadm trigger --type=devices --action=change
[[email protected] rules.d]# ll /dev/asm*

brw-rw---- 1 grid asmadmin 8, 64 Jan  7 09:59 /dev/asmdisk_arch

brw-rw---- 1 grid asmadmin 8, 32 Jan  7 09:59 /dev/asmdisk_data

brw-rw---- 1 grid asmadmin 8, 32 Jan  7 10:04 /dev/asmdisk_data01

brw-rw---- 1 grid asmadmin 8, 80 Jan  7 10:04 /dev/asmdisk_data02

brw-rw---- 1 grid asmadmin 8, 48 Jan  7 09:59 /dev/asmdisk_fra

brw-rw---- 1 grid asmadmin 8, 80 Jan  7 09:59 /dev/asmdisk_mgmt

brw-rw---- 1 grid asmadmin 8, 16 Jan  7 09:59 /dev/asmdisk_ocr

 

[[email protected] rules.d]# scp 99-oracle-asmdevics.rules [email protected]:/etc/udev/rules.d/

99-oracle-asmdevics.rules

[[email protected] ~]# /sbin/udevadm control --reload-rules

[[email protected] ~]# /sbin/udevadm trigger --type=devices --action=change

[[email protected] ~]# ll /dev/asm*

brw-rw---- 1 grid asmadmin 8, 64 Jan  7 10:06 /dev/asmdisk_arch

brw-rw---- 1 grid asmadmin 8, 32 Jan  7 10:06 /dev/asmdisk_data01

brw-rw---- 1 grid asmadmin 8, 80 Jan  7 10:06 /dev/asmdisk_data02

brw-rw---- 1 grid asmadmin 8, 48 Jan  7 10:06 /dev/asmdisk_fra

brw-rw---- 1 grid asmadmin 8, 96 Jan  7 10:06 /dev/asmdisk_mgmt

brw-rw---- 1 grid asmadmin 8, 16 Jan  7 10:06 /dev/asmdisk_ocr

12.安装图形界面

[[email protected] ~]# yum install tigervnc-server

[[email protected] ~]# yum install xdpyinfo

[[email protected] ~]# vncserver

You will require a password to access your desktops.

 

Password:

Verify:

Passwords don't match - try again

Password:

Verify:

Would you like to enter a view-only password (y/n)? y

Password:

Verify:

xauth:  file /root/.Xauthority does not exist

New 'oracle01:1 (root)' desktop is oracle01:1

Creating default startup script /root/.vnc/xstartup

Creating default config /root/.vnc/config

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/oracle01:1.log

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RACCentos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

这里怎么选择看Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC节点一执行:

[[email protected] oraInventory]# /u01/app/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

 

Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

[[email protected] oraInventory]# /u01/app/grid-install/root.sh

Performing root user operation.

 

The following environment variables are set as:

    ORACLE_OWNER= grid

    ORACLE_HOME=  /u01/app/grid-install

 

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.

Relinking oracle with rac_on option

Using configuration parameter file: /u01/app/grid-install/crs/install/crsconfig_params

The log of current session can be found at:

  /u01/app/grid/crsdata/oracle01/crsconfig/rootcrs_oracle01_2020-01-07_11-35-46AM.log

2020/01/07 11:35:55 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.

2020/01/07 11:35:55 CLSRSC-4001: Installing Oracle Trace File Analyzer (TFA) Collector.

2020/01/07 11:36:32 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.

2020/01/07 11:36:32 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.

2020/01/07 11:36:37 CLSRSC-363: User ignored prerequisites during installation

2020/01/07 11:36:37 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.

2020/01/07 11:36:39 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.

2020/01/07 11:36:40 CLSRSC-594: Executing installation step 5 of 19: 'SaveParamFile'.

2020/01/07 11:36:45 CLSRSC-594: Executing installation step 6 of 19: 'SetupOSD'.

2020/01/07 11:36:45 CLSRSC-594: Executing installation step 7 of 19: 'CheckCRSConfig'.

2020/01/07 11:36:46 CLSRSC-594: Executing installation step 8 of 19: 'SetupLocalGPNP'.

2020/01/07 11:37:02 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.

2020/01/07 11:37:09 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.

2020/01/07 11:37:10 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.

2020/01/07 11:37:14 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.

2020/01/07 11:37:29 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'

2020/01/07 11:37:47 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.

2020/01/07 11:37:50 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oracle01'

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oracle01' has completed

CRS-4133: Oracle High Availability Services has been stopped.

CRS-4123: Oracle High Availability Services has been started.

2020/01/07 11:38:10 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.

2020/01/07 11:38:13 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oracle01'

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oracle01' has completed

CRS-4133: Oracle High Availability Services has been stopped.

CRS-4123: Oracle High Availability Services has been started.

CRS-2672: Attempting to start 'ora.evmd' on 'oracle01'

CRS-2672: Attempting to start 'ora.mdnsd' on 'oracle01'

CRS-2676: Start of 'ora.evmd' on 'oracle01' succeeded

CRS-2676: Start of 'ora.mdnsd' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.gpnpd' on 'oracle01'

CRS-2676: Start of 'ora.gpnpd' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.cssdmonitor' on 'oracle01'

CRS-2672: Attempting to start 'ora.gipcd' on 'oracle01'

CRS-2676: Start of 'ora.cssdmonitor' on 'oracle01' succeeded

CRS-2676: Start of 'ora.gipcd' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.cssd' on 'oracle01'

CRS-2672: Attempting to start 'ora.diskmon' on 'oracle01'

CRS-2676: Start of 'ora.diskmon' on 'oracle01' succeeded

CRS-2676: Start of 'ora.cssd' on 'oracle01' succeeded

 

Disk groups created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-200107AM113848.log for details.

 

 

2020/01/07 11:39:35 CLSRSC-482: Running command: '/u01/app/grid-install/bin/ocrconfig -upgrade grid oinstall'

CRS-2672: Attempting to start 'ora.crf' on 'oracle01'

CRS-2672: Attempting to start 'ora.storage' on 'oracle01'

CRS-2676: Start of 'ora.storage' on 'oracle01' succeeded

CRS-2676: Start of 'ora.crf' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.crsd' on 'oracle01'

CRS-2676: Start of 'ora.crsd' on 'oracle01' succeeded

CRS-4256: Updating the profile

Successful addition of voting disk 7a64cdb48bd54f88bf71a5b57c227462.

Successfully replaced voting disk group with +DATA.

CRS-4256: Updating the profile

CRS-4266: Voting file(s) successfully replaced

##  STATE    File Universal Id                File Name Disk group

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

1. ONLINE   7a64cdb48bd54f88bf71a5b57c227462 (/dev/asmdisk_data01) [DATA]

Located 1 voting disk(s).

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oracle01'

CRS-2673: Attempting to stop 'ora.crsd' on 'oracle01'

CRS-2677: Stop of 'ora.crsd' on 'oracle01' succeeded

CRS-2673: Attempting to stop 'ora.storage' on 'oracle01'

CRS-2673: Attempting to stop 'ora.crf' on 'oracle01'

CRS-2673: Attempting to stop 'ora.gpnpd' on 'oracle01'

CRS-2673: Attempting to stop 'ora.mdnsd' on 'oracle01'

CRS-2677: Stop of 'ora.crf' on 'oracle01' succeeded

CRS-2677: Stop of 'ora.gpnpd' on 'oracle01' succeeded

CRS-2677: Stop of 'ora.storage' on 'oracle01' succeeded

CRS-2673: Attempting to stop 'ora.asm' on 'oracle01'

CRS-2677: Stop of 'ora.mdnsd' on 'oracle01' succeeded

CRS-2677: Stop of 'ora.asm' on 'oracle01' succeeded

CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'oracle01'

CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'oracle01' succeeded

CRS-2673: Attempting to stop 'ora.ctssd' on 'oracle01'

CRS-2673: Attempting to stop 'ora.evmd' on 'oracle01'

CRS-2677: Stop of 'ora.evmd' on 'oracle01' succeeded

CRS-2677: Stop of 'ora.ctssd' on 'oracle01' succeeded

CRS-2673: Attempting to stop 'ora.cssd' on 'oracle01'

CRS-2677: Stop of 'ora.cssd' on 'oracle01' succeeded

CRS-2673: Attempting to stop 'ora.gipcd' on 'oracle01'

CRS-2677: Stop of 'ora.gipcd' on 'oracle01' succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oracle01' has completed

CRS-4133: Oracle High Availability Services has been stopped.

2020/01/07 11:40:24 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.

CRS-4123: Starting Oracle High Availability Services-managed resources

CRS-2672: Attempting to start 'ora.mdnsd' on 'oracle01'

CRS-2672: Attempting to start 'ora.evmd' on 'oracle01'

CRS-2676: Start of 'ora.mdnsd' on 'oracle01' succeeded

CRS-2676: Start of 'ora.evmd' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.gpnpd' on 'oracle01'

CRS-2676: Start of 'ora.gpnpd' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.gipcd' on 'oracle01'

CRS-2676: Start of 'ora.gipcd' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.cssdmonitor' on 'oracle01'

CRS-2676: Start of 'ora.cssdmonitor' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.cssd' on 'oracle01'

CRS-2672: Attempting to start 'ora.diskmon' on 'oracle01'

CRS-2676: Start of 'ora.diskmon' on 'oracle01' succeeded

CRS-2676: Start of 'ora.cssd' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'oracle01'

CRS-2672: Attempting to start 'ora.ctssd' on 'oracle01'

CRS-2676: Start of 'ora.ctssd' on 'oracle01' succeeded

CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.asm' on 'oracle01'

CRS-2676: Start of 'ora.asm' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.storage' on 'oracle01'

CRS-2676: Start of 'ora.storage' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.crf' on 'oracle01'

CRS-2676: Start of 'ora.crf' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.crsd' on 'oracle01'

CRS-2676: Start of 'ora.crsd' on 'oracle01' succeeded

CRS-6023: Starting Oracle Cluster Ready Services-managed resources

CRS-6017: Processing resource auto-start for servers: oracle01

CRS-6016: Resource auto-start has completed for server oracle01

CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources

CRS-4123: Oracle High Availability Services has been started.

2020/01/07 11:41:55 CLSRSC-343: Successfully started Oracle Clusterware stack

2020/01/07 11:41:55 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.

CRS-2672: Attempting to start 'ora.ASMNET1LSNR_ASM.lsnr' on 'oracle01'

CRS-2676: Start of 'ora.ASMNET1LSNR_ASM.lsnr' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.asm' on 'oracle01'

CRS-2676: Start of 'ora.asm' on 'oracle01' succeeded

CRS-2672: Attempting to start 'ora.DATA.dg' on 'oracle01'

CRS-2676: Start of 'ora.DATA.dg' on 'oracle01' succeeded

2020/01/07 11:43:10 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.

 

 

 

2020/01/07 11:44:45 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

 

[[email protected] app]# /u01/app/grid-install/root.sh

Performing root user operation.

 

The following environment variables are set as:

    ORACLE_OWNER= grid

    ORACLE_HOME=  /u01/app/grid-install

 

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.

Relinking oracle with rac_on option

Using configuration parameter file: /u01/app/grid-install/crs/install/crsconfig_params

The log of current session can be found at:

  /u01/app/grid/crsdata/oracle02/crsconfig/rootcrs_oracle02_2020-01-07_11-36-22AM.log

2020/01/07 11:36:26 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.

2020/01/07 11:36:26 CLSRSC-4001: Installing Oracle Trace File Analyzer (TFA) Collector.

2020/01/07 11:37:04 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.

2020/01/07 11:37:04 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.

2020/01/07 11:37:05 CLSRSC-363: User ignored prerequisites during installation

2020/01/07 11:37:05 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.

2020/01/07 11:37:07 CLSRSC-504: The root script cannot proceed on this node oracle02 until the current first-node operations have finished on the first node oracle01.

Died at /u01/app/grid-install/crs/install/crsutils.pm line 4080.

The command '/u01/app/grid-install/perl/bin/perl -I/u01/app/grid-install/perl/lib -I/u01/app/grid-install/crs/install /u01/app/grid-install/crs/install/rootcrs.pl ' execution failed

[[email protected] app]# /u01/app/grid-install/root.sh

Performing root user operation.

 

The following environment variables are set as:

    ORACLE_OWNER= grid

    ORACLE_HOME=  /u01/app/grid-install

 

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.

Relinking oracle with rac_on option

Using configuration parameter file: /u01/app/grid-install/crs/install/crsconfig_params

The log of current session can be found at:

  /u01/app/grid/crsdata/oracle02/crsconfig/rootcrs_oracle02_2020-01-07_11-56-49AM.log

2020/01/07 11:56:51 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.

2020/01/07 11:56:51 CLSRSC-4001: Installing Oracle Trace File Analyzer (TFA) Collector.

2020/01/07 11:56:51 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.

2020/01/07 11:56:51 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.

2020/01/07 11:56:52 CLSRSC-363: User ignored prerequisites during installation

2020/01/07 11:56:52 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.

2020/01/07 11:56:53 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.

2020/01/07 11:56:53 CLSRSC-594: Executing installation step 5 of 19: 'SaveParamFile'.

2020/01/07 11:56:55 CLSRSC-594: Executing installation step 6 of 19: 'SetupOSD'.

2020/01/07 11:56:55 CLSRSC-594: Executing installation step 7 of 19: 'CheckCRSConfig'.

2020/01/07 11:56:55 CLSRSC-594: Executing installation step 8 of 19: 'SetupLocalGPNP'.

2020/01/07 11:56:57 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.

2020/01/07 11:56:58 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.

2020/01/07 11:57:44 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.

2020/01/07 11:57:45 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.

2020/01/07 11:58:00 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'

2020/01/07 11:58:14 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.

2020/01/07 11:58:15 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oracle02'

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oracle02' has completed

CRS-4133: Oracle High Availability Services has been stopped.

CRS-4123: Oracle High Availability Services has been started.

2020/01/07 11:58:31 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.

2020/01/07 11:58:32 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oracle02'

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oracle02' has completed

CRS-4133: Oracle High Availability Services has been stopped.

CRS-4123: Oracle High Availability Services has been started.

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oracle02'

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oracle02' has completed

CRS-4133: Oracle High Availability Services has been stopped.

2020/01/07 11:58:49 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.

CRS-4123: Starting Oracle High Availability Services-managed resources

CRS-2672: Attempting to start 'ora.mdnsd' on 'oracle02'

CRS-2672: Attempting to start 'ora.evmd' on 'oracle02'

CRS-2676: Start of 'ora.mdnsd' on 'oracle02' succeeded

CRS-2676: Start of 'ora.evmd' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.gpnpd' on 'oracle02'

CRS-2676: Start of 'ora.gpnpd' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.gipcd' on 'oracle02'

CRS-2676: Start of 'ora.gipcd' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.cssdmonitor' on 'oracle02'

CRS-2676: Start of 'ora.cssdmonitor' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.cssd' on 'oracle02'

CRS-2672: Attempting to start 'ora.diskmon' on 'oracle02'

CRS-2676: Start of 'ora.diskmon' on 'oracle02' succeeded

CRS-2676: Start of 'ora.cssd' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'oracle02'

CRS-2672: Attempting to start 'ora.ctssd' on 'oracle02'

CRS-2676: Start of 'ora.ctssd' on 'oracle02' succeeded

CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.asm' on 'oracle02'

CRS-2676: Start of 'ora.asm' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.storage' on 'oracle02'

CRS-2676: Start of 'ora.storage' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.crf' on 'oracle02'

CRS-2676: Start of 'ora.crf' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.crsd' on 'oracle02'

CRS-2676: Start of 'ora.crsd' on 'oracle02' succeeded

CRS-6017: Processing resource auto-start for servers: oracle02

CRS-2672: Attempting to start 'ora.ASMNET1LSNR_ASM.lsnr' on 'oracle02'

CRS-2672: Attempting to start 'ora.net1.network' on 'oracle02'

CRS-2676: Start of 'ora.net1.network' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.ons' on 'oracle02'

CRS-2676: Start of 'ora.ASMNET1LSNR_ASM.lsnr' on 'oracle02' succeeded

CRS-2672: Attempting to start 'ora.asm' on 'oracle02'

CRS-2676: Start of 'ora.ons' on 'oracle02' succeeded

CRS-2676: Start of 'ora.asm' on 'oracle02' succeeded

CRS-6016: Resource auto-start has completed for server oracle02

CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources

CRS-4123: Oracle High Availability Services has been started.

2020/01/07 12:00:25 CLSRSC-343: Successfully started Oracle Clusterware stack

2020/01/07 12:00:25 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.

2020/01/07 12:00:38 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.

2020/01/07 12:00:47 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

Centos 7安装Oracle12c RAC

 

 

原因:

由于配置/etc/hosts来解析SCAN,导致未来走DNS来进行SCAN的解析,爆出此错误,可以考虑略掉

解决办法:ping scan ip 如果可以ping通,忽略即可。

 

[[email protected] oraInventory]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

 

# public ip

192.168.157.137 oracle01

192.168.157.138 oracle02

 

 

# Private IP

10.10.10.129 oracle01-priv

10.10.10.130 oracle02-priv

 

# Virtual IP

192.168.157.237 oracle01-vip

192.168.157.238 oracle02-vip

 

# Scan IP

192.168.157.139 oracle-cluster

[[email protected] oraInventory]# ping -c 4 192.168.157.139

PING 192.168.157.139 (192.168.157.139) 56(84) bytes of data.

64 bytes from 192.168.157.139: icmp_seq=1 ttl=64 time=0.017 ms

64 bytes from 192.168.157.139: icmp_seq=2 ttl=64 time=0.025 ms

64 bytes from 192.168.157.139: icmp_seq=3 ttl=64 time=0.026 ms

64 bytes from 192.168.157.139: icmp_seq=4 ttl=64 time=0.028 ms

 

--- 192.168.157.139 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3000ms

rtt min/avg/max/mdev = 0.017/0.024/0.028/0.004 ms

[[email protected] oraInventory]# ping -c 4 oracle-cluster

PING oracle-cluster (192.168.157.139) 56(84) bytes of data.

64 bytes from oracle-cluster (192.168.157.139): icmp_seq=1 ttl=64 time=0.019 ms

64 bytes from oracle-cluster (192.168.157.139): icmp_seq=2 ttl=64 time=0.027 ms

64 bytes from oracle-cluster (192.168.157.139): icmp_seq=3 ttl=64 time=0.026 ms

64 bytes from oracle-cluster (192.168.157.139): icmp_seq=4 ttl=64 time=0.029 ms

 

--- oracle-cluster ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3000ms

rtt min/avg/max/mdev = 0.019/0.025/0.029/0.005 ms

 

至此,grid安装完成

 

12.配置磁盘组

 

[[email protected] ~]$ export DISPLAY=192.168.213.23:0.0

[[email protected] ~]$ asmca

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

 

 

13.安装数据库软件

[[email protected] database]$ export DISPLAY=192.168.213.23:0.0

[[email protected] database]$ ./runInstaller

Starting Oracle Universal Installer...

 

Checking Temp space: must be greater than 500 MB.   Actual 2662 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 1767 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-01-07_01-48-07PM. Please wait ...[[email protected] database]$

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

Centos 7安装Oracle12c RAC

 

 

[[email protected] ~]# /u01/app/oracle/product/12.2.0/db_1/root.sh

Performing root user operation.

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/12.2.0/db_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.

 

[[email protected] ~]# /u01/app/oracle/product/12.2.0/db_1/root.sh

Performing root user operation.

 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /u01/app/oracle/product/12.2.0/db_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.

Centos 7安装Oracle12c RAC

 

14.dbca建库:

Centos 7安装Oracle12c RACCentos 7安装Oracle12c RACCentos 7安装Oracle12c RAC

Centos 7安装Oracle12c RACCentos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

Centos 7安装Oracle12c RAC

[[email protected] ~]$ crsctl status res -t

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

Name           Target  State        Server                   State details      

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

Local Resources

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

ora.ARCH.dg

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

ora.ASMNET1LSNR_ASM.lsnr

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

ora.DATA.dg

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

ora.FRA.dg

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

ora.LISTENER.lsnr

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

ora.MGMT.dg

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

ora.OCR.dg

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

ora.chad

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

ora.net1.network

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

ora.ons

               ONLINE  ONLINE       oracle01                 STABLE

               ONLINE  ONLINE       oracle02                 STABLE

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

      1        ONLINE  ONLINE       oracle02                 STABLE

ora.MGMTLSNR

      1        ONLINE  ONLINE       oracle02                 169.254.82.84 10.10.

                                                             10.130,STABLE

ora.asm

      1        ONLINE  ONLINE       oracle01                 Started,STABLE

      2        ONLINE  ONLINE       oracle02                 Started,STABLE

      3        OFFLINE OFFLINE                               STABLE

ora.cvu

      1        ONLINE  ONLINE       oracle02                 STABLE

ora.mgmtdb

      1        ONLINE  ONLINE       oracle02                 Open,STABLE

ora.oracle01.vip

      1        ONLINE  ONLINE       oracle01                 STABLE

ora.oracle02.vip

      1        ONLINE  INTERMEDIATE oracle01                 FAILED OVER,STABLE

ora.qosmserver

      1        ONLINE  ONLINE       oracle02                 STABLE

ora.rac.db

      1        ONLINE  ONLINE       oracle01                 Open,HOME=/u01/app/o

                                                             racle/product/12.2.0

                                                             /db_1,STABLE

      2        ONLINE  ONLINE       oracle02                 Open,HOME=/u01/app/o

                                                             racle/product/12.2.0

                                                             /db_1,STABLE

ora.scan1.vip

      1        ONLINE  ONLINE       oracle02                 STABLE

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