After the Purge
When the last clean-up batch ends, the configuration becomes Finished, the Purge Monitor shows The purge finished and its batches were removed; see the run log — «انتهى الحذف وتمت إزالة دفعاته، راجع سجل التشغيل», and Last Run Log holds the audit of the run: when it finished, the cut-off, who started it, and one line per batch with its target, the behaviour of each document type, the rows processed, the status and the execution time. Keep a copy of that log with the customer's purge file.
The purge checks its own work as it goes (it stops rather than finish with rows of the range left behind), but the customer will want to see with their own eyes that nothing changed. This page tells you what to compare and what differences to expect.
Before the run, save your comparison reports
Verification is a before-and-after comparison, so the "before" has to be saved before the run starts. Run these reports on the day of the run, after the last posting and before Run purge, and keep them (export to Excel or PDF):
- Trial balance at the cut-off date for every company, by account and, where the customer uses them, by subsidiary and dimension.
- Trial balance as at today, the same way.
- Stock on hand and stock valuation per item and warehouse, as at the cut-off and as at today.
- Customer and supplier balances and ageing as at today.
- Stock ages as at today, if the customer uses them.
- The next number of a few busy document books.
What to verify afterwards
Run the same reports again and compare.
| Check | Expected result |
|---|---|
| Trial balance at the cut-off and as at today, per account | Identical. The detail before the cut-off is now one roll-up line per account, subsidiary and dimension. |
| Stock on hand per item and warehouse | Identical, at the cut-off and today. |
| Stock valuation | Identical. Under FIFO, every remaining layer keeps its own quantity, unit cost and date. |
| Customer and supplier balances | Identical per account and subsidiary. |
| Open amounts in the ageing | Identical per account and subsidiary; old open invoices now show as the roll-up amount dated on the cut-off day. |
| Documents after the cut-off | Untouched, including their ledger, stock and cost. |
| Drafts | Still there, untouched. |
| Next document numbers | Continue from where they were. |
| Roll-up documents | The Purge Journal and Purge Stock Receipt lists show the new documents of this run, all processed, each journal balanced. |
| Business Requests | No failed request; nothing dated in the range waiting. |
| Critical errors at login | No purge error. |
A practical last test: post one stock issue of an item whose only stock is carried by a roll-up receipt, and check that it takes the right cost and creates its ledger entry. In the tests this worked on a carried FIFO layer dated years before the cut-off.
Known differences that are not errors
| You may see | Why |
|---|---|
| A small amount on the Purge Roll-up Clearing Account, or on one account, in the ledger lines report but not in the trial balance | The roll-up restates the balances table (what the trial balance always showed), not the ledger lines. If the two disagreed inside the range because of an old difference, the difference disappears with the old lines; the remaining imbalance of the range, if any, stays on the clearing account. The server log notes it while the journals are built. |
| Balances that were posted with an empty dimension now sit under the "no dimension" value | The roll-up groups by dimension, and an empty dimension is restated as the "no dimension" record. Totals per account and subsidiary do not change. |
| Debt lines per customer differ from the ledger, but the open amounts are the same | On some databases the debt lines never added up to the ledger. The roll-up posts the ledger balance; the open amounts stay as they were. |
| Stock ages differ from before | If stock ages were switched on inside the purged range, the roll-up restates the ages for the whole stock at the cut-off, so the ages total now equals the stock on hand. Before the purge the two often disagreed. |
| Negative stock lines, zero-quantity cost lines, stock without a locator, stock on a locator of another warehouse | All carried exactly as history held them, as the pre-flight warnings announced. |
| FIFO issue lines under a roll-up receipt | Issues of the range still waiting for a layer at the cut-off, kept as the warning announced. |
| Actions history of an old document still dated after the cut-off | The clean-up works by date, so actions done after the cut-off on old documents stay, as they do after an ordinary delete. |
| A surviving document whose link to an old document is empty | The linked document was deleted; the link was emptied so that nothing points at a missing record. |
Database space
The purge does not shrink the database files. The rows it deletes leave free space inside the files, and SQL Server reuses that space for new data, so the files simply stop growing for a long while. In the tests the space used inside a database of about 400 GB fell from 347 GB to 270 GB after one cycle, and from 270 GB to 127 GB after a second one that took five more years, while the file stayed the same size.
The Request queues panel of the Purge Monitor shows each database file with its size and used space. If the customer wants smaller files, shrinking is a separate operation, planned with their database administrator, in its own maintenance window, followed by index maintenance.
The archive database grows by everything that was copied to it. Plan its disk and its backups.
Using the archive database
The archive is an ordinary SQL Server database on the same instance. It holds one table per archived table, named O followed by the table name (OSalesInvoice with its lines, OLedgerTrans, OLedgerTransLine, OQtyTransLine, …), with the same columns as the original.
- No Nama screen or report reads it. It is for SQL queries by support or by the customer's IT, for example to find an old invoice and its lines.
- Attachments are not in it: an archived document keeps only the reference to its attachment, and the attachment itself was deleted with the document.
- Later purges add to the same archive. A row is never copied twice.
- The table
PurgeArchiveRunlists the purge files that copied into it, with the cut-off and what each one copied. The roll-up balances of an earlier purge (the transactions of its Purge Journals and Purge Stock Receipts) are not in an archive that holds the detail behind them; they are only in an archive that was started empty after that purge (The archive of a later purge). - Back it up like the main database, and keep the backup taken just before the purge.
What changes for users
- Old documents are gone, or open read-only when they were marked as purged.
- Reports for dates before the cut-off show the roll-up documents instead of the detail; drill-downs stop at the roll-up.
- Nothing dated in the purged range can be entered or changed any more.
- Everything after the cut-off works as before, usually faster.