Skip to main content

Hi All,

Most likely obvious, but I recently removed millions of records from some UNIDATA files, and I want to reclaim the disk space. In days of old, I would make a new version of the file that is empty, then copy the records into it -- then replace the old file with the new one.

Is there a better way to do this now? I have a vauge memory of doing the copy from the ECL prompt, but I may have used Unibasic. I have a few files over 50GB that it would be nice to get the space back. 

In reviewing the manuels, (HORRERS) it seems that REBUILD.FILE would basically do that. But I see no example of syntax.

:FILE.STAT HISTORYFILE


File name (Dynamic File)              = HISTORYFILE
Number of groups in file (modulo)     = 36534
Dynamic hashing, hash type            = 0
Split/Merge type                      = KEYONLY
Block size                            = 16384
File has 35382 groups in level one overflow.
Number of records                     = 1824235
Total number of bytes                 = 98510763222
Fileload                              = 6519857129
Fileload percentage                   = 1091

Average number of records per group   = 49.9
Standard deviation from average       = 73.2
Average number of bytes per group     = 2696413.3
Standard deviation from average       = 6264577.8

Average number of bytes in a record   = 54001.1
Average number of bytes in record ID  = 30.4
Standard deviation from average       = 191154.4
Minimum number of bytes in a record   = 57
Maximum number of bytes in a record   = 1481487

Minimum number of fields in a record  = 4
Enter <New line> to continue...
Maximum number of fields in a record  = 5
Average number of fields per record   = 4.0
Standard deviation from average       = 0.0
File has 96 over files, 1 prime files
Part File   Actual file size in bytes
dat001       598589440
over001     1073725440

Thankds in sdvance for any thoughts!



------------------------------
Rick Brown
Sysadmin
Juniata College
------------------------------

Hi All,

Most likely obvious, but I recently removed millions of records from some UNIDATA files, and I want to reclaim the disk space. In days of old, I would make a new version of the file that is empty, then copy the records into it -- then replace the old file with the new one.

Is there a better way to do this now? I have a vauge memory of doing the copy from the ECL prompt, but I may have used Unibasic. I have a few files over 50GB that it would be nice to get the space back. 

In reviewing the manuels, (HORRERS) it seems that REBUILD.FILE would basically do that. But I see no example of syntax.

:FILE.STAT HISTORYFILE


File name (Dynamic File)              = HISTORYFILE
Number of groups in file (modulo)     = 36534
Dynamic hashing, hash type            = 0
Split/Merge type                      = KEYONLY
Block size                            = 16384
File has 35382 groups in level one overflow.
Number of records                     = 1824235
Total number of bytes                 = 98510763222
Fileload                              = 6519857129
Fileload percentage                   = 1091

Average number of records per group   = 49.9
Standard deviation from average       = 73.2
Average number of bytes per group     = 2696413.3
Standard deviation from average       = 6264577.8

Average number of bytes in a record   = 54001.1
Average number of bytes in record ID  = 30.4
Standard deviation from average       = 191154.4
Minimum number of bytes in a record   = 57
Maximum number of bytes in a record   = 1481487

Minimum number of fields in a record  = 4
Enter <New line> to continue...
Maximum number of fields in a record  = 5
Average number of fields per record   = 4.0
Standard deviation from average       = 0.0
File has 96 over files, 1 prime files
Part File   Actual file size in bytes
dat001       598589440
over001     1073725440

Thankds in sdvance for any thoughts!



------------------------------
Rick Brown
Sysadmin
Juniata College
------------------------------

Rick,

I would first run a guide with :!guide and look at GUIDE_ADVICE.LIS to see what a good Module/Blocksize would be.

Then use RESIZE.FILE or !memresize  fast and easy.



------------------------------
David Green
Computer Programmer
Rocket Forum Shared Account
------------------------------

Rick,

I would first run a guide with :!guide and look at GUIDE_ADVICE.LIS to see what a good Module/Blocksize would be.

Then use RESIZE.FILE or !memresize  fast and easy.



------------------------------
David Green
Computer Programmer
Rocket Forum Shared Account
------------------------------

Thanks David. So the RESIZE.FILE does release the disk-space? That is the part I was uncertain of.



------------------------------
Rick Brown
Sysadmin
Juniata College
------------------------------

Thanks David. So the RESIZE.FILE does release the disk-space? That is the part I was uncertain of.



------------------------------
Rick Brown
Sysadmin
Juniata College
------------------------------

Yes, UniData uses a Temp file to store the data while creating your new file.  Make sure you have enough disk space for a complete copy of the file to be resized.



------------------------------
David Green
Computer Programmer
Rocket Forum Shared Account
------------------------------

Rick,

I would first run a guide with :!guide and look at GUIDE_ADVICE.LIS to see what a good Module/Blocksize would be.

Then use RESIZE.FILE or !memresize  fast and easy.



------------------------------
David Green
Computer Programmer
Rocket Forum Shared Account
------------------------------

@Rick Brown @David Green Please DO NOT use memresize to resize a dynamic file, there is a common misconception that memresize is a fast resize because it uses memory buffers and RESIZE does not. This is true in terms of the buffers but the major speed gain to achieved because memresize does not do splits etc. 

With memresize on a dynamic file you can end up with a file in worse state than when you started.

Please read the attached tech note I published on this that is available from the knowledge base.



------------------------------
Jonathan Smith
UniData ATS
Rocket Support
------------------------------

@Rick Brown @David Green Please DO NOT use memresize to resize a dynamic file, there is a common misconception that memresize is a fast resize because it uses memory buffers and RESIZE does not. This is true in terms of the buffers but the major speed gain to achieved because memresize does not do splits etc. 

With memresize on a dynamic file you can end up with a file in worse state than when you started.

Please read the attached tech note I published on this that is available from the knowledge base.



------------------------------
Jonathan Smith
UniData ATS
Rocket Support
------------------------------

Thank you Jonathan S. I have seen this before.



------------------------------
Rick Brown
Sysadmin
Juniata College
------------------------------