Truncate a project

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Amos.Rosmarin
Premium Member
Premium Member
Posts: 385
Joined: Tue Oct 07, 2003 4:55 am

Truncate a project

Post by Amos.Rosmarin »

Hi there,

I'm looking for a script that truncates a project - delete all non-default components: jobs, routines, table definitions etc.

I can always delete and create the project but I want to do it automatically so it has to be done from the command line.


Any one know howto do it ?

Amos
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi Amos,
While I'm not familiar with the inside stuf and perhaps you'll have problems getting that info (I hope I'm wrong)
There is always the last course of action, which is to write a code, for example with tcl/tk or any language that you prefer and can do such things, that will emulate the interactive use of the DS Administrator.
So for truncating a project you need to perform a delete and create operation with the same project name which will be this program's parameter.

IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I don't know how to do it from the UNIX command line.

Even if you could do it from the DataStage command prompt (>), there are way too many separate components to drop or remove (as appropriate) ever to be conveniently loaded into a single command.

To create such a command (set of commands run from a script) would require more knowledge about the structure of the Repository than has been published by Ascential, and therefore is venturing into dangerous waters!

I'd strongly recommend staying with delete project, create project. Two mouse clicks!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Amos.Rosmarin
Premium Member
Premium Member
Posts: 385
Joined: Tue Oct 07, 2003 4:55 am

Post by Amos.Rosmarin »

Thanks Ray

What do you think about using a unix rm and cp command ??
delete the contant of the project directory
and then copy the content of an empty project into the project directory.

I think that if I do it while the dsEngine is down it is qiute safe .... am I right ??


Amos
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

That would almost work but the indexes would pointing to the wrong place. Indexes have the full path in them. There is a command to fix them or you can delete them and recreate them through DS.TOOLS or manually.

I agree with Ray. Delete the project and then recreate it is much safer.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you delete the entire contents of the directory you're also taking out the software - what you called the "default conmponents".
Further, there are administrative entries in the Admin (UV) account and in the SQL Catalog, as well as secondary indexes already mentioned, that would need to be repaired.
Again, don't attempt it!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
datastage
Participant
Posts: 229
Joined: Wed Oct 23, 2002 10:10 am
Location: Omaha

Post by datastage »

this might be a shot in the dark. I'm not sure (and I think we are all wondering) why you have this need in the first place to truncate a project, but depending on what you need to do I'm curious if something like this would work for you: Could you possibly create many projects in advance (manually) with some sort of sequence number appended to the project them. Then if you have a program that is reloading the projects you can keep a store of the next project and then load to this project.

It depends on what you are doing, but you could create projects in advance and delete the old ones as needed, and thus you could still have some sort of automated program that could always find a clean project to begin with
Byron Paul
WARNING: DO NOT OPERATE DATASTAGE WITHOUT ADULT SUPERVISION.

"Strange things are afoot in the reject links" - from Bill & Ted's DataStage Adventure
Amos.Rosmarin
Premium Member
Premium Member
Posts: 385
Joined: Tue Oct 07, 2003 4:55 am

Post by Amos.Rosmarin »

I was thinking of a way to create a loop that goes over DS_JOBS and for each jobno delets the RT_LOGxx, RT_BPxx etc....
Then does clear.file ds_jobs and ds_jobobjects
After this goes to the DS_routines and DS_METADATA

In this way truncate the project

Do you think it's feasible
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Try it and let us know.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

For the third and last time, don't do it!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Ray

Let him do it. They don't want our advice anyway. I want to see how many problems this will create.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm still really curious why someone would "need" to do this. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
datastage
Participant
Posts: 229
Joined: Wed Oct 23, 2002 10:10 am
Location: Omaha

Post by datastage »

Yes, Amos...you really need to let us curious minds know what technical/business requirement is driving your need to truncate a project!

Let's see how creative we can be too. As far as this comment:
I was thinking of a way to create a loop that goes over DS_JOBS and for each jobno delets the RT_LOGxx, RT_BPxx etc....
Then does clear.file ds_jobs and ds_jobobjects
After this goes to the DS_routines and DS_METADATA

I think this would get you close, but surely there are a few things that would be overlooked with that method. I'm too tired to try to think of other things this might miss at the moment, perhaps Ray can come up with a something good that will prevent an attempts of truncating a project.
Byron Paul
WARNING: DO NOT OPERATE DATASTAGE WITHOUT ADULT SUPERVISION.

"Strange things are afoot in the reject links" - from Bill & Ted's DataStage Adventure
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just the sheer possibility that you might miss something.

What's in all those other Repository tables? The design-time information as well as the run-time information? What records ought you not to be removing? What about hashed files in non-project directories? System table entries for any UV tables created (which therefore should be dropped properly)? DSNs for ODBC (in the DSEngine directory as well as in uvodbc.config)? Modifications to DSParams - undo or keep? The list goes on - would you get them all?

Can we get a "stop sign" emoticon? :twisted:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Let him do it. Cause more problems than it would solve. Please try it. I think it is a terrible idea but go for it. Let us know what kind of problems you have.
Mamu Kim
Post Reply