How to handle full refresh situation if job fails?

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
bond88
Participant
Posts: 109
Joined: Mon Oct 15, 2012 10:05 am
Location: USA

How to handle full refresh situation if job fails?

Post by bond88 »

Hi,
How to handle the situation if a job fails in full refresh? I mean in full refresh first it is going to truncate table and then it will start insert new records. If there is any primary key violation or some other error might causes to fail that job then at that time target would be ended up with no data. I want to have atleast previous data (before truncating).

Thanks,
Bhanu
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

DataStage won't backup data for you if you choose to truncate your target table. An alternative would be to rename the original table in before-SQL, let DataStage create a new target-table for you. This way you can cleanup easily in case of errors at the cost of keeping a renamed copy of your original data at least until the current load has finished successfully.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
bond88
Participant
Posts: 109
Joined: Mon Oct 15, 2012 10:05 am
Location: USA

Post by bond88 »

@BI-RMA

Thank you,
Currently I am doing that, I am using stage objects and once if it is successful then I am copying to target from stage objects. I was wondering there is anyway to handle this situation without using stage objects.

Thanks,
Bhanu
Post Reply