Page 1 of 3

Renaming and deleting a dataset

Posted: Fri Jan 26, 2007 4:08 pm
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?

Posted: Fri Jan 26, 2007 4:52 pm
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.

Posted: Fri Jan 26, 2007 4:58 pm
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.

Posted: Fri Jan 26, 2007 6:26 pm
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.

Posted: Fri Jan 26, 2007 11:26 pm
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.

Posted: Sat Jan 27, 2007 12:18 am
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.

Posted: Sat Jan 27, 2007 3:41 am
by ArndW
splayer wrote:There is no orchadmin rename command so I have...
No, use a UNIX rename for the descriptor file.

Posted: Sat Jan 27, 2007 10:08 am
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?

Posted: Sat Jan 27, 2007 10:42 am
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.

Posted: Sat Jan 27, 2007 4:03 pm
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

Posted: Sun Jan 28, 2007 4:43 am
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.

Posted: Sun Jan 28, 2007 4:49 am
by ray.wurlod
OK, do-able but not best practice.

Posted: Mon Jan 29, 2007 2:47 pm
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"

Posted: Mon Jan 29, 2007 4:09 pm
by ray.wurlod
Why did you do the chmod +x command?

Posted: Mon Jan 29, 2007 4:15 pm
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.