Oracle筆記(2)19c RAC安裝


一 、版本及規划

1.版本選擇

oracle 19.3.0 + centos7.6_64
操作系統: CentOS-7-x86_64-DVD-1908.iso
集群:     Oracle Database Grid Infrastructure 19.3.0.0.0 for Linux x86-64.zip
數據庫:   Oracle Database 19.3.0.0.0 for Linux x86-64.zip

2.主機IP規划

        主機名           public ip        Virtual ip       private ip         scan ip
節點1:    rac1        192.168.1.141    192.168.1.142    192.168.10.1      192.168.1.147、148、149
節點2:    rac2        192.168.1.143    192.168.1.144    192.168.10.3      192.168.1.147、148、149
#節點3:   rac3        192.168.1.145    192.168.1.146    192.168.10.5      192.168.1.147、148、149    #  預留 
#DG       dg         192.168.1.150                                                                 #  預留
存儲      openfiler   192.168.1.140、192.168.10.140

備注:Private用於心跳,Scanip用於集群對外服務。

3.ASM磁盤組規划

ASM磁盤組 	    用途 	                    大小             冗余
CRS 	    ocr、voting file、19c grid管理庫 	100G+100G+100G    NORMAL
DATA 	            數據文件 	                  200G+200G 	  NORMAL
RECO                RECO                             150G         extn

#備注:共享磁盤使用使用openfiler提供,過程省略。
      openfiler: openfileresa-2.99.1-x86_64-disc1.iso
      虛擬機:     選擇rh5_64,配置為2雙網卡、1cpu、512M內存、20G系統盤+500G數據盤*3
      安裝參考:   https://jingyan.baidu.com/article/046a7b3ebe6818f9c27fa9ef.html
      安裝后登錄: https://192.168.1.140:446/  用戶名:openfiler   口令:password 

二、環境准備

2.1.主機環境配置

1.修改主機名
### rac1 
[root@server ~]# hostnamectl --static set-hostname rac1
### rac2 
[root@server ~]# hostnamectl --static set-hostname rac2

1.關閉防火牆
### rac1 rac2
[root@server ~]# systemctl stop firewalld.service
[root@server ~]# systemctl disable firewalld.service
[root@server ~]# systemctl status firewalld.service

2.關閉selinux
### rac1 rac2###
[root@server ~]# setenforce 0                  #臨時設置SELinux 成為permissive模式, 1為enforcing模式
#[root@server ~]# setenforce Permissive        #或者
[root@server ~]# sed -i "s/^SELINUX=.*/SELINUX=Permissive/" /etc/selinux/config    #重啟生效

3.修改hosts文件
### rac1 rac2###
[root@server ~]# cat >> /etc/hosts <<'EOF'

# add for rac 19c
# Public
192.168.1.141   rac1
192.168.1.143  rac2

# Virtual
192.168.1.142   rac1-vip
192.168.1.144   rac2-vip

# Private
192.168.10.141   rac1-priv
192.168.10.143   rac2-priv
# SCAN
192.168.1.147   rac-scan
#192.168.1.148  rac-scan  # do not use dns
#192.168.1.149  rac-scan  # do not use dns
EOF

4.修改內核參數,添加配置內容至 "/etc/sysctl.conf" .
### rac1 rac2###
[root@server ~]# cat >>/etc/sysctl.conf <<'EOF'

# add for oracle by me
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
EOF
[root@server ~]# /sbin/sysctl -p     #重啟生效

5.修改 /etc/security/limits.conf,在最后添加配置內容
[root@server ~]# cat >>/etc/security/limits.conf <<'EOF'

#add for oracle by me
oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    16384
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768
oracle   hard   memlock    134217728
oracle   soft   memlock    134217728
grid	soft	nofile	1024
grid	hard	nofile	65536
grid	soft	nproc	16384
grid	hard	nproc	16384
grid	soft	stack	10240
grid	hard	stack	32768
grid	soft	memlock	134217728
grid	hard	memlock	134217728
EOF

6.安裝必要包
# From Public Yum or ULN
[root@server ~]# yum install -y \
binutils                  \
compat-libstdc++-33       \
compat-libstdc++-33.i686  \
gcc                       \
gcc-c++                   \
glibc                     \
glibc.i686                \
glibc-devel               \
glibc-devel.i686          \
ksh                       \
libgcc                    \
libgcc.i686               \
libstdc++                 \
libstdc++.i686            \
libstdc++-devel           \
libstdc++-devel.i686      \
libaio                    \
libaio.i686               \
libaio-devel              \
libaio-devel.i686         \
libXext                   \
libXext.i686              \
libXtst                   \
libXtst.i686              \
libX11                    \
libX11.i686               \
libXau                    \
libXau.i686               \
libxcb                    \
libxcb.i686               \
libXi                     \
libXi.i686                \
make                      \
sysstat                   \
unixODBC                  \
unixODBC-devel            \
zlib-devel                \
zlib-devel.i686           \
compat-libcap1  # add after check

9。其他
# 1)NTP配置
    使用RAC自帶ctssd時間同步進程,這里關閉系統NTP
### rac1 rac2
[root@server ~]# systemctl stop chronyd
systemctl disable chronyd
mv /etc/chrony.conf /etc/chrony.conf.bak

# 2) 關閉avahi
[root@server ~]# systemctl stop avahi-dnsconfd
systemctl stop avahi-daemon
systemctl disable avahi-dnsconfd
systemctl disable avahi-daemon

# 3) 關閉THP
[root@server ~]# cat >>/etc/rc.d/rc.local <<'EOF'

# add for rac to disable THP
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
EOF
[root@server ~]# chmod +x /etc/rc.d/rc.local
[root@server ~]# reboot

#安裝grid檢查報錯后添加
mv /etc/ntp.conf /etc/ntp.conf.orig

2.2 用戶環境配置

1.創建用戶和組
[root@server ~]# groupadd -g 54321 oinstall
groupadd -g 54322 dba
groupadd -g 54323 oper

groupadd -g 54324 backupdba
groupadd -g 54325 dgdba
groupadd -g 54326 kmdba
groupadd -g 54327 asmdba
groupadd -g 54328 asmoper
groupadd -g 54329 asmadmin
groupadd -g 54330 racdba
[root@server ~]# useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,racdba oracle
[root@server ~]# useradd -u 54322 -g oinstall -G dba,asmdba,asmoper,asmadmin,racdba grid
[root@server ~]# passwd oracle
[root@server ~]# passwd grid


備注:常見用戶組說明
------------------------------------------------------------------------------------------
組 	    角色 	            權限
oinstall 	                安裝和升級oracle軟件
dba 	    sysdba 	        創建、刪除、修改、啟動、關閉數據庫,切換日志歸檔模式,備份恢復數據庫
oper 	    sysoper 	        啟動、關閉、修改、備份、恢復數據庫,修改歸檔模式
asmdba 	    sysdba自動存儲管理 	管理ASM實例
asmoper     sysoper自動存儲管理 	啟動、停止ASM實例
asmadmin    sysasm 	        掛載、卸載磁盤組,管理其他存儲設備
backupdba   sysbackup 	        啟動關閉和執行備份恢復(12c)
dgdba 	    sysdg 	        管理Data Guard(12c)
kmdba 	    syskm 	        加密管理相關操作
racdba                          rac管理
------------------------------------------------------------------------------------------
參考:https://blog.csdn.net/luis_ora/article/details/90054248

2.創建安裝目錄

[root@server ~]# 
mkdir -p /u01/app/grid
mkdir -p /u01/app/19.3.0.0/grid
mkdir -p /u01/app/oracle/product/19.3.0.0/db_1
chown -R oracle:oinstall /u01/
chown -R grid:oinstall /u01/app/19.3.0.0/grid
chown -R grid:oinstall /u01/app/grid
chmod -R 775 /u01/

3.編輯profile
# 3.1 grid用戶
### 1) rac1
[root@rac1~]# cat >>/home/grid/.bash_profile<<'EOF'
# grid Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=$HOSTNAME
export ORACLE_BASE=/u01/app/grid
export GRID_HOME=/u01/app/19.3.0.0/grid
export DB_HOME=$ORACLE_BASE/product/19.3.0.0/db_1

export ORACLE_HOME=$GRID_HOME
export ORACLE_SID=+ASM1
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
EOF

### 2) rac2
[root@rac2~]# cat >>/home/grid/.bash_profile<<'EOF'
# grid Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=$HOSTNAME
export ORACLE_BASE=/u01/app/grid
export GRID_HOME=/u01/app/19.3.0.0/grid
export DB_HOME=$ORACLE_BASE/product/19.3.0.0/db_1

export ORACLE_HOME=$GRID_HOME
export ORACLE_SID=+ASM2
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
EOF

# 3.2 oracle用戶
### 1) rac1
[root@rac1~]# cat >> /home/oracle/.bash_profile <<'EOF'

# oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=$HOSTNAME
export ORACLE_UNQNAME=racdb
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/19.3.0.0/grid

export DB_HOME=$ORACLE_BASE/product/19.3.0.0/db_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=racdb1
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
EOF

### 2) rac2
[root@rac2~]# cat >> /home/oracle/.bash_profile <<'EOF'

# oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=$HOSTNAME
export ORACLE_UNQNAME=racdb
export ORACLE_BASE=/u01/app/oracle
export GRID_HOME=/u01/app/19.3.0.0/grid

export DB_HOME=$ORACLE_BASE/product/19.3.0.0/db_1
export ORACLE_HOME=$DB_HOME
export ORACLE_SID=racdb2
export ORACLE_TERM=xterm
export BASE_PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$BASE_PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
EOF

# 3.3 配置互信
ssh-keygen
ssh-copy-id grid@rac2

ssh rac1 "hostname;date"
ssh rac1-priv "hostname;date"
ssh rac2 "hostname;date"
ssh rac2-priv "hostname;date"

2.3 配置共享存儲

1.配置iscsi
# rac1 rac2 啟動iscsi
[root@rac1 ~]# rm -qa|grep iscsi
iscsi-initiator-utils-iscsiuio-6.2.0.874-11.el7.x86_64
libvirt-daemon-driver-storage-iscsi-4.5.0-23.el7_7.6.x86_64
libiscsi-1.9.0-7.el7.x86_64
iscsi-initiator-utils-6.2.0.874-11.el7.x86_64
[root@rac1 ~]# chkconfig iscsid on
[root@rac1 ~]# systemctl start iscsid.service
[root@rac1 ~]# systemctl status iscsid.service

# rac1 rac2 配置連接
[root@rac1 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.10.140                              #發現
[root@rac1 ~]# iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.crs1 -p 192.168.10.140 -l           #自動登錄
iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.crs2 -p 192.168.10.140 -l  
iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.crs3 -p 192.168.10.140 -l  
iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.data1 -p 192.168.10.140 -l  
iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.data2 -p 192.168.10.140 -l  

#備注:
      iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.data2 -p 192.168.10.140:3260 -u           #先取消
      iscsiadm -m node -o delete -T iqn.2006-01.com.openfiler:tsn.data2 -p 192.168.10.140:3260     #再刪除
      iscsiadm -m node --loginall=all   #全部添加
      iscsiadm -m node --logoutall=all  #全部取消並刪除

2.配置多路徑
[root@rac1 ~]# cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/
[root@rac1 ~]# systemctl enable multipathd.service
[root@rac1 ~]# systemctl start multipathd.service
[root@rac1 ~]# systemctl stop multipathd.service

#----------------
[root@rac1 by-id]# ll /dev/disk/by-id/
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c45524575336f547a2d775956462d73554946 -> ../../sdd
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c45524647383354652d747439792d4b634952 -> ../../sdf
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c4552494e643353642d706569522d31375a53 -> ../../sdb
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c4552584e4c65474b2d786374442d4f786d48 -> ../../sde
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c455258654d4845702d4d357a442d585a5370 -> ../../sdc

[root@rac1 by-id]# ll /dev/disk/by-path/
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.crs1-lun-0 -> ../../sdb
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.crs2-lun-0 -> ../../sdc
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.crs3-lun-0 -> ../../sdd
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.data1-lun-0 -> ../../sde
lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.data2-lun-0 -> ../../sdf

#----------------

#建議用vim修改
[root@rac1 ~]# cat >> /etc/multipath.conf <<'EOF'
multipaths {
	multipath {
		wwid	14f504e46494c4552494e643353642d706569522d31375a53
		alias	crs1
		uid	54322
		gid	54321
	}
	multipath {
		wwid	14f504e46494c455258654d4845702d4d357a442d585a5370
		alias	crs2
		uid	54322
		gid	54321
	}
	multipath {
		wwid	14f504e46494c45524575336f547a2d775956462d73554946
		alias	crs3
		uid	54322
		gid	54321
	}
	multipath {
		wwid	14f504e46494c4552584e4c65474b2d786374442d4f786d48
		alias	data1
		uid	54322
		gid	54321
	}
	multipath {
		wwid	14f504e46494c45524647383354652d747439792d4b634952
		alias	data2
		uid	54322
		gid	54321
	}
}
EOF
[root@rac1 ~]# systemctl restart multipathd.service

# 備注:重啟觀察磁盤情況
---------------------------------------------------------------------------
[root@rac1 ~]# fdisk -l
[root@rac1 ~]# ll /dev/mapper/
total 0
lrwxrwxrwx. 1 root root       7 Mar 28 13:19 centos_server-root -> ../dm-0
lrwxrwxrwx. 1 root root       7 Mar 28 13:19 centos_server-swap -> ../dm-1
crw-------. 1 root root 10, 236 Mar 28 13:19 control
lrwxrwxrwx. 1 root root       7 Mar 28 13:27 crs1 -> ../dm-2
lrwxrwxrwx. 1 root root       7 Mar 28 13:27 crs2 -> ../dm-6
lrwxrwxrwx. 1 root root       7 Mar 28 13:27 crs3 -> ../dm-5
lrwxrwxrwx. 1 root root       7 Mar 28 13:27 data1 -> ../dm-4
lrwxrwxrwx. 1 root root       7 Mar 28 13:27 data2 -> ../dm-3
[root@rac1 ~]# reboot
Connection closing...Socket close.

Connection closed by foreign host.

Disconnected from remote host(192.168.1.141:22) at 13:28:45.

Type `help' to learn how to use Xshell prompt.
[D:\~]$ reconnect


[D:\~]$ Connecting to 192.168.1.141:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Last login: Sat Mar 28 13:19:26 2020 from 192.168.1.10
[root@rac1 ~]# ll /dev/mapper/
total 0
lrwxrwxrwx. 1 root root       7 Mar 28 13:28 centos_server-root -> ../dm-0
lrwxrwxrwx. 1 root root       7 Mar 28 13:28 centos_server-swap -> ../dm-1
crw-------. 1 root root 10, 236 Mar 28 13:28 control
lrwxrwxrwx. 1 root root       7 Mar 28 13:29 crs1 -> ../dm-6
lrwxrwxrwx. 1 root root       7 Mar 28 13:29 crs2 -> ../dm-5
lrwxrwxrwx. 1 root root       7 Mar 28 13:29 crs3 -> ../dm-4
lrwxrwxrwx. 1 root root       7 Mar 28 13:29 data1 -> ../dm-3
lrwxrwxrwx. 1 root root       7 Mar 28 13:29 data2 -> ../dm-2
[root@rac1 ~]# fdisk -l
Disk /dev/sda: 536.9 GB, 536870912000 bytes, 1048576000 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 label type: dos
Disk identifier: 0x000a2ce8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200  1048575999   523238400   8e  Linux LVM

Disk /dev/mapper/centos_server-root: 531.6 GB, 531628032000 bytes, 1038336000 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/mapper/centos_server-swap: 4160 MB, 4160749568 bytes, 8126464 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/sdb: 165.0 GB, 164987142144 bytes, 322240512 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: 536.9 GB, 536870912000 bytes, 1048576000 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: 107.4 GB, 107374182400 bytes, 209715200 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: 107.4 GB, 107374182400 bytes, 209715200 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/mapper/data2: 165.0 GB, 164987142144 bytes, 322240512 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: 107.4 GB, 107374182400 bytes, 209715200 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/mapper/data1: 536.9 GB, 536870912000 bytes, 1048576000 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/mapper/crs3: 107.4 GB, 107374182400 bytes, 209715200 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/mapper/crs2: 107.4 GB, 107374182400 bytes, 209715200 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/mapper/crs1: 107.4 GB, 107374182400 bytes, 209715200 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

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


修改:99-oracle-asmdevices.rules
[root@rac1 ~]# vim /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c4552494e643353642d706569522d31375a53",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c455258654d4845702d4d357a442d585a5370",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c45524575336f547a2d775956462d73554946",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c4552584e4c65474b2d786374442d4f786d48",OWNER="grid",GROUP="asmadmin",MODE="0775"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c45524647383354652d747439792d4b634952",OWNER="grid",GROUP="asmadmin",MODE="0775"
[root@rac1 ~]# reboot                   #粗暴的重啟生效
[root@rac2 ~]# ll /dev/ |grep dm-*      #檢查是否生效

三、GRID 軟件安裝

在節點1上安裝Oracle Grid Infrastructure軟件,安裝過程中會自動把軟件拷貝至節點2,因此節點2上不用安裝操作.

[root@rac1 ~]# su - grid
[grid@rac1 ~]$ unzip LINUX.X64_193000_grid_home.zip  -d $ORACLE_HOME
[grid@rac1 ~]$ $ORACLE_HOME/oui/prov/resources/scripts/sshUserSetup.sh -user grid  -hosts "rac1 rac2"  -advanced -noPromptPassphrase
[grid@rac1 ~]$ exit

[root@rac1 ~]# yum localinstall /u01/app/19.3.0.0/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm
[root@rac1 ~]# /u01/app/19.3.0.0/grid/runcluvfy.sh  stage -pre crsinst -n "rac1,rac2" -verbose

 
# Make sure both virtual machines are started. Install the following package from the Oracle grid media as the "root" user.
[root@rac1 ~]# cd /media/sf_12.1.0.2/grid/rpm
[root@rac1 ~]# rpm -Uvh cvuqdisk*

[root@rac1 ~]# su - grid
[grid@rac1 ~]$ cd $ORACLE_HOME
# [grid@rac1 ~]$ORACLE_HOME/runcluvfy.sh  stage -pre crsinst -n "ydb01,ydb02"  -verbose   #圖形化界面,安裝前檢查跳過
[grid@rac1 ~]$ $ ./runInstaller

四、Database 安裝

1.ASM新建 DATA RECO磁盤組
[grid@rac1 ~]$asmca      #進入圖形化 創建
# 過程省略,其中CRS存儲OCR和Votedisk,DATA用於存放數據。RECO用於存儲閃回區和歸檔.

2.安裝 Database 軟件。
注意:對於RAC安裝,一定要選擇僅設置軟件(Set Up Software Only),安裝完軟件之后再使用DBCA建庫,這是與以往 版本不同的地方。不能在軟件安裝過程中創建數據庫了。

[root@rac1 ~]# su - oracle
[oracle@rac1 db_1]$ unzip Oracle\ Database\ 19.3.0.0.0\ for\ Linux\ x86-64.zip -d $ORACLE_HOME

3.安裝 Database 實例。
[root@rac1 ~]# su - oracle
[oracle@rac1 db_1]$ dbca
過程忽略。。。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM