Hola @andyglezl,
andyglezl wrote: ↑Wed Jul 08, 2020 7:30 pm
salamandra wrote: ↑Mon Jul 06, 2020 9:43 pm
I am facing some problems with DBFs that have about 700 / 800k records (table and index corruption).
En los años que utilice Clipper y ahora HMG, rara vez tuve problemas como estos que mencionas.
Pero es adivinar que puede estar sucediendo:
No utilizar DBCOMMIT() después de grabar, modificar los campos con Indices y tener cerrados el indice correspondiente.
... etc. etc.
Casi siempre he utilizado DBEVAL() y muy poco alguno que otro indice.
*------------------------------------------------------------------------------------------------------------------------------
In the years that I used Clipper and now HMG, I rarely had any issues like these you mention.
But it is to guess what may be happening:
Do not use DBCOMMIT () after saving, modify the fields with Indexes and have the corresponding index closed.
... etc. etc.
I have almost always used DBEVAL () and very little of any other index.
https://www.hmgforum.com/viewtopic.php? ... val#p45852
http://www.hmgforum.com/viewtopic.php?f ... val#p39392
http://www.hmgforum.com/viewtopic.php?f ... ezl#p36875
P.D.
Esta es una DBF con 20,000 registros
SIN INDICES en donde hago una busqueda x 3 campos solo con DBEVAL()
+-------------------------------------------------------------------------------------------------------------------------------------------------------
This is a DBF with 20,000 records
WITHOUT INDICES where I do a search x 3 fields only with DBEVAL ()
DBEVAL.gif
No, mis problemas realmente no son causados por índices cerrados o falta de instrucciones de COMMIT del programa.
Talvez el tipo de aplicaciones que tu desarrollas permita que trabajes sin (o con escasos) índices, lo que no es mi caso.
En el caso que mencioné, mi sistema de ERP atiende mas de 70 workstations (entre la administración y la producción) y
genera desde centenas hasta, dependiendo del sector, millares de nuevos registros x dia. Por ejemplo, una nueva factura
genera cerca de 140/150 nuevos registros de diversos tipos en diversas tablas DBF, entre finanzas, stock, bajas de producción, etc.
Sumale a eso, la generacion de pedidos de compra y de venta, ordenes de produccion, apuntamientos de inicio y termino de
operaciones de fábrica, etc. Al final del dia habras generado millares de nuevos registros.
No es un asunto tan simple como parece... tambien hay la cuestion de la seguridad de las tablas DBF que es exactamente CERO.
Cualquier usuário las copia, las abre y hasta las puede alterar utilizando VFP, DBase, Excel, Calc, etc.
Otro problema, bastante comun, son los usuários impacientes que reinician la PC con una sesion de sistema abierta simplemente
porque creen que la PC esta trabada cuando la verdad es que esta ejecutando alguna operacion que demora. Eso no solo causa
corrupcion de las tablas y de los índices, mas tambien perdidas de datos....
En fin, realmente es complicado...
Preciso resolver, muy en breve veré como lo hago, si con MSSQL o con MySQL.
Muchas gracias por tu colaboracion y tu opinion !!
** ENGLISH **
No, my problems are not really caused by closed indexes or lack of COMMIT instructions from the program.
Perhaps the type of applications that you develop allow you to work without (or with few) indexes, which is not my case.
In the case I mentioned, my ERP system serves more than 70 workstations (between administration and production) and
generates from hundreds to, depending on the sector, thousands of new records per day. For example, a new invoice
generates about 140/160 new records of various types in various DBF tables, including finance, stock, production downtime, etc.
Add to that, the generation of purchase and sale orders, production orders, start and end points of factory operations, etc.
By the end of the day you will have generated thousands of new records.
It is not as simple a matter as it seems ... there is also the question of DBF table security which is exactly ZERO.
Any user copies, opens and can even alter using VFP, DBase, Excel, Calc, etc.
Another rather common problem is impatient users restarting the PC with system sessions in a open state simply because they think
the computer it is locked when the truth is that it is executing some operation that takes time. This not only causes corruption, but
also data loss ... Anyway, it really is complicated ...
I need to solve, very soon I will see how I do it, whether with MSSQL or MySQL.
Best regards,
Salamandra, Brazil