#!/usr/bin/ksh
MIG_BIN=/backup/HDDDB/mig/bin
MIG_LOG=/backup/HDDDB/mig/log
MIG_DMP=/backup/HDDDB/mig/dmp
cd /oracle2/app/oracle/product/816
. ./.profile
################################################
cd $MIG_BIN
SMS_LOG1=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "delete_start_v2."}'`
SMS_LOG2=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "delete_end_v2."}'`
smssend2.sh 0112682488 0221667454 $SMS_LOG1
#sqlplus -s hddsm/hddsm11 <
#exit
#EOF
smssend2.sh 0112682488 0221667454 $SMS_LOG2
DEL_LOG=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "delete_wbl_v2.log"}'`
cp delete_wbl_v2.log $DEL_LOG
sqlplus -s hddsm/hddsm11 <
alter procedure atest_lob_in_backup_wbl_v2 compile;
exec atest_lob_in_backup_wbl_v2;
@report_wbl_v2
@export_wbl_v2
exit
EOF
EXP_FILE=`cat export_file_v2.log|head -1`
EXP_FILE_LOG=`cat export_file_v2.log | head -1 | nawk -F. '{print $1 ".log"}'`
DAY_FILE="["`date +'%Y-%m%d'`"]_"$EXP_FILE
CREATE_LOG=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "create_wbl_v2.log"}'`
REPORT_LOG=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "report_wbl_v2.log"}'`
EXPORT_FILE_LOG=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "export_file_v2.log"}'`
EXPORT_LOG=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "export_wbl_v2.log"}'`
TIVOLI_LOG=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "tivoli_wbl_v2.log"}'`
BACKUP_LOG=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "backup_wbl_v2.log"}'`
SMS_LOG3=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "bak_tbl_created_v2."}'`
SMS_LOG4=`cat export_file_v2.log | head -1 | nawk -FW '{print $1 "export_end_v2."}'`
smssend2.sh 0112682488 0221667454 $SMS_LOG3
exp parfile=export_wbl_v2.par file=export_wbl_v2.dmp log=export_wbl_v2.log
cp export_wbl_v2.log $MIG_DMP/$EXP_FILE_LOG
cp export_wbl_v2.dmp $MIG_DMP/$EXP_FILE
dsmc a -archmc=HDDDB_OLD_MGMT $MIG_DMP/$EXP_FILE > tivoli_wbl_v2.log
smssend2.sh 0112682488 0221667454 $SMS_LOG4
################################################
BAK_LOG=`date +'%Y-%m%d'`"_WBL_V2.log"
echo " " > $BAK_LOG
echo "==== DELETE BACKUPED DATA V2 =====================================================" >> $BAK_LOG
echo ".................................................................................." >> $BAK_LOG
cat $SMS_LOG1 >> $BAK_LOG
echo ".................................................................................." >> $BAK_LOG
cat $DEL_LOG >> $BAK_LOG
echo ".................................................................................." >> $BAK_LOG
cat $SMS_LOG2 >> $BAK_LOG
echo ".................................................................................." >> $BAK_LOG
echo " " >> $BAK_LOG
cat report_wbl_v2.log >> $BAK_LOG
echo " " >> $BAK_LOG
echo "==== EXPORT BACKUP TABLE V2 ======================================================" >> $BAK_LOG
echo ".................................................................................." >> $BAK_LOG
cat export_wbl_v2.log >> $BAK_LOG
echo " " >> $BAK_LOG
echo "==== FILE SYSTEM USAGE STATUS ====================================================" >> $BAK_LOG
echo ".................................................................................." >> $BAK_LOG
df -k /arch | head -2 ; df -k /arch | tail -1 >> $BAK_LOG
echo ".................................................................................." >> $BAK_LOG
df -k /backup | head -2 ; df -k /backup | tail -1 >> $BAK_LOG
echo ".................................................................................." >> $BAK_LOG
ls -ltr *.dmp | head -2 ; ls -ltr *.dmp | tail -1 >> $BAK_LOG
echo " " >> $BAK_LOG
echo " " >> $BAK_LOG
echo "==== EXPORT FILE BACKUP V2 : TSM =================================================" >> $BAK_LOG
echo ".................................................................................." >> $BAK_LOG
dsmc q arch $MIG_DMP/$EXP_FILE | tail -4 >> $BAK_LOG
echo " " >> $BAK_LOG
mailx -s "HDDDB : BACKUP REPORT <
mailx -s "HDDDB : BACKUP REPORT <
cp $BAK_LOG $MIG_BIN/backup_wbl_v2.log
mv $BAK_LOG $MIG_LOG/$BAK_LOG
cp create_wbl_v2.log $CREATE_LOG
cp report_wbl_v2.log $REPORT_LOG
cp export_file_v2.log $EXPORT_FILE_LOG
cp export_wbl_v2.log $EXPORT_LOG
cp tivoli_wbl_v2.log $TIVOLI_LOG
cp backup_wbl_v2.log $BACKUP_LOG
################################################
EOF
댓글 없음:
댓글 쓰기