Renaming an ASM diskgroup in 10g

Since their is no “alter diskgroup rename” command, I tried this on a test system and it works.  Pretty cool, but this not even remotely supported by oracle, so use at your own risk 🙂

With everything down…

cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk ikfed
for f in $(ls /dev/raw/raw* | grep -v rawctl); do
  echo "Processing DATA disk $file ..."
  search=CURRENT_DISKGROUP_NAME
  replace=NEW_DISKGROUP_NAME
  newlength=$(echo $replace | wc -m)
  newlength=$newlength-1
  shortname=$(echo $f | cut -f 6 -d /)
  kfed op=read dev=$f | sed -e '24,24s/ '$search' / '$replace' /' -e '24,24s/length=.*/length='$newlength'/' > /tmp/$shortname.kfed
  kfed op=write dev=$f text=/tmp/$shortname.kfed CHKSUM=YES
done

change all parameters that reference the old diskgroup name
mount database
rename datafiles and redo logs
catalog archivelogs (if any)
open database

Make sure you are only doing ASM disks. In other words /dev/raw/raw* may give too many devices, so filter as necessary in your environment.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.