Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Altering big table - Not enough disk space
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00475071
Message ID:
00475254
Views:
31
>>Hi Nadya,
>>
>>>Hi everyone,
>>>
>>>I'd like to know, how to prevent the System Error message "Not enough disk space" for the operations like ALTER TABLE for the huge tables.
>>
>>Get bigger hard drive. :)
>>
>>
>>>I wrote an application, called DataDict, which we use for updating our databases (if we knew about Stonefield earlier, we would use it instead, perhaps). My colleague told me, that she had this Error on her machine. I'd like to know, how can I check, what amount of space is needed, just before ALTER TABLE command? The same for INDEX ON command.
>>
>>ALTER TABLE makes a new table with changed structure and leaves the old one as .BAK. At minimum you need the same amount of free space as your source table occupies + (new_field_size * reccount()) + some_more_just_in_case. INDEX ON should takes less space (depending on number of indexes), but I would go with at least the table size space. Anyway, it is not safe to run the application with not much free space available.
>>
>>Some other commands may require even more space, for example if you use SORT command the disk space needed to perform a sort can be as much as three times the size of the source table. You can check the amount of available disk space with DISKSPACE() and SYS(2020) functions.
>
>Hi Nick,
>
>I'll probably go with (Current table size * 3), because I don't know in advance, which fields would be changed/added...

This still may not be enough. How much is required depends on a number of things. Does the table have a any sort of memo field. If so, that will be backed up with the extension tbk. Are you increasing or decreasing the size or number of fields in the table? Does it have an index file?

I would hazard a SWAG that, in someways, ALTER TABLE works similarly to PACK. With pack, you would need at least twice the size of the existing files in terms of raw space. What PACK does is copy the appropriate records and indexes to the disk, after which it deletes the original.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform