Posted on 10-10-2018 02:37 PM
Hi Team,
I need to create 5 different script which need to break from one mail shell script. we have two system for data processing. in my case ODS2 is pulling data from ODS1.
We need to prepare 5 parallel script for parallel processing to execute following procedure in parallel.
prompt "Populating ODS2 "
exec od2_b_pull.dbp_pull_ODS1_to_ODS2('SP.world','A','TFII');
exec od2_b_pull.dbp_pull_ODS1_to_ODS2('BR.world','I','TFII');
exec od2_b_pull.dbp_pull_ODS1_to_ODS2('NY.world','I','TFII');
exec od2_b_pull.dbp_pull_ods1_to_ods2('DBAG1.WORLD','A','DBAG');
exec od2_b_pull.dbp_pull_ods1_to_ods2('DB24.WORLD','A','DB24');
main script -
LOG_FILE=${LOG_DIR}/fin_prod_tnx_diff_process.date +%Y%m%d
.$$.log
export ORACLE_SID=$DB01_ORA_SID
echo "Executing Diff Fin products processing program date
" > $LOG_FILE
${sqlplus} ${TFMIS_CONN_STR_825} <<!EOF 1>>${LOG_FILE} 2>&1
prompt "Populating ODS2 "
exec dbp_pullpurge_tfii3_add();
exit;
!EOF
echo "Completed Diff Fin products processing program date
" >> $LOG_FILE
export ORACLE_SID=$DB02_ORA_SID
echo "Delete rows where decode_flg is null in mdbt_c_chrg_tnx table date
" > $LOG_FILE
${sqlplus} ${TFMIS_CONN_STR_ODS2} <<!EOF 1>>${LOG_FILE} 2>&1
prompt "Deleting decode_flg"
delete from mdbt_c_chrg_tnx where decode_flg is null;
commit;
exit;
!EOF
echo "Completed deleting decode_flg date
" >> $LOG_FILE
LOG_FILE=${LOG_DIR}/misstg2stg0.date +%Y%m%d
.$$.log
export ORACLE_SID=$DB02_ORA_SID
echo "Executing Stage star upload programs date
" > $LOG_FILE
${sqlplus} ${TFMIS_CONN_STR_ODS2} <<!EOF 1>>${LOG_FILE} 2>&1
prompt "Populating ODS2 "
exec od2_b_pull.dbp_pull_ODS1_to_ODS2('SP.world','A','TFII');
exec od2_b_pull.dbp_pull_ODS1_to_ODS2('BR.world','I','TFII');
exec od2_b_pull.dbp_pull_ODS1_to_ODS2('NY.world','I','TFII');
exec od2_b_pull.dbp_pull_ods1_to_ods2('DBAG1.WORLD','A','DBAG');
exec od2_b_pull.dbp_pull_ods1_to_ods2('DB24.WORLD','A','DB24');
prompt "Populating stage "
exec dbp_ods2_to_stg0;
exit;
!EOF
if [ $? -ne 0 ]
then
echo "
Error in executing Sqlplus function" |tee -a ${LOG_FILE}
exit 1
fi
rm nohup.out
nohup sh ods1ods2diffall.sh >/dev/null 2>&1 &
echo "Completed Stage star upload programs date
" >> $LOG_FILE
Posted on 10-11-2018 01:42 PM
Not sure exactly what your asking, but if your wanting to start one task, seperate it away and start another task simultaneously you can do it like this
#!/bin/bash
sleep 10 &
#This will seperate out sleep and allow another command while sleep continues in the background
(
sleep 10
say hello
) &
#This will seperate out both lines as a seperate process and allow a new command leaving them continueing in the background, useful if you want to pass a loop away to the background.