摘要 |
<p>The present invention provides a method and a system for transferring data to be archived from a runtime database (RT_DB) into a long-term archive database (LTA_DB) in a MES system, comprising:
a) an additional database, herein after referred as temporary database (TMP_DB) acting as buffer database for the selected data record set to be archived;
c) copying (STc), for each table of the runtime table subset, the selected record subset to be archived into its corresponding table of the temporary table set in the temporary database (TMP_DB);
d) copying (STd), for each table of the temporary table set, the selected record subset to be archived into its corresponding table of the long-term archive table subset in the long-term archive database (LTA_DB);
e) creating (STe), for each table of the temporary table set, a temporary deletion table comprising a set of primary keys of the records to be deleted from the runtime database (RT_DB;
f) in the runtime database (RT_DB), for each runtime table having a corresponding temporary deletion table of the set of temporary deletion tables, deleting (STf) each record having primary key matching the primary key of the primary key set of its corresponding temporary table;
- wherein items c), d) and step e) are executed under a same transaction and wherein item f) is executed under another transaction.</p> |