Merge Databases
|
<< Click to Display Table of Contents >> Navigation: Reference Section > Installation and Deployment > License GUI > Merge Databases |
Merge Databases undoes the split made by Reduce Database. It puts an archive back into the datastore it came from, or merges an older archive into a newer archive of the same datastore, so that repeated reductions need not leave a trail of archives.
The older datastore is only read. The newer datastore is the one written: it keeps everything it has, and gets back what only the older one has.
When to Use
•A reduction removed workorders or plates that are needed in the live datastore again.
•Several reductions have left several archives of the same datastore, and you want one.
Before You Begin
•Take a backup of the newer datastore. The merge writes to it.
•Run PC4LicGUI on the database server. Both databases have to be on that machine and served by the same Firebird instance.
•Update both datastores to the same version first.
•During the merge the newer datastore is locked: nobody can log on to it, anyone logged on is disconnected and its STP service is stopped. Other datastores carry on. The lock is released when the merge ends.
•The tool tries the installed SYSDBA password and asks for one only if it is refused.
Merging
1.In PC4LicGUI, click the Tools menu and choose Merge Databases.
2.In Older datastore (merged in) choose the archive. Archives are listed with the datastore they are an archive of and the dates they cover.
3.In Newer datastore (kept) choose the datastore the archive came from, or the newer archive.
4.Click Dry Run. It changes nothing and does not lock the datastore. The log shows, table by table, what would be added, what is left deleted, and any warnings. A line starting BLOCKED: means the merge would be refused; fix the cause first (see below).
5.Click Merge..., read the confirmation and click Yes. If the newer datastore is a read-only archive, it is made read/write for the merge and read-only again afterwards. The whole merge is one transaction: on any failure nothing is changed.
6.When an archive has been merged, the tool offers to retire it. Click Yes to unregister it and rename its file to <file>.merged-into-<newer datastore>. The file is kept; delete it once you are happy with the merge. If the newer datastore is also an archive, its date range is widened to start where the older archive started.
The log is also written to DatabaseMergeLog in the Logs folder beside PC4LicGUI.
What Is Brought Back
•Workorders, workorder items, plates, parts, shipments and the other records the newer datastore lacks, with the records that belong to them.
•A record the newer datastore already has is never changed: its version wins.
•Nests follow their plate. They are added only with a plate the merge adds; a plate the newer datastore already has keeps exactly its own nesting.
•What the reduction did to keep quantities right is healed: the rejected-quantity corrections are given back, and the Partial workorder due to database reduction note is not repeated.
•Every workorder item keeps exactly the number to nest it had before the merge. The merge checks this and rolls back if any item would change.
What Is Not Brought Back
Deletions made in the newer datastore after the split stay deleted. The log lists them as Left deleted:
•Any workorder, workorder item or plate dated on or after the start of the newer datastore's data range that it does not have. The reduction kept everything from that date on, so it was deleted there.
•Plates, and workorders or items nested on plates, that were deleted in the newer datastore while it kept the plates they belong to.
An older workorder that was never nested leaves no trace of having been deleted, so it does come back, whole.
Lookups that a reduction never deletes (customers, materials, machines and so on) are not merged.
What Blocks a Merge
•The two choices are the same database.
•The two datastores are on different versions.
•The older datastore is in fact the newer one. Merge the older into the newer.
•The databases share no records, or records with the same key differ: they are not halves of the same datastore, or one of them was changed after the split.
•Records being added refer to a customer, material, machine or other lookup the newer datastore does not have. Add it there first.
•The newer datastore's from date is not a valid date. Fix it in the datastore list.
•Something other than the merge is still connected to the newer database.
See also: Reduce Database, Archive Datastores