AIX 解除镜像再重建同步

扩展fs发现pv状态变成removed,用chpv -v -a hdisk即可,至于什么原因造成removed?

image

一.解除vg mirrorunmirrorvg vgname hdiskx hdiskxx,后面跟被踢掉的hdisk

root@SNCPRD:/# lsvg -p p40datavg
p40datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk5            active            999         838         200..79..159..200..200
hdisk6            active            999         839         200..40..199..200..200
hdisk7            active            999         0           00..00..00..00..00
hdisk8            active            999         658         200..00..58..200..200
hdisk1            removed           999         878         200..79..199..200..200
hdisk2            removed           999         839         200..40..199..200..200
hdisk3            removed           999         0           00..00..00..00..00
hdisk4            removed           999         658         200..00..58..200..200
#
root@SNCPRD:/# lsvg -l p40datavg
p40datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv02             jfs2log    1       2       2    open/stale    N/A
dvdlv               jfs2       120     240     2    open/stale    /DVD
upgradeoslv         jfs2       40      80      2    open/stale    /upgradeAIX
sapmntlv            jfs2       20      40      2    open/stale    /sapmnt
usrsaplv            jfs2       120     240     2    open/stale    /usr/sap
oraclelv            jfs2       80      160     2    open/stale    /oracle
p40oralv            jfs2       1200    2400    4    open/stale    /oracle/P40
sapdblv             jfs2       40      80      2    open/stale    /sapdb
paging00            paging     40      40      1    closed/syncd  N/A
root@SNCPRD:/# lspv
hdisk0          0001d23ce361a58d                    rootvg          active      
hdisk5          00067a2b42f1a0e9                    p40datavg       active      
hdisk1          00067a2b646c51d3                    p40datavg       active      
hdisk2          00067a2b646c52c8                    p40datavg       active      
hdisk3          00067a2b646c53b0                    p40datavg       active      
hdisk4          00067a2b646c54b2                    p40datavg       active      
hdisk6          00067a2b42f1a13b                    p40datavg       active      
hdisk7          00067a2b42f1a182                    p40datavg       active      
hdisk8          00067a2b42f1a1bd                    p40datavg       active      
hdisk9          0001d23c26e6ffd2                    rootvg          active      
root@SNCPRD:/# unmirrorvg p40datavg hdisk1 hdisk2 hdisk3 hdisk4
0516-1804 chvg: The quorum change takes effect immediately.

二.从vg里踢掉pvreducevg hdiskx hdiskxx

root@SNCPRD:/# lsvg -p p40datavg
p40datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk5            active            999         838         200..79..159..200..200
hdisk6            active            999         839         200..40..199..200..200
hdisk7            active            999         0           00..00..00..00..00
hdisk8            active            999         658         200..00..58..200..200
hdisk1            removed           999         999         200..200..199..200..200
hdisk2            removed           999         999         200..200..199..200..200
hdisk3            removed           999         999         200..200..199..200..200
hdisk4            removed           999         999         200..200..199..200..200
root@SNCPRD:/# lsvg -l p40datavg
p40datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv02             jfs2log    1       1       1    open/syncd    N/A
dvdlv               jfs2       120     120     1    open/syncd    /DVD
upgradeoslv         jfs2       40      40      1    open/syncd    /upgradeAIX
sapmntlv            jfs2       20      20      1    open/syncd    /sapmnt
usrsaplv            jfs2       120     120     1    open/syncd    /usr/sap
oraclelv            jfs2       80      80      1    open/syncd    /oracle
p40oralv            jfs2       1200    1200    2    open/syncd    /oracle/P40
sapdblv             jfs2       40      40      1    open/syncd    /sapdb
paging00            paging     40      40      1    closed/syncd  N/A
root@SNCPRD:/# reducevg p40datavg hdisk1 hdisk2 hdisk3 hdisk4
root@SNCPRD:/# lsvg -p p40datavg
p40datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk5            active            999         838         200..79..159..200..200
hdisk6            active            999         839         200..40..199..200..200
hdisk7            active            999         0           00..00..00..00..00
hdisk8            active            999         658         200..00..58..200..200

三.将pv重新加入vgextendvg vgname hdiskx hdiskxx

root@SNCPRD:/# extendvg p40datavg hdisk1 hdisk2 hdisk3 hdisk4
0516-1398 extendvg: The physical volume hdisk1, appears to belong to
another volume group. Use the force option to add this physical volume
to a volume group.
0516-1398 extendvg: The physical volume hdisk2, appears to belong to
another volume group. Use the force option to add this physical volume
to a volume group.
0516-1398 extendvg: The physical volume hdisk3, appears to belong to
another volume group. Use the force option to add this physical volume
to a volume group.
0516-1398 extendvg: The physical volume hdisk4, appears to belong to
another volume group. Use the force option to add this physical volume
to a volume group.
0516-792 extendvg: Unable to extend volume group.
root@SNCPRD:/# extendvg -f p40datavg hdisk1 hdisk2 hdisk3 hdisk4 
root@SNCPRD:/# lsvg -p p40datavg
p40datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk5            active            999         838         200..79..159..200..200
hdisk6            active            999         839         200..40..199..200..200
hdisk7            active            999         0           00..00..00..00..00
hdisk8            active            999         658         200..00..58..200..200
hdisk1            active            999         999         200..200..199..200..200
hdisk2            active            999         999         200..200..199..200..200
hdisk3            active            999         999         200..200..199..200..200
hdisk4            active            999         999         200..200..199..200..200

五.smitty vg - mirror vg


另外一个比较悲剧,lv镜像落在了同一边的存储,恰好这个存储的pv变成了removed状态

一.解除vg mirror

$ lsvg p50datavg
VOLUME GROUP:       p50datavg                VG IDENTIFIER:  00067a4b0000d4000000013d431fc6db
VG STATE:           active                   PP SIZE:        256 megabyte(s)
VG PERMISSION:      read/write               TOTAL PPs:      7992 (2045952 megabytes)
MAX LVs:            512                      FREE PPs:       790 (202240 megabytes)
LVs:                8                        USED PPs:       7202 (1843712 megabytes)
OPEN LVs:           7                        QUORUM:         1 (Disabled)
TOTAL PVs:          8                        VG DESCRIPTORS: 4
STALE PVs:          4                        STALE PPs:      413
ACTIVE PVs:         4                        AUTO ON:        no
MAX PPs per VG:     130048                                    
MAX PPs per PV:     1016                     MAX PVs:        128
LTG size (Dynamic): 128 kilobyte(s)          AUTO SYNC:      no
HOT SPARE:          no                       BB POLICY:      relocatable 
PV RESTRICTION:     none                     INFINITE RETRY: no
#
$ lsvg -p p50datavg
p50datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk5            active            999         0           00..00..00..00..00
hdisk6            active            999         0           00..00..00..00..00
hdisk7            active            999         415         15..00..00..200..200
hdisk8            active            999         0           00..00..00..00..00
hdisk1            removed           999         0           00..00..00..00..00
hdisk2            removed           999         375         00..00..00..175..200
hdisk3            removed           999         0           00..00..00..00..00
hdisk4            removed           999         0           00..00..00..00..00
# unmirrorvg p50datavg hdisk1 hdisk2 hdisk3 hdisk4
0516-076 lreducelv: Cannot remove last good copy of stale partition.
        Resynchronize the partitions with syncvg and try again.
0516-922 rmlvcopy: Unable to remove logical partition copies from
        logical volume p50oralv.
0516-1135 unmirrorvg: The unmirror of the volume group failed.
        The volume group is still partially or fully mirrored.
#
6005076802810A058800000000000168

二.removed状态的pv上有正常的copied,是不能被踢掉的

# lscfg -vpl hdisk52
  hdisk52          U78AF.001.WZS08C2-P1-C35-L1-T1-W500507680225BF9E-L24000000000000  MPIO FC 2145

        Manufacturer................IBM     
        Machine Type and Model......2145            
        ROS Level and ID............0000
        Device Specific.(Z0)........0000063268181002
        Device Specific.(Z1)........0200a04
        Serial Number...............6005076802810A058800000000000168
#
#
  PLATFORM SPECIFIC
#
  Name:  disk
    Node:  disk
    Device Type:  block
# 
vhost 1 SRM
mkvdev -vdev hdisk52 -vadapter vhost1 -dev p50bak
#
backup full database format '/backup/%d_whole_%T_%u_%t_%s_%p' include current controlfile plus archivelog;
channel ORA_DISK_1: starting piece 1 at 05-MAY-18
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup plus archivelog command at 05/05/2018 23:14:18
ORA-19502: write error on file "/oracle/P50/oraflash/P50/backupset/2018_05_05/o1_mf_annnn_TAG20180505T231347_fgvlkvq4_.bkp", block number 1906688 (block size=512)
ORA-27063: number of bytes read/written is incorrect
IBM AIX RISC System/6000 Error: 5: I/O error
Additional information: -1
Additional information: 1048576
#
EAA3D429   0505222318 U S LVDD           PHYSICAL PARTITION MARKED STALE
26120107   0505222318 U S LIBLVM         PHYSICAL VOLUME DEFINED AS MISSING
26120107   0505222318 U S LIBLVM         PHYSICAL VOLUME DEFINED AS MISSING
26120107   0505222318 U S LIBLVM         PHYSICAL VOLUME DEFINED AS MISSING
26120107   0505222318 U S LIBLVM         PHYSICAL VOLUME DEFINED AS MISSING
A6DF45AA   0505221118 I O RMCdaemon      The daemon is started.
2BFA76F6   0505221018 T S SYSPROC        SYSTEM SHUTDOWN BY USER
9DBCFDEE   0505221118 T O errdemon       ERROR LOGGING TURNED ON
192AC071   0505220918 T O errdemon       ERROR LOGGING TURNED OFF
#
bmviewer  pts/1        172.16.3.28            May 05 23:14   still logged in.
bmviewer  pts/0        172.16.3.28            May 05 22:50   still logged in.
bmviewer  pts/0        172.16.3.28            May 05 22:13 - 22:46  (00:32)
reboot    ~                                   May 05 22:11 
shutdown  pts/0                               May 05 22:09 
bmviewer  pts/0        172.16.3.28            May 05 22:05 - System is halted by system administrator.   (00:03)
#
PV Status:      hdisk5  00067a4b431fc609        PVACTIVE
                hdisk6  00067a4b431fc646        PVACTIVE
                hdisk7  00067a4b431fc684        PVACTIVE
                hdisk8  00067a4b431fc6c1        PVACTIVE
                hdisk1  00067a4b638229b5        PVREMOVED
                hdisk2  00067a4b63822a98        PVREMOVED
                hdisk3  00067a4b63822b76        PVREMOVED
                hdisk4  00067a4b63822c49        PVREMOVED
varyonvg: Volume group p50datavg is varied on.
p50datavg
PV Status:      hdisk5  00067a4b431fc609        PVACTIVE
                hdisk6  00067a4b431fc646        PVACTIVE

三.检查lv的pp分布

# lslv -m p50oralv |awk '{print $3,$5}'|uniq
PV1 PV2
hdisk3 hdisk8
hdisk1 hdisk5
hdisk2 hdisk5
hdisk1 hdisk5
hdisk1 hdisk6
hdisk4 hdisk6
hdisk4 hdisk7
hdisk1 hdisk4
hdisk1 hdisk7
hdisk2 hdisk7
# lsvg -p p50datavg
p50datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk5            active            999         0           00..00..00..00..00
hdisk6            active            999         0           00..00..00..00..00
hdisk7            active            999         415         15..00..00..200..200
hdisk8            active            999         0           00..00..00..00..00
hdisk1            removed           999         41          00..41..00..00..00
hdisk2            removed           999         475         00..100..00..175..200
hdisk3            removed           999         40          00..40..00..00..00
hdisk4            removed           999         120         00..120..00..00..00
# 

pv1 2 3 4一组,pv5 6 7 8一组,p50oralv上一个对应hdisk1 hdisk4落在了同一个存储上


备份数据

1.将这4个removed的盘在V7000上做flashcopy,挂载到新的AIX主机,
mkvdev -vdev hdisk3 -vadapter vhost0 -dev p50_data01
mkvdev -vdev hdisk4 -vadapter vhost0 -dev p50_data02
mkvdev -vdev hdisk5 -vadapter vhost0 -dev p50_data03
mkvdev -vdev hdisk6 -vadapter vhost0 -dev p50_data04
mkvdev -vdev hdisk7 -vadapter vhost0 -dev p50_bak
2.在vioc强制导入vg
importvg -y datavg -f hdiskxx
3.数据库可以正常启动

image


修复过程

# chpv -v a hdisk1
# lsvg -p p50datavg
p50datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk5            active            999         0           00..00..00..00..00
hdisk6            active            999         0           00..00..00..00..00
hdisk7            active            999         415         15..00..00..200..200
hdisk8            active            999         0           00..00..00..00..00
hdisk1            active            999         41          00..41..00..00..00
hdisk2            removed           999         475         00..100..00..175..200
hdisk3            removed           999         40          00..40..00..00..00
hdisk4            removed           999         120         00..120..00..00..00
SRMPRD:p50adm 11> lsvg -l p50datavg
p50datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       1       1    open/syncd    N/A
dvdlv               jfs2       100     100     1    open/syncd    /DVD
upgradeoslv         jfs2       40      40      1    open/syncd    /upgradeAIX
sapmntlv            jfs2       40      40      1    open/syncd    /sapmnt
usrsaplv            jfs2       40      40      1    open/syncd    /usr/sap
oraclelv            jfs2       80      80      1    open/syncd    /oracle
p50oralv            jfs2       3200    6400    8    open/syncd    /oracle/P50
paging00            paging     100     200     2    open/syncd    N/A
SRMPRD:p50adm 12> lsvg -p p50datavg
p50datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk5            active            999         0           00..00..00..00..00
hdisk6            active            999         0           00..00..00..00..00
hdisk7            active            999         415         15..00..00..200..200
hdisk8            active            999         0           00..00..00..00..00
hdisk1            active            999         41          00..41..00..00..00
hdisk2            active            999         475         00..100..00..175..200
hdisk3            active            999         40          00..40..00..00..00
hdisk4            active            999         120         00..120..00..00..00

vg镜像不完整,p50oralv有2个pp,其他都是1个pp


一.检查pv的pp状态

lspv -p hdisk1
lspv -p hdisk2
lspv -p hdisk3
lspv -p hdisk4
lspv -p hdisk5
lspv -p hdisk6
lspv -p hdisk7
lspv -p hdisk8
#
SRMPRD:p50adm 24> hdisk1:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-200   used    outer edge    p50oralv            jfs2       /oracle/P50
201-241   free    outer middle                                 
242-400   used    outer middle  p50oralv            jfs2       /oracle/P50
401-599   used    center        p50oralv            jfs2       /oracle/P50
600-799   used    inner middle  p50oralv            jfs2       /oracle/P50
800-999   used    inner edge    p50oralv            jfs2       /oracle/P50
SRMPRD:p50adm 25> lspv -p hdisk2
hdisk2:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-200   used    outer edge    p50oralv            jfs2       /oracle/P50
201-300   free    outer middle                                 
301-400   used    outer middle  p50oralv            jfs2       /oracle/P50
401-500   used    center        paging00            paging     N/A
501-599   used    center        p50oralv            jfs2       /oracle/P50
600-624   used    inner middle  p50oralv            jfs2       /oracle/P50
625-799   free    inner middle                                 
800-999   free    inner edge                                   
SRMPRD:p50adm 26> lspv -p hdisk3
hdisk3:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-200   used    outer edge    p50oralv            jfs2       /oracle/P50
201-240   free    outer middle                                 
241-400   used    outer middle  p50oralv            jfs2       /oracle/P50
401-599   used    center        p50oralv            jfs2       /oracle/P50
600-799   used    inner middle  p50oralv            jfs2       /oracle/P50
800-999   used    inner edge    p50oralv            jfs2       /oracle/P50
SRMPRD:p50adm 27> lspv -p hdisk4
hdisk4:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-200   used    outer edge    p50oralv            jfs2       /oracle/P50
201-320   free    outer middle                                 
321-400   used    outer middle  p50oralv            jfs2       /oracle/P50
401-599   used    center        p50oralv            jfs2       /oracle/P50
600-799   used    inner middle  p50oralv            jfs2       /oracle/P50
800-999   used    inner edge    p50oralv            jfs2       /oracle/P50
SRMPRD:p50adm 28> lspv -p hdisk5
hdisk5:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-200   used    outer edge    p50oralv            jfs2       /oracle/P50
201-201   used    outer middle  loglv00             jfs2log    N/A
202-241   used    outer middle  usrsaplv            jfs2       /usr/sap
242-400   used    outer middle  p50oralv            jfs2       /oracle/P50
401-599   used    center        p50oralv            jfs2       /oracle/P50
600-799   used    inner middle  p50oralv            jfs2       /oracle/P50
800-999   used    inner edge    p50oralv            jfs2       /oracle/P50
SRMPRD:p50adm 29> lspv -p hdisk6
hdisk6:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-200   used    outer edge    p50oralv            jfs2       /oracle/P50
201-300   used    outer middle  dvdlv               jfs2       /DVD
301-400   used    outer middle  p50oralv            jfs2       /oracle/P50
401-599   used    center        p50oralv            jfs2       /oracle/P50
600-799   used    inner middle  p50oralv            jfs2       /oracle/P50
800-999   used    inner edge    p50oralv            jfs2       /oracle/P50
SRMPRD:p50adm 30> lspv -p hdisk7
hdisk7:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-15    free    outer edge                                   
 16-200   used    outer edge    p50oralv            jfs2       /oracle/P50
201-240   used    outer middle  upgradeoslv         jfs2       /upgradeAIX
241-320   used    outer middle  oraclelv            jfs2       /oracle
321-400   used    outer middle  p50oralv            jfs2       /oracle/P50
401-500   used    center        paging00            paging     N/A
501-599   used    center        p50oralv            jfs2       /oracle/P50
600-799   free    inner middle                                 
800-999   free    inner edge                                   
SRMPRD:p50adm 31> lspv -p hdisk8
hdisk8:
PP RANGE  STATE   REGION        LV NAME             TYPE       MOUNT POINT
  1-200   used    outer edge    p50oralv            jfs2       /oracle/P50
201-240   used    outer middle  sapmntlv            jfs2       /sapmnt
241-400   used    outer middle  p50oralv            jfs2       /oracle/P50
401-599   used    center        p50oralv            jfs2       /oracle/P50
600-799   used    inner middle  p50oralv            jfs2       /oracle/P50
800-999   used    inner edge    p50oralv            jfs2       /oracle/P50

VIOC 无法启动  0533 code
Incremental checkpoint up to RBA [0x1f14c.66cd.0], current log tail at RBA [0x1f14f.106c.0]
Mon May 07 00:33:22 2018
Completed checkpoint up to RBA [0x1f14d.2.10], SCN: 942253277
Completed checkpoint up to RBA [0x1f14e.2.10], SCN: 942253360
Completed checkpoint up to RBA [0x1f14f.2.10], SCN: 942253663
Mon May 07 00:59:04 2018
Incremental checkpoint up to RBA [0x1f14f.134e.0], current log tail at RBA [0x1f14f.134e.0]
Mon May 07 01:29:05 2018
Incremental checkpoint up to RBA [0x1f14f.1e27.0], current log tail at RBA [0x1f14f.1e27.0]
Mon May 07 01:59:06 2018
Incremental checkpoint up to RBA [0x1f14f.1e65.0], current log tail at RBA [0x1f14f.1e78.0]
Mon May 07 02:00:00 2018
Closing scheduler window
Closing Resource Manager plan via scheduler window
Clearing Resource Manager plan via parameter
Mon May 07 02:29:08 2018
Incremental checkpoint up to RBA [0x1f14f.2833.0], current log tail at RBA [0x1f14f.2833.0]
#
Mon May 07 10:11:27 2018
Starting ORACLE instance (normal)
sskgpgetexecname failed to get name
LICENSE_MAX_SESSION = 0

重新挂载新的VIOC

rmvdev -vtd p50_data01
rmvdev -vtd p50_data02
rmvdev -vtd p50_data03
rmvdev -vtd p50_data04
#
mkvdev -vdev hdisk3 -vadapter vhost1 -dev p50_data01
mkvdev -vdev hdisk4 -vadapter vhost1 -dev p50_data02
mkvdev -vdev hdisk5 -vadapter vhost1 -dev p50_data03
mkvdev -vdev hdisk6 -vadapter vhost1 -dev p50_data04
mkvdev -vdev hdisk8 -vadapter vhost1 -dev tmp_sys

检查lv的pp分布

SRMPRD:p50adm 4> lsvg -l p50datavg
p50datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       1       1    open/syncd    N/A
dvdlv               jfs2       100     100     1    open/syncd    /DVD
upgradeoslv         jfs2       40      40      1    open/syncd    /upgradeAIX
sapmntlv            jfs2       40      40      1    open/syncd    /sapmnt
usrsaplv            jfs2       40      40      1    open/syncd    /usr/sap
oraclelv            jfs2       80      80      1    open/syncd    /oracle
p50oralv            jfs2       3200    6400    8    open/syncd    /oracle/P50
paging00            paging     100     200     2    open/syncd    N/A
#
lslv -m loglv00     |awk '{print $3,$5}' |uniq 
lslv -m dvdlv       |awk '{print $3,$5}' |uniq 
lslv -m upgradeoslv |awk '{print $3,$5}' |uniq 
lslv -m sapmntlv    |awk '{print $3,$5}' |uniq 
lslv -m usrsaplv    |awk '{print $3,$5}' |uniq 
lslv -m oraclelv    |awk '{print $3,$5}' |uniq 
lslv -m paging00    |awk '{print $3,$5}' |uniq 
lslv -m p50oralv    |awk '{print $3,$5}' |uniq 
#
SRMPRD:p50adm 36> lslv -m loglv00     |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk5 
SRMPRD:p50adm 37> lslv -m dvdlv       |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk6 
SRMPRD:p50adm 38> lslv -m upgradeoslv |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk7 
SRMPRD:p50adm 39> lslv -m sapmntlv    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk8 
SRMPRD:p50adm 40> lslv -m usrsaplv    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk5 
SRMPRD:p50adm 41> lslv -m oraclelv    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk7 
SRMPRD:p50adm 42> lslv -m paging00    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk2 hdisk7
SRMPRD:p50adm 43> lslv -m p50oralv    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk3 hdisk8
hdisk1 hdisk5
hdisk2 hdisk5
hdisk1 hdisk5
hdisk1 hdisk6
hdisk4 hdisk6
hdisk4 hdisk7
hdisk1 hdisk4
hdisk1 hdisk7

1.当前lv是同步状态

SRMPRD:p50adm 71> lsvg -l p50datavg
p50datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       1       1    open/syncd    N/A
dvdlv               jfs2       100     100     1    open/syncd    /DVD
upgradeoslv         jfs2       40      40      1    open/syncd    /upgradeAIX
sapmntlv            jfs2       40      40      1    open/syncd    /sapmnt
usrsaplv            jfs2       40      40      1    open/syncd    /usr/sap
oraclelv            jfs2       80      80      1    open/syncd    /oracle
p50oralv            jfs2       3200    6400    8    open/syncd    /oracle/P50
paging00            paging     100     200     2    open/syncd    N/A

2.将lvpaging00删除副本

  • 2.1 原来的lv pp分布
SRMPRD:p50adm 42> lslv -m paging00    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk2 hdisk7
  • 2.2 将hdisk2上的pp副本删掉
rmlvcopy paging00 1 hdisk2
  • 2.3 结果
# lsvg -l p50datavg
p50datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
...
paging00            paging     100     100     1    open/syncd    N/A

3.将lvp50oralv删除副本

  • 3.1 原来的lv pp分布
SRMPRD:p50adm 75> lslv -m p50oralv    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk3 hdisk8
hdisk1 hdisk5
hdisk2 hdisk5
hdisk1 hdisk5
hdisk1 hdisk6
hdisk4 hdisk6
hdisk4 hdisk7
hdisk1 hdisk4
hdisk1 hdisk7
hdisk2 hdisk7
  • 2.2 将pp分布分成两组1-4,5-8
SRMPRD:p50adm 79> lslv -m p50oralv | grep hdisk1 |grep hdisk4
2860  0883 hdisk1            0980 hdisk4            
2861  0884 hdisk1            0981 hdisk4            
2862  0885 hdisk1            0982 hdisk4            
2863  0886 hdisk1            0983 hdisk4            
2864  0887 hdisk1            0984 hdisk4            
2865  0888 hdisk1            0985 hdisk4            
2866  0889 hdisk1            0986 hdisk4            
2867  0890 hdisk1            0987 hdisk4            
2868  0891 hdisk1            0988 hdisk4            
2869  0892 hdisk1            0989 hdisk4            
2870  0893 hdisk1            0990 hdisk4            
2871  0894 hdisk1            0991 hdisk4            
2872  0895 hdisk1            0992 hdisk4            
2873  0896 hdisk1            0993 hdisk4            
2874  0897 hdisk1            0994 hdisk4            
2875  0898 hdisk1            0995 hdisk4            
2876  0899 hdisk1            0996 hdisk4            
2877  0900 hdisk1            0997 hdisk4            
2878  0901 hdisk1            0998 hdisk4            
2879  0902 hdisk1            0999 hdisk4            
# 将这20个PP在hdisk4上副本迁移到hdisk7上去,也就是将2860-2879这20个LP的第2个副本迁移到hdisk7
migratelp p50oralv/2860/2 hdisk7
migratelp p50oralv/2861/2 hdisk7
migratelp p50oralv/2862/2 hdisk7
migratelp p50oralv/2863/2 hdisk7
migratelp p50oralv/2864/2 hdisk7
migratelp p50oralv/2865/2 hdisk7
migratelp p50oralv/2866/2 hdisk7
migratelp p50oralv/2867/2 hdisk7
migratelp p50oralv/2868/2 hdisk7
migratelp p50oralv/2869/2 hdisk7
migratelp p50oralv/2870/2 hdisk7
migratelp p50oralv/2871/2 hdisk7
migratelp p50oralv/2872/2 hdisk7
migratelp p50oralv/2873/2 hdisk7
migratelp p50oralv/2874/2 hdisk7
migratelp p50oralv/2875/2 hdisk7
migratelp p50oralv/2876/2 hdisk7
migratelp p50oralv/2877/2 hdisk7
migratelp p50oralv/2878/2 hdisk7
migratelp p50oralv/2879/2 hdisk7
  • 2.3 查看lv的pp分布已经在2组hdisk,1-4,5-8
# lslv -m p50oralv    |awk '{print $3,$5}' |uniq
PV1 PV2
hdisk3 hdisk8
hdisk1 hdisk5
hdisk2 hdisk5
hdisk1 hdisk5
hdisk1 hdisk6
hdisk4 hdisk6
hdisk4 hdisk7
hdisk1 hdisk7
hdisk2 hdisk7
  • 2.4 本来想着删除全部的lv副本,重新mirrorvg,换一种方式,将没有副本的lv全部建一个副本
  • 2.5 除了lvp50oralv有副本外,其他的lv只存在hdisk5-8上,将没有副本的lv创建副本到hdisk1-4上
# lsvg -l p50datavg
p50datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       1       1    open/syncd    N/A
dvdlv               jfs2       100     100     1    open/syncd    /DVD
upgradeoslv         jfs2       40      40      1    open/syncd    /upgradeAIX
sapmntlv            jfs2       40      40      1    open/syncd    /sapmnt
usrsaplv            jfs2       40      40      1    open/syncd    /usr/sap
oraclelv            jfs2       80      80      1    open/syncd    /oracle
p50oralv            jfs2       3200    6400    8    open/syncd    /oracle/P50
paging00            paging     100     100     1    open/syncd    N/A
#mklvcopy testlv 2 hdisk11
mklvcopy loglv00     2 hdisk1 hdisk2 hdisk3 hdisk4
mklvcopy dvdlv       2 hdisk1 hdisk2 hdisk3 hdisk4
mklvcopy upgradeoslv 2 hdisk1 hdisk2 hdisk3 hdisk4
mklvcopy sapmntlv    2 hdisk1 hdisk2 hdisk3 hdisk4
mklvcopy usrsaplv    2 hdisk1 hdisk2 hdisk3 hdisk4
mklvcopy oraclelv    2 hdisk1 hdisk2 hdisk3 hdisk4
mklvcopy paging00    2 hdisk1 hdisk2 hdisk3 hdisk4
  • 2.6 同步lv
syncvg -f -l dvdlv
syncvg -f -l upgradeoslv
syncvg -f -l sapmntlv
syncvg -f -l usrsaplv
syncvg -f -l oraclelv
syncvg -f -l paging00
  • 2.7 结果已经同步
p50datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       2       2    open/stale    N/A
dvdlv               jfs2       100     200     2    open/syncd    /DVD
upgradeoslv         jfs2       40      80      2    open/syncd    /upgradeAIX
sapmntlv            jfs2       40      80      2    open/syncd    /sapmnt
usrsaplv            jfs2       40      80      2    open/syncd    /usr/sap
oraclelv            jfs2       80      160     2    open/syncd    /oracle
p50oralv            jfs2       3200    6400    8    open/syncd    /oracle/P50
paging00            paging     100     200     2    open/syncd    N/A
  • 2.8 最后检查lv的pp分布是不是落在两边
# lslv -m loglv00     |awk '{print $3,$5}' |uniq
PV1 PV2
hdisk5 hdisk4
# lslv -m dvdlv       |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk6 hdisk2
# lslv -m upgradeoslv |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk7 hdisk4
# lslv -m sapmntlv    |awk '{print $3,$5}' |uniq
PV1 PV2
hdisk8 hdisk4
# lslv -m usrsaplv    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk5 hdisk1
# lslv -m oraclelv    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk7 hdisk2
# lslv -m paging00    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk7 hdisk2
# lslv -m p50oralv    |awk '{print $3,$5}' |uniq 
PV1 PV2
hdisk3 hdisk8
hdisk1 hdisk5
hdisk2 hdisk5
hdisk1 hdisk5
hdisk1 hdisk6
hdisk4 hdisk6
hdisk4 hdisk7
hdisk1 hdisk7
hdisk2 hdisk7

# lsvg -l p30datavg
p30datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       2       2    open/syncd    N/A
dvdlv               jfs2       140     280     2    open/syncd    /DVD
upgradeoslv         jfs2       40      80      2    open/syncd    /upgradeAIX
sapmntlv            jfs2       20      40      2    open/syncd    /sapmnt
usrsaplv            jfs2       160     320     2    open/syncd    /usr/sap
oraclelv            jfs2       80      160     2    open/syncd    /oracle
p30oralv            jfs2       800     1600    2    open/syncd    /oracle/P30
paging00            paging     100     200     2    open/syncd    N/A
# lsvg -p p30datavg
p30datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk3            active            999         598         40..59..99..200..200
hdisk4            active            999         59          00..00..00..00..59
hdisk1            removed           999         598         40..59..99..200..200
hdisk2            removed           999         59          00..00..00..00..59
p30datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk3            active            999         598         40..59..99..200..200
hdisk4            active            999         59          00..00..00..00..59
hdisk1            removed           999         598         40..59..99..200..200
hdisk2            removed           999         59          00..00..00..00..59
# chpv -v a hdisk1
0516-1010 chpv: Warning, the physical volume hdisk1 has open logical 
        volumes.  Continuing with change.
# chpv -v a hdisk2
0516-1010 chpv: Warning, the physical volume hdisk2 has open logical 
        volumes.  Continuing with change.
# lsvg -p p30datavg
p30datavg:
PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
hdisk3            active            999         598         40..59..99..200..200
hdisk4            active            999         59          00..00..00..00..59
hdisk1            active            999         598         40..59..99..200..200
hdisk2            active            999         59          00..00..00..00..59
# lsvg -l p30datavg
p30datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
loglv00             jfs2log    1       2       2    open/syncd    N/A
dvdlv               jfs2       140     280     2    open/syncd    /DVD
upgradeoslv         jfs2       40      80      2    open/syncd    /upgradeAIX
sapmntlv            jfs2       20      40      2    open/syncd    /sapmnt
usrsaplv            jfs2       160     320     2    open/syncd    /usr/sap
oraclelv            jfs2       80      160     2    open/syncd    /oracle
p30oralv            jfs2       800     1600    2    open/syncd    /oracle/P30
paging00            paging     100     200     2    open/syncd    N/A
# 
posted @ 2018-05-07 13:39  Jenvid  阅读(1131)  评论(0编辑  收藏  举报