Last week our DBA team needed to generate a dump in order to backup data and then restore that dump into another DB instance... which belonged to a DB server in a different LPAR. Our first approach was to compress the dump -a propietary binary format file- and then tranfer it over a ssh'ed connection. So far, so good. Considered scalability? The dump was about 400 gigabytes and we didn't want to stress our administrative VLAN. Besides, it was time to learn how to migrate a Volume Group!
Here's the environment
Source host : aix-sourcelpar
Target host : aix-targetlpar
File system : /fsmigrate
Logical Volume : lvmigrate
Volume Group : vgmigrate
Physical Volume : hdisk72
LUN : 5006996870340050780000000000011F
And here's the how-to
Tasks issued in source host:
Identify the physical volume
$ lsvg -p vgmigrate
hdisk72 00cb7e62c8dcbcbc vgmigrate
Identifiy the LUN
# pcmpath query device 72 |head -n 3
DEV#: 72 DEVICE NAME: hdisk72 TYPE: 2145 ALGORITHM: Load Balance
SERIAL: 5006996870340050780000000000011F
Unmount the file system
$ sudo umount /fsmigrate
Deactivate the Volume Group
# varyoffvg vgmigrate
Export the Volume Group
#exportvg vgmigrate
Let's verify
# lsvg |grep vgmigrate
--> should not be shown...
Remove the device
# rmdev -dl hdisk72
hdisk72 deleted
Tasks issued in the IBM Storewize V7000 command line interface:
Identify the LUN based on the LUN ID
Unmap LUN from source host
$ svctask rmvdiskhostmap -host 9 260
Search for the LUN in the unmapped LUN pool
Identify the LUN
Map LUN to target host
$ svctask mkvdiskhostmap -force -host 21 -scsi 70 260
Tasks issued in target host:
List Physical Volumes before the migration
$ lspv > /tmp/beforemigra
Configure new device
# cfgmgr
List Physical Volumes after migration
$ lspv > /tmp/aftermigra
Verify migrated Physical Volume
$ diff /tmp/beforemigra /tmp/aftermigra
74a75
> hdisk174 00cb7e62c8dcbcbc None
Import the vgmigrate Volume Group
# importvg -y vgmigrate hdisk174
Verify the new Logical Volume and file system
# lsfs
/dev/lvmigrate -- /fsmigrate jfs2 5238685696 rw yes no
Mount the filesystem
# mount /fsmigrate
The dump is ready in /fsmigrate to be picked up and restored.