How to drop Teradata Work Tables automatically

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
chrisjones
Participant
Posts: 194
Joined: Thu May 11, 2006 9:42 am

How to drop Teradata Work Tables automatically

Post by chrisjones »

Hi Frineds ,
My Job is creating work tables while loading data into Taeradata after every run in my database ,so how to avoid this or how to drop after every DS Job run.
Thanks,
Chris Jones
ccatania
Premium Member
Premium Member
Posts: 68
Joined: Thu Sep 08, 2005 5:42 am
Location: Raleigh
Contact:

Post by ccatania »

For a normal run you can specify to have your error tables drop, this is in the script portion-Before-of the Teradata stage. The work files are created when you have a abend, which someone must address. In my office since we are paged to address abends, we manually delete the error and work tables after seeing the error. Part of the recovery procedure.
Charlie
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create a script to drop the tables and execute this in a job sequence after the Job activity that runs the job. If there is an unconditional trigger from the Job activity to this Execute Command activity, the tables will be dropped irrespective of the status of the job (which may be inconvenient for troubleshooting).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chrisjones
Participant
Posts: 194
Joined: Thu May 11, 2006 9:42 am

How to drop Teradata Work Tables automatically

Post by chrisjones »

Thanks for your info..
Please let me know how to drop as they are generated with different names at run time..so how to capture them and delete.
ray.wurlod wrote:Create a script to drop the tables and execute this in a job sequence after the Job activity that runs the job. If there is an unconditional trigger from the Job activity to this Execute Command acti ...
Thanks,
Chris Jones
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No idea. Depends on how the names were generated. If you can, store the names somewhere (a file?) in the job that creates them, and pick them up from there in the script. Basically, you need some mechanism for transmitting the table names back to the job sequence (or generating them there in the first place). Another possibility is to query the system tables based on date/time created.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply