#!/bin/sh TSMUSER=user TSMPASS=pass TSMSERVER=tsmsrv echo "Melyik library elerhetetlensege esetere generaljam le a technikai poolokat, mukodteto scripteket?" dsmadmc -id=$TSMUSER -pa=$TSMPASS -se=$TSMSERVER -dataonly=y "q libr" printf ": "; read LIBRARY echo "Melyik library-be iranyitsuk at a tape forgalmat a $LIBRARY-bol, ha az nem elerheto?" printf ": "; read DR_LIBRARY echo "Mi legyen a device class neve a $DR_LIBRARY-ben, amin a technikai poolokat letrehozom?" dsmadmc -id=$TSMUSER -pa=$TSMPASS -se=$TSMSERVER -dataonly=y "select DEVCLASS_NAME from devclasses where library_name='$DR_LIBRARY'" printf ": "; read DR_DEVCLASS echo "Milyen suffix-u storage poolokhoz generaljam le a technikai poolokat? (Pl: _T)" printf ": "; read SUFFIX echo "Mi legyen a technikai poolok suffix-a? (Pl: _TE)" printf ": "; read DR_SUFFIX echo echo "Akkor diktalom mit kell csinalni...:" # Technikai poolok létrehozása echo "Technikai poolok letrehozasa:" dsmadmc -id=$TSMUSER -pa=$TSMPASS -se=$TSMSERVER -dataonly=y "select 'def stg ' || replace(stgpool_name,'$SUFFIX','') || '$DR_SUFFIX $DR_DEVCLASS col=no reclaimpr=2 recl=100 maxscr=' || maxscratch from stgpools where stgpool_name like '%$SUFFIX'" echo # Éles poolról technikai poolra állító szkript legenerálása: echo "Eles poolrol technikai poolra allito szkript legeneralasa:" echo "def scr ${LIBRARY}_CRASH desc=\"$LIBRARY library kieses eseten a tape forgalmat atiranyitja az $DR_LIBRARY library-be\"" dsmadmc -id=$TSMUSER -pa=$TSMPASS -se=$TSMSERVER -dataonly=y "select 'upd scr ${LIBRARY}_CRASH \"UPD STG ' || replace(stgpool_name,'$SUFFIX','') || '$DR_SUFFIX NEXTSTG='''' HI=100\"' from stgpools where stgpool_name like '%$SUFFIX'" echo "upd scr ${LIBRARY}_CRASH \"/*----------------------------------------------------*/\"" dsmadmc -id=$TSMUSER -pa=$TSMPASS -se=$TSMSERVER -dataonly=y -displ=tabl "select 'upd scr ${LIBRARY}_CRASH \"UPD STG ' || stgpool_name || ' NEXTSTG=' || replace(stgpool_name,'$SUFFIX','') || '$DR_SUFFIX ACCESS=UNAVAILABLE\"' from stgpools where stgpool_name like '%$SUFFIX'" | sed 's/ *$//' echo # A forgalmat az éles poolba visszairányító szkript legenerálása: echo "A forgalmat az eles poolba visszairanyito szkript legeneralasa:" echo "def scr ${LIBRARY}_RENEW desc=\"Az $DR_LIBRARY library-bol visszairanyitja a tape forgalmat a $LIBRARY-be\"" dsmadmc -id=$TSMUSER -pa=$TSMPASS -se=$TSMSERVER -dataonly=y "select 'upd scr ${LIBRARY}_RENEW \"UPD STG ' || stgpool_name || ' NEXTSTG='''' ACCESS=READWRITE\"' from stgpools where stgpool_name like '%$SUFFIX'" echo # A technikai poolokba képződött adatokat visszamigráló szkript legenerálása: echo "A technikai poolokba kepzodott adatokat visszamigralo szkript legeneralasa:" echo "def scr ${DR_LIBRARY}_TO_${LIBRARY}_MIGR desc=\"Az $LIBRARY library elerhetetlensege alatt az $DR_LIBRARY library-be kepzodott adatok visszamigralasa a $LIBRARY-be\"" dsmadmc -id=$TSMUSER -pa=$TSMPASS -se=$TSMSERVER -dataonly=y -displ=tabl "select 'upd scr ${DR_LIBRARY}_TO_${LIBRARY}_MIGR \"UPD STG ' || replace(stgpool_name,'$SUFFIX','') || '$DR_SUFFIX NEXTSTG=' || stgpool_name || ' HI=0 LO=0\"' from stgpools where stgpool_name like '%$SUFFIX'" | sed 's/ *$//' echo "upd scr ${DR_LIBRARY}_TO_${LIBRARY}_MIGR \"select '# NE FELEJTSD A DRIVE-OKAT VISSZAALLITANI ONLINE-BA A(Z) ${LIBRARY}-BEN!' as EMLEKEZTETO from sysibm.sysdummy1\"" echo # ${LIBRARY} oldali DRIVE-okat Offline-ba állító szkript legenerálása: echo "${LIBRARY} library DRIVE-okat Offline-ba allito szkript legeneralasa:" echo "def scr ${LIBRARY}_OFFLINE desc=\"${LIBRARY} drive-okat offline-ba teszi\"" dsmadmc -id=$TSMUSER -pa=$TSMPASS -se=$TSMSERVER -dataonly=y -displ=tabl "select 'upd scr ${LIBRARY}_OFFLINE \"UPD DR ' || library_name || ' ' || drive_name || ' ONL=N\"' from drives where library_name='${LIBRARY}'" | sed 's/ *$//' echo # ${LIBRARY} oldali DRIVE-okat Online-ba állító szkript legenerálása: echo "${LIBRARY} library DRIVE-okat Online-ba allito szkript legeneralasa:" echo "def scr ${LIBRARY}_ONLINE desc=\"${LIBRARY} drive-okat online-ba teszi\"" dsmadmc -id=$TSMUSER -pa=$TSMPASS -se=$TSMSERVER -dataonly=y -displ=tabl "select 'upd scr ${LIBRARY}_ONLINE \"UPD DR ' || library_name || ' ' || drive_name || ' ONL=Y\"' from drives where library_name='${LIBRARY}'" | sed 's/ *$//'