Sie sind auf Seite 1von 2

select UOM_TYPE_CODE, UOM_VALUE, CONVERSION_FACTOR, CONVERSION_OFFSET, 'U' from (select UOM_TYPE_CODE, UOM_VALUE, CONVERSION_FACTOR, CONVERSION_OFFSET from stag e_uom_conv_prev

minus select UOM_TYPE_CODE, UOM_VALUE, CONVERSION_FACTOR, CONVERSION_OFFSET from stage _uom_conv_current) UNION ALL select UOM_TYPE_CODE, UOM_VALUE, CONVERSION_FACTOR, CONVERSION_OFFSET, 'I' from (select UOM_TYPE_CODE, UOM_VALUE, CONVERSION_FACTOR, CONVERSION_OFFSET from stag e_uom_conv_current minus select UOM_TYPE_CODE, UOM_VALUE, CONVERSION_FACTOR, CONVERSION_OFFSET from stage _uom_conv_prev) echo -e Table Name: $PMT_TMS_BUSINESS@TableName >/infa_shared/imatica/GQDW/Scripts/TMS_WEEKLY_COMMON_REFRESH_TABLES_status.txt; echo Source Affected Rows: $PMSQ_T_TMS_BUSINESS@numAffectedRows >>/infa_shared/imatica/GQDW/Scripts/TMS_WEEKLY_COMMON_REFRESH_TABLES_status.txt; echo Source Applied Rows: $PMSQ_T_TMS_BUSINESS@numAppliedRows >>/infa_shared/imatica/GQDW/Scripts/TMS_WEEKLY_COMMON_REFRESH_TABLES_status.txt; echo Source Rejected Rows: $PMSQ_T_TMS_BUSINESS@numRejectedRows >>/infa_shared/imatica/GQDW/Scripts/TMS_WEEKLY_COMMON_REFRESH_TABLES_status.txt; echo Target Affected Rows: $PMT_TMS_BUSINESS@numAffectedRows >>/infa_shared/imatica/GQDW/Scripts/TMS_WEEKLY_COMMON_REFRESH_TABLES_status.txt; echo Target Applied Rows: $PMT_TMS_BUSINESS@numAppliedRows >>/infa_shared/imatica/GQDW/Scripts/TMS_WEEKLY_COMMON_REFRESH_TABLES_status.txt; echo -e Target Rejected Rows: $PMT_TMS_BUSINESS@numRejectedRows '\n''\n' >>/infa_shared/imatica/GQDW/Scripts/TMS_WEEKLY_COMMON_REFRESH_TABLES_status.txt; #This script is intended to call the DBA pre load activites procedure and to che ck its status. #!/bin/ksh echo $1 $2 $3 'tmsdba01' 't_tms_business' 'tmsfpabsl' status=$(sqlplus -s ifodba01/imag1ne@gqdwp.corporate.ge.com <<EOF execute ifodba01.preload_proc('$1','$2'); EOF) echo Preload Procedure called status:$status sleep 300 value=$(sqlplus -s ifodba01/imag1ne@gqdwp.corporate.ge.com <<EOF set head off; select PRELOAD_STATUS from ifodba01.unix_load_tables where LOAD_NAME='$3'; EOF) echo Preload Column Status:$value datestam=$(echo $value cut -d '@' -f 1) echo Cut Preload Column Status:$datestam testdate="Success " echo Test Date:$testdate if (test "$datestam" = "$testdate")then echo " The preload procedure was sucessfull on $value.Hence no need to enter t

he loop. " else currentstate="In Progress " echo Current Status:$currentstate echo "entering the loop, will take soem time to succeed" echo " The preload process is not success." while [ "$datestam" = "$currentstate" ] do sleep 10 echo "entered the loop" value=$(sqlplus -s ifodba01/imag1ne@gqdwp.corporate.ge.com <<EOF set head off; select PRELOAD_STATUS from ifodba01.unix_load_tables where LOAD_NAME='$3'; EOF) datestam=$(echo $value cut -d '@' -f 1) echo $datestam done fi if (test "$datestam" = "$testdate")then echo " The status is success" touch /infa_shared/imatica/GQDW/Scripts/status.done else echo " The preload process at the DBA end has failed." fi *************Log file out put***************** tmsdba01 t_tms_business tmsfpabsl Preload Procedure called status: PL/SQL procedure successfully completed. Preload Column Status: Success @01-NOV-11 Cut Preload Column Status:Success Test Date:Success The preload procedure was sucessfull on Success @01-NOV-11.Hence no need to enter the loop. The status is success ******************* cat /infa_shared/imatica/GQDW/Scripts/TMS_WEEKLY_COMMON_REFRESH_TABLES_status.tx t mail -s "TMS_WEEKLY_COMMON_REFRESH_TABLES Load Status:`cut /infa_shared/ima tica/GQDW/SrcFiles/tmsfptshpdtl1.dat -d"~" -f2 head -1`" TMSWbmstr@Corporate. ge.com cis.oicops@ge.com Ramji.Sarangarajan@ge.com DWOffshore.USTRTSTeam@ge.com

Das könnte Ihnen auch gefallen