#!/bin/ksh # ---------------------------------------------------------------------------- # Filename: vxcreate.ksh # Purpose: Create volume to be added to Oracle database as raw file # (Veritas Volume Manager required) # Author: Frank Naude, Oracle FAQ # ---------------------------------------------------------------------------- ### Create volumes cat x.map | grep -v '^#' | while read VOL DG SIZ TS do ((SIZ=SIZ*1024*1024/512+100)) echo "Create volume $VOL in $DG with size $SIZ" NCOL=`vxprint -htg $DG | grep '^dm' | wc -l | awk '{print $1}'` vxassist -g $DG -U gen make $VOL $SIZ layout=stripe,nolog stripewidth=64k ncol=$NCOL vxedit -g ${DG} set user=oracle $VOL vxedit -g ${DG} set group=dba $VOL vxedit -g ${DG} set mode=660 $VOL done #### Add volumes to Oracle database . ~oracle/.profile cat x.map | grep -v '^#' | while read VOL DG SIZ TS do echo "Create tablespace $TS.." if [ $TS = "NONE" ]; then continue; fi sqlplus -s /nolog <<-EOF connect system/manager create tablespace $TS DATAFILE '/dev/vx/rdsk/$DG/$VOL' size ${SIZ}M; alter tablespace $TS ADD DATAFILE '/dev/vx/rdsk/$DG/$VOL' size ${SIZ}M; exit; EOF done ### Sample MAP file: ### ---------------- # ccms_redo01 DG6206 500 NONE # ccms_redo02 DG6206 500 NONE # ccms_redo03 DG6206 500 NONE # ccms_control01 DG6207 100 NONE # ccms_control02 DG6206 100 NONE # ccms_control03 DG6205 100 NONE # ccms_userdata01 DG6201 1000 DATA_USER # ccms_userindex01 DG6202 1000 INDEX_USER # ccms_infokeydata01 DG6203 1000 INFOKEY_DATA # ccms_infokeyindex01 DG6204 500 INFOKEY_INDEX # ccms_rbs01 DG6205 1000 RBS # ccms_system01 DG6206 500 SYSTEM # ccms_temp01 DG6206 1000 TEMP # ccms_tools01 DG6207 100 TOOLS #