19C RAC要更换存储,主要是更换 OCR,VOTE DISK,DATA,FRA,MGMT等磁盘的位置。正好我这里有这么一个情况,ORACLE 19c rac的存储使用年限到了,而且存储来自于多个磁盘阵列。
这不,最近正好购置了一个新的存储,用于替换老旧存储。
数据库版本:19.19
操作系统:rhel7.3
下面罗列一下关键步骤:
1.识别新存储
这个只要存储工程师画好存储,可以通过在线扫描实现,不用重启机器就可以识别到存储。保证RAC的节点都能认到,实在不行,分别重启服务器也行。
echo "- - -" > /sys/class/scsi_host/host0/scan
2.准备udev
这个可以根据自己情况来,我这里原来环境有 ocr 磁盘5块,data + fra 6块,mgmt两块,一共13块盘,分别如下:
for i in 0 1 2 3 4
do
echo " KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b0000020$i",SYMLINK+="asm_ocr0$i",OWNER="grid",GROUP="asmadmin",MODE="0660"" >>/etc/udev/rules.d/99-oracle-asmdevices.rules;
done
for i in 5 6 7 8 9 a
do
echo " KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b0000020$i",SYMLINK+="asm_data0$i",OWNER="grid",GROUP="asmadmin",MODE="0660"" >>/etc/udev/rules.d/99-oracle-asmdevices.rules;
done
for i in b c
do
echo " KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b0000020$i",SYMLINK+="asm_mgmt0$i",OWNER="grid",GROUP="asmadmin",MODE="0660"" >>/etc/udev/rules.d/99-oracle-asmdevices.rules;
done
# cat /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000200",SYMLINK+="asm_ocr00",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000201",SYMLINK+="asm_ocr01",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000202",SYMLINK+="asm_ocr02",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000203",SYMLINK+="asm_ocr03",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000204",SYMLINK+="asm_ocr04",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000205",SYMLINK+="asm_data05",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000206",SYMLINK+="asm_data06",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000207",SYMLINK+="asm_data07",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000208",SYMLINK+="asm_data08",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b00000209",SYMLINK+="asm_data09",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b0000020a",SYMLINK+="asm_data0a",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b0000020b",SYMLINK+="asm_mgmt0b",OWNER="grid",GROUP="asmadmin",MODE="0660"
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-360060e8021a88b005060a88b0000020c",SYMLINK+="asm_mgmt0c",OWNER="grid",GROUP="asmadmin",MODE="0660"
手动加载一下 udev
# /sbin/udevadm trigger --type=devices --action=change
# udevadm control --reload-rules
检查产生的链接文件
[root@hisdb01 ~]# ls -l /dev/asm*
lrwxrwxrwx 1 root root 5 Apr 2 14:10 /dev/asm_data05 -> dm-15
lrwxrwxrwx 1 root root 5 Apr 2 14:10 /dev/asm_data06 -> dm-11
lrwxrwxrwx 1 root root 5 Apr 2 14:10 /dev/asm_data07 -> dm-34
lrwxrwxrwx 1 root root 5 Apr 2 13:55 /dev/asm_data08 -> dm-37
lrwxrwxrwx 1 root root 5 Apr 2 14:01 /dev/asm_data09 -> dm-36
lrwxrwxrwx 1 root root 5 Apr 2 14:10 /dev/asm_data0a -> dm-10
lrwxrwxrwx 1 root root 4 Apr 2 14:10 /dev/asm_mgmt0b -> dm-7
lrwxrwxrwx 1 root root 4 Apr 2 14:07 /dev/asm_mgmt0c -> dm-6
lrwxrwxrwx 1 root root 4 Apr 2 13:55 /dev/asm_ocr00 -> dm-9
lrwxrwxrwx 1 root root 4 Apr 2 13:55 /dev/asm_ocr01 -> dm-3
lrwxrwxrwx 1 root root 4 Apr 2 14:10 /dev/asm_ocr02 -> dm-5
lrwxrwxrwx 1 root root 4 Apr 2 13:55 /dev/asm_ocr03 -> dm-4
lrwxrwxrwx 1 root root 4 Apr 2 13:55 /dev/asm_ocr04 -> dm-8
3.修改ASM扫描磁盘路径
以grid身份登录数据库,修改参数asm_diskstring以识别所有候选磁盘
su – grid
[grid@hisdb01 ~]$ sqlplus /nolog
SQL> conn / as sysasm
SQL> alter system set asm_diskstring=’/dev/oracleasm/disks/*’,’/dev/asm*’;
此时能够扫描出所有磁盘
select name,path,label,os_mb,free_mb from v$asm_disk order by 2;
NAME PATH LABEL OS_MB FREE_MB
------------- --------------------------------------- ------------ ---------- ---------- /dev/asm_data05 2097152 0
/dev/asm_data06 2097152 0
/dev/asm_data07 2097152 0
/dev/asm_data08 2097152 0
/dev/asm_data09 2097152 0
/dev/asm_data0a 2097152 0
/dev/asm_mgmt0b 512000 0
/dev/asm_mgmt0c 512000 0
/dev/asm_ocr00 2048 0
/dev/asm_ocr01 2048 0
/dev/asm_ocr02 2048 0
/dev/asm_ocr03 2048 0
/dev/asm_ocr04 2048 0
DGDATA_0000 /dev/oracleasm/disks/DATA01 DATA01 2097150 1539524
DGDATA_0001 /dev/oracleasm/disks/DATA02 DATA02 2097150 1539564
DGDATA_0002 /dev/oracleasm/disks/DATA03 DATA03 2097150 1539580
/dev/oracleasm/disks/DATA04 2097150 0
FRA_0000 /dev/oracleasm/disks/DATA05 DATA05 2097150 2021476
FRA_0001 /dev/oracleasm/disks/DATA06 DATA06 2097150 2021500
MGMT_0000 /dev/oracleasm/disks/MGMT01 MGMT01 511998 499032
MGMT_0001 /dev/oracleasm/disks/MGMT02 MGMT02 511998 499012
CRSDG_0000 /dev/oracleasm/disks/VOTDSK01 VOTDSK01 2046 1820
NAME PATH LABEL OS_MB FREE_MB
------------- --------------------------------------- ------------ ---------- ----------
CRSDG_0001 /dev/oracleasm/disks/VOTDSK02 VOTDSK02 2046 1808
CRSDG_0002 /dev/oracleasm/disks/VOTDSK03 VOTDSK03 2046 1800
CRSDG_0003 /dev/oracleasm/disks/VOTDSK04 VOTDSK04 2046 1804
CRSDG_0004 /dev/oracleasm/disks/VOTDSK05 VOTDSK05 2046 179
26 rows selected.
4.替换OCR盘
alter diskgroup crsdg add disk '/dev/asm_ocr00','/dev/asm_ocr01','/dev/asm_ocr02','/dev/asm_ocr03','/dev/asm_ocr04' drop disk 'CRSDG_0001','CRSDG_0002','CRSDG_0003','CRSDG_0004','CRSDG_0000' ;
SQL> select name,path,label,os_mb,free_mb from v$asm_disk order by 2;
NAME PATH LABEL OS_MB FREE_MB
------------- --------------------------------------- ------------ ---------- ----------
/dev/asm_data05 2097152 0
/dev/asm_data06 2097152 0
/dev/asm_data07 2097152 0
/dev/asm_data08 2097152 0
/dev/asm_data09 2097152 0
/dev/asm_data0a 2097152 0
/dev/asm_mgmt0b 512000 0
/dev/asm_mgmt0c 512000 0
CRSDG_0005 /dev/asm_ocr00 2048 1760
CRSDG_0006 /dev/asm_ocr01 2048 1764
CRSDG_0007 /dev/asm_ocr02 2048 1776
NAME PATH LABEL OS_MB FREE_MB
------------- --------------------------------------- ------------ ---------- ----------
CRSDG_0008 /dev/asm_ocr03 2048 1772
CRSDG_0009 /dev/asm_ocr04 2048 1760
DGDATA_0000 /dev/oracleasm/disks/DATA01 DATA01 2097150 1539524
DGDATA_0001 /dev/oracleasm/disks/DATA02 DATA02 2097150 1539564
DGDATA_0002 /dev/oracleasm/disks/DATA03 DATA03 2097150 1539580
/dev/oracleasm/disks/DATA04 2097150 0
FRA_0000 /dev/oracleasm/disks/DATA05 DATA05 2097150 2021444
FRA_0001 /dev/oracleasm/disks/DATA06 DATA06 2097150 2021468
MGMT_0000 /dev/oracleasm/disks/MGMT01 MGMT01 511998 499032
MGMT_0001 /dev/oracleasm/disks/MGMT02 MGMT02 511998 499012
/dev/oracleasm/disks/VOTDSK01 2046 0
NAME PATH LABEL OS_MB FREE_MB
------------- --------------------------------------- ------------ ---------- ----------
/dev/oracleasm/disks/VOTDSK02 2046 0
/dev/oracleasm/disks/VOTDSK03 2046 0
/dev/oracleasm/disks/VOTDSK04 2046 0
/dev/oracleasm/disks/VOTDSK05 2046 0
26 rows selected.
OCR 磁盘 发现已经替换完成
再检查一下VOTEDISK
grid@hisdb02 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE fcdbc07528b74f4dbf5607f0a7dbc305 (/dev/asm_ocr00) [CRSDG]
2. ONLINE e2f5c4216bab4f1fbf483cdd45f847b9 (/dev/asm_ocr01) [CRSDG]
3. ONLINE 9dea3d5f31e64f42bf9522529c47b40b (/dev/asm_ocr02) [CRSDG]
4. ONLINE 5762f8fdd5d54f09bfe9fedb2215591d (/dev/asm_ocr03) [CRSDG]
5. ONLINE 30870976f1114f13bfe79d85e1f4e76d (/dev/asm_ocr04) [CRSDG]
已经更换完成。
5.更换MGMT磁盘组
SQL> alter diskgroup mgmt add disk '/dev/asm_mgmt0b','/dev/asm_mgmt0c' drop disk 'MGMT_0000','MGMT_0001' ;
Diskgroup altered.
6.更换DATA和FRA磁盘组
SQL> alter diskgroup DGDATA add disk '/dev/asm_data05','/dev/asm_data06','/dev/asm_data07' drop disk 'DGDATA_0000','DGDATA_0001','DGDATA_0002';
Diskgroup altered.
ALTER DISKGROUP DGDATA REBALANCE POWER 11; ###指定重平衡操作的力度(调度优先级)
SQL> alter diskgroup fra add disk '/dev/asm_data09','/dev/asm_data0a' rebalance power 11 drop disk 'FRA_0000','FRA_0001';
Diskgroup altered.
这个重平衡要慢一些,看磁盘数据大小
select GROUP_NUMBER,OPERATION,STATE,POWER,ACTUAL,SOFAR,EST_MINUTES from v$asm_operation;
GROUP_NUMBER OPERA STAT POWER ACTUAL SOFAR EST_MINUTES
------------ ----- ---- ---------- ---------- ---------- -----------
2 REBAL WAIT 11 11 0 0
2 REBAL RUN 11 11 103370 22
2 REBAL DONE 11 11 0 0
3 REBAL WAIT 11
3 REBAL WAIT 11
3 REBAL WAIT 11
6 rows selected.
我这里大概等了1小时。
最后替换完成,如下:
SQL> select name,path,label,os_mb,free_mb,state from v$asm_disk order by 2;
NAME PATH LABEL OS_MB FREE_MB STATE
------------- --------------------------------------- ------------ ---------- ------- -------
DGDATA_0003 /dev/asm_data05 2097152 1539556 NORMAL
DGDATA_0004 /dev/asm_data06 2097152 1539560 NORMAL
DGDATA_0005 /dev/asm_data07 2097152 1539560 NORMAL
/dev/asm_data08 2097152 0 NORMAL
FRA_0002 /dev/asm_data09 2097152 2021368 NORMAL
FRA_0003 /dev/asm_data0a 2097152 2021420 NORMAL
MGMT_0002 /dev/asm_mgmt0b 512000 499024 NORMAL
MGMT_0003 /dev/asm_mgmt0c 512000 499024 NORMAL
CRSDG_0005 /dev/asm_ocr00 2048 1760 NORMAL
CRSDG_0006 /dev/asm_ocr01 2048 1764 NORMAL
CRSDG_0007 /dev/asm_ocr02 2048 1776 NORMAL
CRSDG_0008 /dev/asm_ocr03 2048 1772 NORMAL
CRSDG_0009 /dev/asm_ocr04 2048 1760 NORMAL
/dev/oracleasm/disks/DATA01 2097150 0 NORMAL
/dev/oracleasm/disks/DATA02 2097150 0 NORMAL
/dev/oracleasm/disks/DATA03 2097150 0 NORMAL
/dev/oracleasm/disks/DATA04 2097150 0 NORMAL
/dev/oracleasm/disks/DATA05 2097150 0 NORMAL
/dev/oracleasm/disks/DATA06 2097150 0 NORMAL
/dev/oracleasm/disks/MGMT01 511998 0 NORMAL
/dev/oracleasm/disks/MGMT02 511998 0 NORMAL
/dev/oracleasm/disks/VOTDSK01 2046 0 NORMAL
NAME PATH LABEL OS_MB FREE_MB STATE
------------- --------------------------------------- ------------ ---------- ------- -------
/dev/oracleasm/disks/VOTDSK02 2046 0 NORMAL
/dev/oracleasm/disks/VOTDSK03 2046 0 NORMAL
/dev/oracleasm/disks/VOTDSK04 2046 0 NORMAL
/dev/oracleasm/disks/VOTDSK05 2046 0 NORMAL
26 rows selected.
7.断掉主机到旧存储的连接
这个由存储厂商完成
8.关闭以前的ORACLE ASMLIB驱动
systemctl disable oracleasm
systemctl stop oracleasm
9.最后重启一下主机
之后,主机上就只剩新的存储。
导致,更换RAC存储完毕。
|