wm.tn.archive:archive
Archives documents and deletes documents from the Trading Networks database.
Input Parameters
archiveAfterDays | String (optional) The maximum number of days to store a document in the production tables (since being received) before being archived. This service archives documents that have been in the database longer than the number of days you specify. Specify a value from 0 through 730365. 0 indicates to not archive documents. If you do not specify a value for archiveAfterDays, this service uses the setting of the tn.archive.archiveAfterDays property in the Trading Networks properties file located in the directory, Integration Server_directory \instances\instance_name\packages\WmTN\config\properties.cnf. |
deleteAfterDays | String (optional) The maximum number of days that a document is to remain in the database (since it was received) before being deleted. This service deletes documents that have been in the database longer than the number of days you specify. Specify a value from 0 through 730365. If you specify 0, Trading Networks does not delete documents. If you do not specify a value for deleteAfterDays, this service uses the setting of the tn.archive.deleteAfterDays property in the Trading Networks properties file. The Trading Networks properties file is in the directory, Integration Server_directory \instances\instance_name\packages\WmTN\config\properties.cnf. |
Output Parameters
archiveCount | String The number of documents that the service archived. |
deleteCount | String The number of documents that the service deleted from the database. |
When you run services such as wm.tn.archive:archive or wm.tn.archive:extendedArchive:
1. For each batch, based on the TN property tn.archive.batchSize, the document IDs to be archived/deleted are copied to the ARCHIVE_WorkTable.
2. The document IDs are looped over and deleted.
3. Once the actual records are deleted, the records are deleted from the ARCHIVE_WorkTable.
4. If, for some reason, the job does not terminate normally, for example, the Oracle rollback segment overflows due to a large batch size, there might be leftover records in ARCHIVE_WorkTable. If this happens, these records have to be deleted before attempting another archive operation.
Starting Trading Network versions 10.1 or higher, archive stored procedures were introduced to streamline the process. You can manually delete the records by date, but this can be problematic with a large number of records due to the dependency on rollback segment sizing.
The tn.archive.batchSize determines the number of records to commit per transaction, making the behavior easier to control.
Usage Notes
You can execute this service from time to time to conserve space in the system database. You can use
Integration Server Administrator to schedule a user task to automatically execute this service periodically. You may not need this service for sites with large databases and that have one or more database administrators because such sites usually have their own archiving constraints.
If you do not specify
archiveAfterDays and the
tn.archive.archiveAfterDays is not set in the
Trading Networks properties file, the service deletes documents, but does not archive any documents.
If the setting that controls deleting documents (either
deleteAfterDays specified with the service or the
tn.archive.deleteAfterDays) is less than the setting that controls archiving documents (either
archiveAfterDays specified with the service or the
tn.archive.archiveAfterDays property), this service does not archive files, only deletes them.