Page 1 of 1

Delete of not-used hash-files

Posted: Thu Jun 26, 2008 8:04 am
by vera
Hello.
We would like to delete all not-used hash-files. Please advise how we can get a list of all these files and how we can delete them.

Posted: Thu Jun 26, 2008 4:03 pm
by ray.wurlod
Define "not used". This may be trickier than you imagine. For example you may have one or two hashed files used only in end of year processing.

Once you have identified them, deleting them is straightforward, but you must use the correct method depending on how they were created.
  • If they were created with a hashed file stage in an account or with a CREATE.FILE command, the correct deletion method is a DELETE.FILE command at TCL.

    If they were created with a hashed file stage in a directory or with the mkdbfile command, the correct deletion method is two rm (UNIX) or del (DOS) commands, one for the data portion and one for the dictionary portion.

    If they were created with a UniVerse stage or a CREATE TABLE statement, the correct command is DROP TABLE executed at TCL.

Posted: Fri Jun 27, 2008 6:39 am
by vera
May be you know how can we get a list of all hash-files and how can we delete several files by one command?

Posted: Fri Jun 27, 2008 6:48 am
by ArndW
Check out this post for one way to do this.

Posted: Fri Jun 27, 2008 7:58 am
by daignault
There is an indexing program called SMART-TS, Datastage version that will consume a DSX file and would be able to show where specific instances of a hashed file are used.

You can find more information at http://www.strategies4data.com/products ... oducts.htm

Ray Daignault

Posted: Fri Jun 27, 2008 8:08 am
by chulett
As would Chuck Smith's 'list all files and tables' tool, especially if you stage up the results in a database table.

Posted: Fri Jun 27, 2008 3:59 pm
by ray.wurlod
Do any of these tools find hashed files whose name is a job parameter?

Another utility (on Windows only) is uvwalk with the -uvfile option; it can recursively traverse a directory structure reporting which files are hashed files and which are not.

usage: uvwalk [path] {-name filename} {-recurse} {-all} {-ntfs} {-uvfile}
[path] directory to start walking
{-name filename} filename to locate
{-recurse} recurse subdirectories
{-relative} display relative paths
{-prefix text} display located files prefixed with text
{-all} walk all logical drives
{-ntfs} NTFS partitions only
{-uvfile} execute UVfile -s to identify hashed files

Posted: Fri Jun 27, 2008 4:01 pm
by ray.wurlod
A UNIX equivalent would be find path -exec UVfile {}\;

The UVfile command is in the DataStage engine bin directory.