代码改变世界

XD刷机中执行reclaimdisks.sh的作用

2021-01-27 22:48  AlfredZhao  阅读(372)  评论(0编辑  收藏  举报

之前刷机提到在使用OEDA进行一键部署前,需先在所有DB节点上运行reclaimdisks.sh,也提到观察会释放pvs/vgs/lvs相对应的剩余空间。
本文以一套X8环境为例,来看下具体的表现,以加深理解。

1.reclaim的相关命令

查看当前的分区信息:
# /opt/oracle.SupportTools/reclaimdisks.sh -check

在一键部署前,需先在所有DB节点上运行reclaim:
# /opt/oracle.SupportTools/reclaimdisks.sh -free -reclaim   

2.运行reclaim之前的情况

查看当前的分区信息:
# /opt/oracle.SupportTools/reclaimdisks.sh -check
Model is ORACLE SERVER X8-2
Number of LSI controllers: 1
Physical disks found: 4 (252:0 252:1 252:2 252:3)
Logical drives found: 1
Linux logical drive: 0
RAID Level for the Linux logical drive: 5
Physical disks in the Linux logical drive: 4 (252:0 252:1 252:2 252:3)
Dedicated Hot Spares for the Linux logical drive: 0
Global Hot Spares: 0
Valid. Disks configuration: RAID5 from 4 disks with no global and dedicated hot spare disks.
Valid. Booted: Linux. Layout: Linux + DOM0.

可以看到最后有个DOM0。
此时查询vgs/pvs/lvs信息,会发现vg中已经没有可用空间了:

# vgs
  VG      #PV #LV #SN Attr   VSize VFree
  VGExaDb   1   7   0 wz--n- 3.27t    0 
# pvs
  PV         VG      Fmt  Attr PSize PFree
  /dev/sda3  VGExaDb lvm2 a--  3.27t    0 
# lvs
  LV                 VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  LVDbExaVMImages    VGExaDb -wi-a-----   3.06t                                                    
  LVDbOra1           VGExaDb -wi-ao---- 100.00g                                                    
  LVDbSwap1          VGExaDb -wi-ao----  24.00g                                                    
  LVDbSys1           VGExaDb -wi-ao----  30.00g                                                    
  LVDbSys2           VGExaDb -wi-a-----  30.00g                                                    
  LVDbSys3           VGExaDb -wi-a-----  30.00g                                                    
  LVDoNotRemoveOrUse VGExaDb -wi-a-----   1.00g           

3.运行reclaim之后的情况

执行reclaim:

# /opt/oracle.SupportTools/reclaimdisks.sh -free -reclaim   

之后再次查询vgs/pvs/lvs信息,会发现vg中已经有3T+可用空间:

# pvs
  PV         VG      Fmt  Attr PSize PFree
  /dev/sda3  VGExaDb lvm2 a--  3.27t 3.09t
# vgs
  VG      #PV #LV #SN Attr   VSize VFree
  VGExaDb   1   5   0 wz--n- 3.27t 3.09t
# lvs
  LV                 VG      Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  LVDbOra1           VGExaDb -wi-ao---- 100.00g                                                    
  LVDbSwap1          VGExaDb -wi-ao----  24.00g                                                    
  LVDbSys1           VGExaDb -wi-ao----  30.00g                                                    
  LVDbSys2           VGExaDb -wi-a-----  30.00g                                                    
  LVDoNotRemoveOrUse VGExaDb -wi-a-----   1.00g      

此时再去做check:

# /opt/oracle.SupportTools/reclaimdisks.sh -check
Model is ORACLE SERVER X8-2
Number of LSI controllers: 1
Physical disks found: 4 (252:0 252:1 252:2 252:3)
Logical drives found: 1
Linux logical drive: 0
RAID Level for the Linux logical drive: 5
Physical disks in the Linux logical drive: 4 (252:0 252:1 252:2 252:3)
Dedicated Hot Spares for the Linux logical drive: 0
Global Hot Spares: 0
Valid. Disks configuration: RAID5 from 4 disks with no global and dedicated hot spare disks.
Valid. Booted: Linux. Layout: Linux.

不难发现:lv里面的那个3.06T的LVDbExaVMImages被回收了,同时check结果中的DOM0也随之不见了。