Oracle LUN Migration ext3 or ocfs2

7:04 PM

This is a how-to focused on migrating from one LUN to another LUN where Oracle data is stored on ext3 or ocfs2 filesystems. This is not relevant to ASM filesystems.
Once your new LUN has been provisioned by storage there are two ways to discover the new LUN(s)
 
 1. Force a scan of the SCSI bus - this can be done uptime
 echo "scsi-qlascan" > /proc/scsi/qla2xxx/[0/1] - perform for each target there is 0/1/2/3, etc...
 echo "- - -">/sys/class/scsi_host/hostX/scan (repeat for all X)
 /sbin/multipath -v 3
 /sbin/multipath -ll
 
 2. shutdown -r now  -  this must be scheduled downtime
 
Once you've discovered your new LUN, proceed to the following steps:
 
 - Make sure you identify the new LUN path in '/dev/mapper/' this can usually be performed with a combination of
'df -h' to identify existing LUN's mountpoints an 'ls -l /dev/mapper/mpath*' or an 'multipath -ll'
Be sure to know which mpath is the new LUN since any ASM filesystems use raw unmounted, there may be mpaths showing that are not mounted, but are indeed in use with ASM.
'raw -qa' will show you if any rawdevices in use on server.
 
Format your new LUN - if this is an Oracle db server the DBA will perform the formatting and mounting so that it will be set per the needs of the specific database on the server.
 - mkfs.ext3 /dev/mapper/mpathX
or if ocfs2 use ocfs2console in vnc, select the proper dm-? and set label and node count, then format
 - create new directory on / as the name you want the new lun mounted as example:  mkdir /sd05
 - Mount the new san to /sd05: mount -t ext3 or ocfs2 /dev/mapper/mpathX /sd05
 - Modify fstab for the new mount if ext3 or ocfs2
 
During Maintenance:
CLUSTERED or NON CLUSTERED environment:
Shutdown the oracle database, if RAC, shutdown all instances
Copy the data from current location to new location using rysnc
 - time rsync -av --stats /sd01/oradata/ /sd05/oradata (The trailing '/' on the first directory matters)
Startup mount the database, if RAC, do this on only one instance
-  rename all the datafiles that were copied to new lun in oracle system dictionary using alter database rename file commands, script this ahead to avoid any user error in name
Open the database and verify all datafile locations are correct
- umount the old san
- ensure fstab is updated accordingly for future reboots
 
Confirm everything is up and running as expected
   

You Might Also Like

1 comments

Contact Form

Name

Email *

Message *

Translate

Wikipedia

Search results