#!/usr/bin/ksh #set -xv # Program : smenu_asm.sh # Author : Bernard Polarski # date : 09 October 2007 # with age I become extremly lazy. Most script taken from dbasupport.com # instead of typing mine. I need to be slashed a bit like slaves in pharaonic time # in order to revigorate a bit. # 12 December 2007 added 'asm -mv' to move easily files in ASM from diskgroups HOST=`hostname` PAR1=$1 function help { cat < EOF } if [ -z "$1" ];then help exit fi while [ -n "$1" ] do case "$1" in -h ) help; exit ;; -d ) SQL="col path format a50 col failgroup format a9 select group_number, disk_number, mount_status, header_status, state, path, failgroup from v\$asm_disk;" ;; -slo ) CHOICE="SLO" ;; -tpl ) CHOICE="TPL" ;; -g ) SQL="SELECT group_number,name,state,TOTAL_MB, FREE_MB,USABLE_FILE_MB, BLOCK_SIZE ,UNBALANCED,REQUIRED_MIRROR_FREE_MB from v\$asm_diskgroup;" ;; -dv ) CHOICE="DV" ;; -l ) CHOICE="FILE" ;; -f ) SQL="select group_number, name, total_mb, free_mb, state, type from v\$asm_diskgroup;" ;; -cli ) CHOICE="CLIENT" ;; -a ) CHOICE="ALIAS" ;; -p ) CHOICE="PERF" ;; -mv ) CHOICE=MV ; FILE_ID=$2; DISKGROUP=$3 ; shift; shift ;; * ) help; exit ;; esac shift done . $SBIN/scripts/passwd.env . ${GET_PASSWD} $S_USER $ORACLE_SID if [ "x-$CONNECT_STRING" = "x-" ];then echo "could no get a the password of $S_USER" exit 0 fi if [ "$CHOICE" = "MV" ];then if [ -z "$DISKGROUP" ];then echo "I need a target disk group" exit fi if [ -z "$FILE_ID" ];then echo "I need a SOURCE FILE ID " exit fi VAR=`sqlplus -s "$CONNECT_STRING" <