Operating System - HP-UX
1826414 Members
4112 Online
109692 Solutions
New Discussion

move data from one PV to another

 
Rajesh R_2
Frequent Advisor

move data from one PV to another

Hi,

I have added a PV to one of my existing VG and extended the filesystem. This filesystem contains the oracle database dbf file. Now I would like to remove that new PV which I added due to some problem with that PV. But when I do a pvdisplay -v, I see most of the physical extents on that PV are used. But the database tablespace was not extended after I extended the filesystem. So, I feel there would not be any data on that PV.

Can anybody suggest me the best way to remove that PV from the VG without corrupting the database or the filesystem. This is a production server.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: move data from one PV to another

Shalom,

1) You need a cold backup before proceeding.
2) You can not be sure there is no data on the physical volume, if the logical volume and file system were extended you will be wrong.
3) I recommend cold backup, destruction of the entire logical volume, vgreduce the pv from the volume group, lvcreate, lvextend, newfs and restoring a backup.

That methodology may seem harsh and hard. But it does insure you lose no data.

vgreduce -f requires that the logical volume be removed from the second pv, and that can not be done safely with the database running, or any portion of the database on that volume. Even if there is nothing on that pv, you might cause corruption of the logical volume.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
sujit kumar singh
Honored Contributor

Re: move data from one PV to another

Hi,


the same thread i have replied in there i hope so ... I agree with what SEP has to say ..

please add to that

hello Rajesh,


pvmove is a command that can surely serve the purpose but once if this gets interrupted in between it can lead the source and the destination both in an inconsistent state for sure and the data will surely be gone.

Make sure that u have the full backup and a reliable one for that filesystem before u can give a try to pvmove.

As this conatins dbf files, i will suggest u to do a tape backup using fbackup /tar etc and umount the filesys,remove old LV, create new LV using lvrecreate , mount the LV and restore the data.


Mkae sure that u have a reliable backup before u do a lvrmove and recreate the LV.


that is anyway a safe way of doing that.


Regards
sujit
Rajesh R_2
Frequent Advisor

Re: move data from one PV to another

Hi,

can I do the pvmove when the database is up and running?

Thanks
Rajesh
Olivier Masse
Honored Contributor

Re: move data from one PV to another

pvmove works well and is stable - I must have used it at least one hundred times to reorganize LUNs or shrink the size of a VG. It takes a while tough, you have to be patient.