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


 
Thread Tools Search this Thread
Operating Systems AIX 2.6TB filesystem to be copied or moved to another FS ?
# 1  
Old 12-18-2010
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
Code:
 
# 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




---------- 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
# 2  
Old 12-18-2010
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
# 3  
Old 12-18-2010
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.
# 4  
Old 12-19-2010
Quote:
Originally Posted by filosophizer
1) What is the fastest way to copy or mirror it to another filesystem without shutting down production vg ( oracle is using the filesystem )
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.

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

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

4. 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.
# 5  
Old 12-19-2010
thank you everyone for the suggestions,

Also came across this IBM tech note on this subject

Quote:
Originally Posted by for archival purpose
https://www-304.ibm.com/support/docv...d=isg3T1000167
https://www.ibm.com/i/c.gif Moving a JFS/JFS2 File System to a New Volume Group

https://www.ibm.com/i/c.gif Technote (FAQ) Question Moving a JFS/JFS2 File System to a New Volume Group
Answer This document describes how to move a journaled file system (JFS) or enhanced journaled file system (JFS2) from one volume group to another. Information in this document applies to AIX Versions 4 and 5.
Moving file systems from one volume group to another
Logical volumes specific to rootvg
Related documentation Moving file systems from one volume group to another

ATTENTION: Make sure a full backup exists of any data you intend to migrate before using these procedures.
In AIX, storage allocation is performed at the volume group level. Storage cannot span volume groups. If space within a volume group becomes constrained, then space that is available in other volume groups cannot be used to resolve storage issues.
The solution to this problem is to add more physical volumes to the relevant volume group. This may not be an option in all environments. If other volume groups contain the required free space, the alternative is to move the required logical volumes to the desired volume group and expand them as needed.
The source logical volume can be moved to another volume group with the cplv command. The following steps achieve this.
ATTENTION: The logical volume should be inactive during these steps to prevent incomplete or inconsistent data. If the logical volume contains a mounted file system, then that file system should be unmounted first. If this logical volume is being used as a RAW storage device, then the application using this logical volume should close the device or be shut down.
  1. Copy the source logical volume to the desired volume group with the cplv command. For example, where myvg is the new volume group and mylv is the name of the user's logical volume, enter:
    cplv -v myvg mylv
    This will return the name of the new logical volume, such as lv00. If this logical volume was being used for RAW storage, skip to to step 6. If this is a JFS or JFS2 file system, proceed to step 2. Note that RAW storage devices should NOT use the first 512 bytes of the RAW device. This is reserved for the LVCB or logical volume control block. cplv will not copy the first 512 bytes of the RAW logical volume, but it will update fields in the new logical volume's LVCB.
  2. All JFS and JFS2 file systems require a log device. This will be a logical volume with a type of jfslog or jfs2log for JFS2 file systems. Run the lsvg -l <VGNAME> command on your destination volume group. If a JFS or JFS2 log DOES NOT already exist on the new volume group, create one by using the mklv and logform commands as detailed below. If a JFS or JFS2 log DOES exist, proceed to step 3. With a JFS2 filesystem, you also have the option of using an inline log. With inline logs, the jfs2log exists on the filesyster itself. After the cplv command is ran on a JFS2 inline log filesystem, run:
    logform /dev/lvname
    You should receive a message about formatting the inline log. If you do not receive a message about an inline log, then this filesystem is not a JFS2 inline log filesystem and you should treat it as a regular JFS2 filesystem. After hitting y on formatting the inline log, continue to step 3.
    To make a new JFS log, enter the following command, where myvg is the name of the new volume group, enter:
    mklv -t jfslog myvg 1
    To make a new JFS2 log, enter:
    mklv -t jfs2log myvg 1
    This will return a new logical volume of either type jfslog or jfs2log, such as loglv00. This new logical volume will need to be formatted with the logform command in order to function properly as either a JFS or JFS2 log. For example:
    logform /dev/loglv00
    Answer yes to destroy.
  3. Change the filesystem to reference a log device that exists in the new volume group and the new logical volume with the chfs command. For example, where myfilesystem is the name of the user's filesystem, enter:
    chfs -a dev=/dev/lv00 -a log=/dev/loglv00 /myfilesystem
    With inline logs on JFS2 filesystems this command is also different:
    chfs -a dev=/dev/lv00 -a log=INLINE /myfilesystem
  4. Run fsck to ensure filesystem integrity. Enter: fsck -p /dev/lv00
    NOTE: It is common to receive errors after running fsck -p /dev/lvname prior to mounting the filesystem. These errors are due to a known bug that development is currently aware of and which will be resolved in a future release of AIX. Once the filesystem is mounted, a future fsck with the filesystem unmounted should no longer produce an error.
  5. Mount the file system. For example, where myfilesystem is the name of the user's file system, enter:
    mount /myfilesystem
    At this point, the migration is complete, and any applications or users can now access the data in this filesystem. To change the logical volume name, proceed to the following step.
    NOTE: If you receive errors from the preceding step, do not continue. Contact you AIX support center.
  6. Remove the source logical volume with the rmlv command. For example, where mylv is the name of the user's logical volume, enter:
    rmlv mylv
  7. Rename and reset any needed attributes on the new logical volume with the chlv or chmod commands. In order to rename the logical volume, the filesystem or raw logical volume must be in a closed state. For example, where mylv is the new name you wish to change lv00 to be, enter:
    chlv -n mylv lv00
Logical volumes specific to rootvg

The following logical volumes and file systems are specific to the rootvg volume group and cannot be moved to other volume groups:
Logical Volume File System or Description
------------------------------------------------------
hd2 /usr
hd3 /tmp
hd4 /
hd5 <boot logical volume>
hd6 <primary paging space>
hd8 <primary JFS or JFS2 log>
hd9var /var
Related documentation

For more in-depth coverage of this subject, the following IBM publications are recommended:

  • AIX Version 4.3 System Management Guide: Operating System and Devices
  • AIX Version 5.1 System Management Guide: Operating System and Devices
  • AIX Version 4.3 Commands Reference (references for chfs, chlv, and cplv)
  • AIX Version 5.1 Commands Reference
  • AIX Version 5.2 Commands Reference


Cross Reference information Segment Product Component Platform Version Edition Operating SystemAIXInstallation- backup- restore


Historical Number isg1pTechnote0280
but please check these fixpacks as CPLV has some problems
https://www-304.ibm.com/support/docv...1fixinfo106826
https://www-304.ibm.com/support/docv...id=isg1IY92078

Quote:
http://unix.derkeiler.com/Mailing-Li...3-04/0416.html

Moving a JFS FIle to a New Volume Group

1. backup data you intend to migrate
2. unmount fs where lv resides
3. copy the source logical volume to the desired volume group with the cplv
command.
For example, where myvg is the NEW volume group and mylv is the name of
the user's
logical volume, enter:

cplv -v myvg mylv

4. All JFS require a log device. If JFS log does not already exists on the
new volume group,

mklv -t jfslog myvg 1

This will return a new jfslog such as loglv00. This will need to be
reformatted with the
logform command to function as a JFS log.

logform /dev/loglv00

5. Change the filesystem to reference a log device that exists in the new vg
and the new
logical volume with the chfs command.

For example where myfilesystem is the name of the user's filesystem,
enter:

chfs -a dev=/dev/lv00 -a log=/dev/loglv00 /myfilesystem

6. RUn fsck to ensure filesystem integrity,

fsck -p /dev/lv00

7. Mount the file system. For example, where myfilesystem is the name of the
user's
file system, enter:

mount /myfilesystem

At this point the migration is complete and any applications or users can
now access the
data in this filesystem. To change the logical volume name, proceed to
step 8. Note: If you receive errors from the preceding step do not continue, contact AIX
support center.

8. Remove the source logical volume with the rmlv command:

rmlv mylv

9. Rename and reset any needed attributes on the new logical volume with the
chlv or chmod commands.

For example, where mylv is the name of the user's logical volume, enter:

chlv -n mylv lv00
-------------------------------------------------------------

Joe Leyden

-----Original Message-----
From: Green, Simon [mailto:Simon.Green@EU.ALTRIA.COM]
Sent: Wednesday, April 30, 2003 9:36 AM
To: aix-l@Princeton.EDU
Subject: Re: move logical volume and file system to different vg

Sorry: I obviously wasn't clear. They were intended as three completely
independent alternatives, not three related steps.

Simon Green
Altria ITSC Europe s.a.r.l.

AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2
AIX FAQ at http://www.faqs.org/faqs/aix-faq/

N.B. Unsolicited email from vendors will not be appreciated.
# 6  
Old 12-19-2010
Smilie
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 Smilie
regards
zxmaus
# 7  
Old 12-19-2010
Quote:
Originally Posted by zxmaus
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
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
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. AIX

Mount Filesystem in AIX Unable to read /etc/filesystem

Dear all, We are facing prolem when we are going to mount AIX filesystem, the system returned the following error 0506-307The AFopen call failed : A file or directory in the path name does not exist. But when we ls filesystems in the /etc/ directory it show -rw-r--r-- 0 root ... (2 Replies)
Discussion started by: m_raheelahmed
2 Replies

2. Solaris

Solaris Filesystem vs. Windows FileSystem

Hi guys! Could you tell me what's the difference of filesystem of Solaris to filesystem of Windows? I need to compare both. I have read some over the net but it's so much technical. Could you explain it in a more simpler term? I am new to Solaris. Hope you help me guys. Thanks! (4 Replies)
Discussion started by: arah
4 Replies

3. UNIX for Dummies Questions & Answers

hwo to find shared filesystem and local filesystem in AIX

Hi, I wanted to find out that in my database server which filesystems are shared storage and which filesystems are local. Like when I use df -k, it shows "filesystem" and "mounted on" but I want to know which one is shared and which one is local. Please tell me the commands which I can run... (2 Replies)
Discussion started by: kamranjalal
2 Replies

4. UNIX for Dummies Questions & Answers

Using sudo scp -r – can't get everything copied though

I want to copy a folder and all its contents of ~700GB from a computer to another. I've tried sudo scp -r directory/ admin@host:directory but the result is that the copied folder is about 2GBs smaller than the original. I checked the shell for errors and found some "file doesn't exist" errors.... (2 Replies)
Discussion started by: MJH
2 Replies

5. Solaris

Check copied file

Hi all, If i wanted to copy file within different folders or different servers, how do i determine the copied file is absolutely correct :confused: Is it using cmp and chksum command enough? Anyway that i can make further checking? Thanks in advance for reading & anyone who reply the... (7 Replies)
Discussion started by: beginningDBA
7 Replies

6. Solaris

Filesystem - error when extend the filesystem

Hi all, currently , my root filesystem already reach 90 ++% I already add more cylinder in the root partition as below Part Tag Flag Cylinders Size Blocks 0 root wm 67 - 5086 38.46GB (5020/0/0) 80646300 1 swap wu 1 - ... (11 Replies)
Discussion started by: SmartAntz
11 Replies
Login or Register to Ask a Question