Delete Job Difference

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Delete Job Difference

Post by swades »

Hi,

What is difference between
-Delete a job from manager and
-Delete a job from Admin command line

Code: Select all

DELETE FROM DS_JOBS WHERE NAME = 'JOB_NAME';
I notice that if i delete job from command line it leaves DS_TEMP,RT_BP,RT_CONFIG,RT_LOG,RT_STATUS - Files under that project directory.

so if i have to delete all jobs under a project (That for new release in production -backup-delete-import new code) , what is preferable way to do?
-through Manager or -through Command Line.?
:?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The TCL DELETE command is not documented and, as you noted, does not really delete a job but deletes only the entry in the DS_JOBS hashed file. I don't know where you got this from but perhaps it came from some post here in DSXchange and is almost certainly taken out of context. This is one reason that I am hesitant to post internal code - when used outside of the scope of the original thread it can be damaging and usually people will say "but the told me to do it on DSXchange" afterwards...

Anyway, the only correct way to delete jobs is from the graphical interface, be it in the designer, director or manager. That way you are ensured that all references to a job are removed.

In your case you should run DS.CHECKER to clean up your orphaned files.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

I also notice here that,
when i create new job ,its just overwrite the orphaned files -starting from 1 JOBNO.

and i do see here new things, as i created only 3 new jobs,
SELECT NAME FROM DS_JOBS WHERE JOBNO = '4';
Job name............

\\NextNumber

1 records listed.
so its save next job no some where?
:?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The "\\NextNumber" entry in the DS_JOBS table holds the next job number. Hashed file records can have any format, and it happens that field 1 is used to store the next number in that record, but it is also the column used for JOBNO (in the actual job records), which is why this query returned this record.

When you creat a new job it will not overwrite anything, since that NextNumber counter only goes upwards. Unless you deleted that entry or changed it, in which case it might overwrite existing files.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

I execute this command in my dev. environment

Code: Select all

DELETE FROM DS_JOBS
thats how that counter set to 1. And its just overwrite that orphaned files for new jobs.
what is risk factor to overwrite this orphaned files ?(just for knowledge)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Unless you delete the orphaned files (DS.CHECKER) you will not be able to create a new job number 1.

To delete all jobs in the project the simplest method is to delete the project, then re-create it in the same location.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Using the TCL commands directly to delete entries in the DataStage hashed files that contain job metadata is a prelude to finding out if your project backups have worked. You will corrupt jobs and/or the whole project by deleting things from the DS_JOBS (or DS_JOBOBJECTS).

You should go and edit the DS_JOBS entry for '\\NextNumber" and set field 1 to an integer higher than any job number you currently have in the project in order to avoid corrupting existing jobs. Then run DS.CHECKER to clean up orphaned files.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

Thanks ArndW and Ray,

We delete jobs from manager.
Post Reply