2.6TB filesystem to be copied or moved to another FS ?

Hi folks,

I have a filesystem which is 2.6TB big and would like to copy/mirror this filesystem on another volume group.

1) What is the fastest way to copy or mirror it to another filesystem without shutting down production vg ( oracle is using the filesystem )

2) Is there any way to estimate how long it will take to copy/mirror the filesystem if it is required to shutdown Oracle ?

/u03 is the filesystem which has to be copied/moved to another new filesystem

two options which i thought of:
(1) to mirrorvg ie., mirror oraclevg to the new vg but this process will be very slow if ORACLE is running is continuously accessing the filesystem /u03 while mirror process is under way.

(2) shutdown oracle, use copy filesystem command and move it, but need to know how long will it take to move 2.6TB since Oracle cannot be down for more than 10 hours

 # lspv
  hdisk0          000f4c011b1e8d57                    rootvg          active
  hdisk1          000f4c017d3b0cd9                    rootvg          active
  hdisk2          000f4c01fc5f525f                    oraclevg        active
  hdisk4          000f4c01b4e565d1                    oraclevg2       active
  hdisk3          000f4c01d80cdc0b                    oraclevg        active
  # lsvg -l oraclevg
  oraclevg:
  LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
  loglv00             jfs2log    1       1       1    open/syncd    N/A
  fslv01              jfs2       5178    5178    2    open/syncd    /u03
   
   
  # lsvg -p oraclevg
  oraclevg:
  PV_NAME           PV STATE          TOTAL PPs   FREE PPs    FREE DISTRIBUTION
  hdisk2            active            4079        0           00..00..00..00..00
  hdisk3            active            1100        0           00..00..00..00..00
  #
   
  # lsvg oraclevg
  VOLUME GROUP:       oraclevg                 VG IDENTIFIER:  000f4c010000d9000000011dfc87db92
  VG STATE:           active                   PP SIZE:        512 megabyte(s)
  VG PERMISSION:      read/write               TOTAL PPs:      5179 (2651648 megabytes)
  MAX LVs:            256                      FREE PPs:       0 (0 megabytes)
  LVs:                2                        USED PPs:       5179 (2651648 megabytes)
  OPEN LVs:           2                        QUORUM:         2 (Enabled)
  TOTAL PVs:          2                        VG DESCRIPTORS: 3
  STALE PVs:          0                        STALE PPs:      0
  ACTIVE PVs:         2                        AUTO ON:        yes
  MAX PPs per VG:     30480
  MAX PPs per PV:     5080                     MAX PVs:        6
  LTG size (Dynamic): 256 kilobyte(s)          AUTO SYNC:      no
  HOT SPARE:          no                       BB POLICY:      relocatable

[/FONT]

---------- Post updated at 12:30 PM ---------- Previous update was at 07:30 AM ----------

I did little research on the internet and found few documents which showed the recommended procedure

1) either by backup and restore ( which will preserve the file permissions and inode information )

2) cplv

now regarding cplv, no document points out the following and i hope some knows the answer here on the forum

1) can it be used to copy 2.6 TB ? since it is very big filesystem ?

2) will it preserve file permissions and inode information ?

3) what is the transfer/copy speed ? this is important to know since cplv can be only done when the filesystem is unmounted ( not in use ) so 2.6TB takes like 2 days then have to go with another solution like backup and restore.

thanks

Hi,

if you are running AIX 6.1, create and mount the new filesystem with nolog + noatime option. Than just do cp -hpr the .dbf files and whatever else you have from the old to the new filesystem. When the DB is down, this should not take more than a couple of hours (I copied more than 4 TB in just over 8 hrs not too long ago while a few other DBs were even up and running). You need to have the DB down which you copy, or the copy will be corrupted / useless. Permissions, ownership and even timestamps are preserved.

Hope that helps
regards
zxmaus

As usual, the transfer rate almost certainly has more to do with your disks and disk controllers and I/O buses than what program you use. It will take as long as it takes.

I suppose that the mirrorlv soution will be on of the fastest methods and probably the one with the least hassle. I would, being in your place, prefer to go for this solution.

In case this is not possible for whatever reason, here is a suggestion, you will have to fill in some blanks. It assumes that there is (almost) nothing else than the DB-files on the filesystem.

  1. Set the database into "hot backup" mode. I don't know exactly how this is done, but every Oracle DBA knows for sure what I'm talking about. Basically this is making the database aware that a file-backup is taken while it is running. The file-backup as such will be considered inconsistent but along with the archive logs taken during the backup it can be made consistent. Oracle has special provisions for doing exactly this built in.

Note that the redo-logs created this way contain more info than normal redo-logs and the rate of logswitches will increase. Your DBA should be able to estimate how big the factor of the increase will be.

  1. Take a file-backup from the running database. You can use whatever system means there are: TSM, tar, cp , ....

  2. After the backup has finished rotate out the active redo-logs and set the database to normal again.

  3. After restoring the copy to some other diskspace start the database and make it consistent by applying the archive-logs taken since the start of the backup-process. The DB then is consistent and equal to the original at the time of the end of the backup process.

thank you everyone for the suggestions,

Also came across this IBM tech note on this subject

but please check these fixpacks as CPLV has some problems

:slight_smile:
All solutions will work - the question is always what you achieve. cplv will maintain the fileallocation tables - not sure if this is what you want. If your DB exists for a long time, that this is rather big and over time slowing down all filesystem accesses. Creating a new filesystem will create a new clean fileallocation table, so this would always be my choice but that is probably just a matter of personal taste. I like Bakunins solution too as that would achieve the same but it makes me dependant on a DBA and I like to be independant :slight_smile:
regards
zxmaus

Well, actually it amounts to 2-3 commands typed into SQLPlus - I'd ask the DBA to tell me how its done and put it into my documentation, so i never have to ask him again. ;-))

bakunin

Well, if you can afford it - you may standup a standby (Oracle-Standby) database and decide a date and shutdown the real DB and convert the new database as the production. If you plan it well, you might be done with an Hour downtime. In the worst case, backout is to shutdown the new database and startup the old. ( 5 mins ? ). I am sure change management is going to like this one. Very similar to the hot backup solution someone posted.

If all you want is to move to new disks, the storage vendor might have some utilities as well. BCV for local copies and SRDF for copy across arrays in the EMC world. (I assumed you have SAN storage)

okay, cplv has failed

1) I had a filesystem with 200G allocation with actual Data of 100.6 GB
so I created another filesystem with 245 GB and tried to copy with cplv command and i got a message to use chlv with -t parameter ; so i didn't understand why i should change the type when they are both same type of filesystem JFS2 ?

so, i skipped and went to another option , cplv to user-create logical volume ( that is the system will create the logical volume by itself )

2) cplv to user-create logical volume is taking more than 1.1 hour and still the copy was not finished and I had to cancel/abort the operation because users needed the filesystem to copy 100.6 GB (total filesystem size 200GB) Logical Volume to another logical volume is taking more than 1.1 hours
any suggestions ?

some suggested copying files and directories but Oracle team is avoiding this approach.

mirrorlv for the above example : filesystem of 200G allocation with actual Data of 100.6 GB takes around 3.5 hours.

Note: the filesystem / logical / volume group is from SAN Storage connected by one 4 GB fiber.

so we are here copying a filesystem/logical volume from SAN Storage to SAN Storage.

So, if 200G logical volume takes 3.5 hours with mirrorlv imagine 2.6TB ?
around 40 hours or so ?

next I will try to cp as zxmaus or as bakunin said, will backup and restore.

Folks, there is a small problem. After using cplv and log was created and initialized and a new filesystem ( new name for filesystem) was mounted on that Logical Volume. But after mounting it, I didn't see any data !

but lsvg volume_group shows PPs are in use.

any clue as to what might be the issue ?

do you have a new mountpoint or the same - maybe it is just overmounted with something else

BTW - if you only want to move to new SAN - but not necessarily to a new volumegroup - why dont you just add the new disks to the existing VG and do a migratepv olddisk newdisk(s) and drop the old empty disks afterwards from the VG. This is for sure not the fastest but the easiest way as it doesnt need ANY downtime whatsoever.

Regards
zxmaus

It is a new mount point..

Okay here is what happened:

  1. Created a new VG ==> oraclevg6
  2. cplv logical volume from oldvg to newvg ( and the system created lv called fslv06 )
  3. after the cplv was over lsvg -l oraclevg6 ==> showed that there is a log logical volume called loglv01
  4. create a filesystem with a new name and not the existing one for the copied logical_volume call it /u06
  5. mount /u06 on fslv06
  6. doesn't work...umount /u06
  7. logform /dev/loglv01
  8. mount /u06

still no data present.

==========

No, it cannot be done for various administrative reasons.

  1. the array is different and new san is different
  2. Database team want to have the new disks totally seperate.
  3. the above experiment was with 200GB and it took 3.5 - 4 hours....what about 2.6TB...... ? and if something goes wrong then the company application might need a total restore.
    too risky !

I think the problem may be the new filesystem on the copied lv.
Here's what I did on a test filesystem and it worked fine:

  1. Created new lv
# mklv -y lvcorenew -t jfs2 data2vg 32
  1. changed new lv to be type 'copy'
# chlv -t copy lvcorenew
  1. Ran cplv
# cplv -e lvcorenew -f lvcore
  1. Created new jfs2log for the new lv
# mklv -y corelog -t jfs2log data2vg 1
  1. Formated the new jfs2log
# logform /dev/corelog
  1. Modified the existing filesystem to use the newly copied lv
# chfs -a dev=/dev/lvcorenew -a log=/dev/corelog /usr/local/corefiles
  1. Mounted fs
# mount /usr/local/corefiles
  1. Check filesystem
# ls /usr/local/corefiles  
1 Like

homeyjoe, thank you for the post.

Just wondering why you have changed the logical volume type to copy ?

  1. changed new lv to be type 'copy'

I didn't do this step, but would like to know the reason behind changing the type. When I created a logical volume and tried to copy it ( as i mentioned in the previous post ) i got an error and the message was :: Change the type of the logical volume with chlv command ...
At that time, i didn't understand why it needs to be changed and into what ...

So, I skipped, and I let the system create the logical volume and copy....So, when I chose the second option, I am not sure if AIX will automatically change the logical volume type to copy ?

Also, after successful mounting do i need to change the type to something else in-order to make the logical volume into write mode ?

Since I made a new LV with my naming scheme, and not letting AIX create a generic-named LV, I had to set the type to 'copy' (per the cplv error code that you saw).
When you do a 'lsvg -l VGname' you will see that it's a 'copy' type instead of the usual jfs, jfs2, paging, etc. Once the cplv command is complete then the LV will be listed as jfs/jfs2 instead of copy.

Happy AIX-ing!

guys the cplv didn't work.
I tried all the steps homeyjoe mentioned.

here is scenario

1) hdisk3 = testvg1 = 100MB = fslv02 = 20 pps = /testv1

2) hdisk4 = testvg2 = 200MB = testlv = 20 pps

did all the steps mentioned by homeyjoe but after mounting with another name /testv2 ; no data was present in the filesystem....
so, I renamed the original mount point /testv1 so that i can mount the copied logical volume filesystem as /testv1 and still no data present !!

  • Do the logical volumes need to be of exact size ?
  • Are there any additional steps missing ?

Filosophizer - Did you do a different command than what I listed in Step #6 since you say that you created another filesystem (/testv2)? I'm guessing this may be where the procedure I listed is failing for you.

Just so you know, when I do it my way I ended up with 2 lv's but only one filesystem. I had lvcore in rootvg and lvcorenew in data2vg. Only lvcorenew showed a filesystem mounted on it though (/usr/local/corefiles). So after verifying the files were present in /usr/local/corefiles I deleted the old lv (lvcore) in rootvg.

I've done this procedure multiple times over the years so I'm guessing there's something that you are doing differently.

I followed your steps as you listed, and for step #6 i did as you mentioned:
two ways to do
through smitty ... add a filesystem on existing defined logical volume and in the section of LOG i mentioned the log logical form.

or through command you gave.

now step #6
# chfs -a dev=/dev/lvcorenew -a log=/dev/corelog /usr/local/corefiles rather it should be

# chfs -a dev=/dev/lvcorenew -a log=/dev/corelog /filesystem_name

otherwise you will get an error chfs: 0506-915 No record matching /usr/local/corefiles was found in /etc/filesystems.

I think the problem is in step 6
/usr/local/corefiles should be filesystem name or something else ?

Right - /usr/local/corefiles is the name of my filesystem that I was moving from rootvg to data2vg. You will have to change that accordingly. Same with the lv names I was using. Sorry if I confused you!