Kozure Ohashi
18th August 2008, 15:00
Dear baanboard,

if i import a sequential dump (all tables) from a live company with option "ignore referential integraty constraints" baan tells me to run "repair reference counter" afterwards.

Is this with a oracle db system realy necessary, or is it like gigo (garbage in garbage out), the references have the quality as the old server.

Is the reference counter used with modern databases or is it only used for tbase (counting the reference, only if 0 the record can be deleted).

Thanks for any information.

Regards,

Kozure

pconde
18th August 2008, 16:50
Hi,

Reference counter are used also in informix and oracle. It is mandatory to rebuild it because they are not taken in the dump.
If the repair reference counter is not done the risk is that the user can delete a record that is referenced in another table, leaving a db inconsistence

Regards
Philippe

shah_bs
18th August 2008, 17:02
The very short answer to the question is 'Yes' - repair reference counter should be done. This is the technically correct thing to do.

This (reference counter) feature is independent of database - it is hard-bound into the way BAAN manages references, depending on how the table relationships are defined.

HOWEVER: The decision to repair is subjective - if the reference counters are not repaired, there are no difficulties in day to day operations unless a record in the related system of records need to be deleted. For example, after deleting the Production Planning records, it is now required to delete the Production Order record. At this time the system would not allow to delete the Production Order record since it thinks that there are references attached - when the Production Planning records are deleted, the reference counter on the Production Order record are decremented (in the case where the counter was zero to begin with, it becomes negative - you can see this happen when you run a select in say SQLPlus). But this is just one example where there were no issues observed (because in our installation, we almost never delete a production order). In general, it is possible to accidentally delete records that still have references.