Renaming and deleting a dataset

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

splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Renaming and deleting a dataset

Post by splayer »

I have 2 datasets, A and B. I would like to delete A and rename B to A. I figured I would do:

orchamin delete A.ds
orchadmin copy B.ds A.ds
orchadmin delete B.ds

I am doing this in an After-job routine by using ExecTCL. Is that the best solution?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

yes, orchadmin delete a and then just rename b.ds to a.ds

No need in this case to actually copy data around.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

There is no orchadmin rename command so I have to do a copy. By the way, is there a stage in EE which can delete a dataset in any way? As far as I know, there isn't.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not ExecTCL; this executes "UniVerse" commands. Use ExecSH. You may need to use the full path of the orchadmin command, if its parent directory ($APT_ORCHHOME/bin) is not defined in your PATH.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

I cannot execute:

orchamin delete A.ds

It gives me a "Command not found" error.

I know that I need to have $DSHOME and $APT_ORCHHOME defined which I don't. But can't I put the full path and execute orchadmin? How do I tell where my orchadmin is installed? I did a "find" for a directory called orch. It didn't work. My admin tells me that orchadmin is installed. How do I tell where it is installed and how do I run the delete command above?

Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

orchadmin is in the bin subdirectory of PXEngine, which is a sibling directory of DSEngine. Therefore, assuming DSHOME is set:

Code: Select all

APT_ORCHHOME=$DSHOME/../PXEngine ; export APT_ORCHHOME
For the orchadmin command to work, you also need APT_CONFIG_FILE to be set, and set to the same configuration file as you used to create the Data Set. For example:

Code: Select all

APT_CONFIG_FILE=$DSHOME/../Configurations/default.apt ; export APT_CONFIG_FILE
To execute orchadmin you either need the full pathname, that is $APT_ORCHHOME/bin/orchadmin, or to have set your PATH environment variable to include its parent directory:

Code: Select all

PATH=$PATH:$APT_ORCHHOME/bin ; export PATH
Note that there is no space either side of the "=" character in any of these commands.
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 »

splayer wrote:There is no orchadmin rename command so I have...
No, use a UNIX rename for the descriptor file.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

1)I used the full path as follows:
/fullpath/orchadmin delete myfile.ds

I get the following error:
"error while loading shared libraries: liborchgenerali686.so: cannot open shared object file: No such file or directory"

2)To rename a dataset file, can I just use the Unix mv command? That will rename just the .ds file not the child files? Wouldn't that cause a problem if I tried to delete them later?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

splayer,

you also need to set your other environment variables using the $DSHOME/dsenv script. Have you checked whether the file exists and that you don't have execute rights to it?

You can rename the .ds "descriptor" file using UNIX "mv". The file only contains information linking to the actual data files so its name is irrelevant.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I'm not certain that's right, Arnd. The segment file names include the name of the descriptor file. The naming convention for segment files is

Code: Select all

descriptor.user.fastname.0000.0000.0000.c4.c4e17a7d.0000.2fdc262f
where
  • descriptor is the name of the descriptor file

    user is the name of the user who executed the job that created the Data Set

    fastname is the name of the host on which the node exists

    the next four components manage the segment files when more than one is required (e.g. operating system file size limit is 2GB)

    the final two components are for uniqueness
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 »

But the name of the descriptor file can be changed; yes - the data files will retain their original naming conventions but the access will always be through the descriptor so that doesn't make a difference. It might be a bit misleading if someone browses the data directory but functionally the name of the .ds file doesn't matter. It is an easy test to do (if I were at a PX installation today), rename the .ds file and see if the "orchadmin ll {dsfile}" still works.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

OK, do-able but not best practice.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

I am seeing some strange behavior. If I do:

chmod +x

on my dataset file, it deletes the .ds file when I do:

orchadmin delete MyDS.ds

However, it doesn't delete the child files. In either case, I get the following error:
"orchadmin: error while loading shared libraries: liborchgenerali686.so: cannot open shared object file: No such file or directory"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why did you do the chmod +x command?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

I just thought that might be an issue. Anyway, I found out that it is a permission issue. My Datastage admin told me that, as a developer, my ID does not have the rights to do orchadmin commands. What's strange is, I could execute dsenv like it is mentioned on this site.

Is it standard that Datastage developers are not given access to orchadmin commands? I haven't seen this elsewhere.
Post Reply