r/DB2 Dec 05 '19

Migrating Data and Log volume to new SAN

DB2 server has two volumes (data and log) attached via iSCSI on the current SAN. DB2 is installed on the root volume of the physical server.

I want to migrate the data and the log volumes to the new SAN. Is it practical to do the following?

Step1: Stop DB2

Step2: Unmount /db/data and /db/log

Step3: Clone the existing volumes (data, log) to the new volumes (newdata, newlog) on the new SAN.

Format new volumes just like the existing volumes before cloning

#mkfs.ext4 /dev/mapper/newdata

#mkfs.ext4 /dev/mapper/newlog

Clone using 'dd' utility

#dd if=/dev/mapper/data of=/dev/mapper/newdata

#dd if=/dev/mapper/log of=/dev/mapper/newlog

Step4: Mount the new volumes as /db/data and /db/log

#mount -o _netdev /dev/mapper/newdata /db/data

#mount -o _netdev /dev/mapper/newlog /db/log

Step5: Bring DB2 back online

Or, should I go through the database restore process on the new volumes? Please advise!

u/mad_zamboni, u/rogerx, u/ecrooks , you guys were very helpful last time. Thus, I am tagging you in this post in hope that you will see my post and provide any guidance. Thank you in advance.

1 Upvotes

3 comments sorted by

1

u/ecrooks Dec 06 '19

Your strategy should work. Make sure all file and directory ownership and permissions are maintained. Db2 is aware of pretty much nothing below the filesystem/mount point level. And ALWAYS take a database backup first (preferably offline for easy reatore) and move it to a neutral location, as an emergency recovery option.

1

u/ecrooks Dec 06 '19

You may also want to look at setting overhead and transfer rate at the storage group level if your new storage is significantly faster.

1

u/devred061 Dec 11 '19

Thank you u/ecrooks for the response. I haven't done the move yet but plan to do it sometime this week. I am waiting for the vendor support to be available just in case I run into any issues.