Following a rigorous methodology is key to delivering customer satisfaction and expanding analytics use cases across the business.
Events that B2B Data Exchange generates can be archived to manage storage space in the runtime DX repository. The chosen archive tool is based upon requirements in each organization. The archive command line utility is a basic B2B Data Exchange utility that archives events to an XML file and deletes the events from B2B Data Exchange. Use the archive utility if your organization does not require access to archived events as archived events cannot be browsed or restored when archived with this utility.
Data Exchange also offers Data Archive which is an advanced archive tool that archives events and documents to a compressed file store. Refer to the B2B Data Exchange Administrator Guide for more information on Data Archive.
This document focuses on the archive command line utility that should be used when the primary objective is to delete events from the DX runtime repository.
Use the archive command line utility to archive events and documents from B2B Data Exchange to an external XML file and delete the events and the documents from B2B Data Exchange.
The following event types can be archived:
The archive specification file contains the parameters according to which events are to be archived. Archive events for a specific partner or account can be selected in the specification file. Events can also be archived based on the event creation date and time. The archive specification file also contains pre-configured rules that can be used to limit the archive criteria. If any event to be archived contains reconciliation information, the associated reconciliation event must be set to a status of Reconciled.
After the archive process completes successfully, B2B Data Exchange generates an event for the archive process with a status of Complete. The event contains a log BLOB that describes the object hierarchies in the archive file, the data that the archive utility purged, and any error that the archive utility generated.
The archive specification file contains rules that the archive utility uses to determine which events to archive. The following table describes the archive specification file elements:
Element |
Description |
Name |
Name of the archive rule. |
PartnerName |
Name of the partner. A partner name can either be specified or use one of the following: - (ALL). Default. Archives events for all partners and events with no partners. - (SYSTEM). Archives system events and legacy audit trail events |
StorageLocation |
Absolute path to the directory in which to create the archive file. The B2B Data Exchange server must be able to access the location where the archive file is stored. |
EventAge |
Required. The minimum age of the event to be archived based on the last change to the event status. Specify the age in the following format: <NumOfDays>d <NumOfHours>h <NumOfMinutes>m The archive includes events where the status was changed before the specified number of days, hours, and minutes. For example: 20d 12h 0m This value means that the archive utility includes only events where the event status was changed at least 20 days and 12 hours ago. |
ArchiveEvents |
Indicates whether to archive events. If PurgeEvents is set to true, use this element to specify whether the events will be archived before they are deleted from the repository. If ArchiveEvents is set to false, the PurgeEvents element cannot be set to false. Default is true. |
PurgeEvents |
Indicates whether to delete events from the Data Exchange Repository. Use this element to delete events from the repository after they are archived. If PurgeEvents is set to false, the ArchiveEvents element cannot be set to false. |
IncludeLogBlobs |
Indicates whether the log data for log events will be included in the archive. Default is false. |
Following are examples of archive specification files:
Requirement– Purge events for all partners or events with no partner that are older than 1 day.
<ArchiveTask>
<ArchiveRule>
<Name>Archive events older than a day</Name>
<PartnerName>(ALL)</PartnerName>
<StorageLocation>c:\temp\archive </StorageLocation>
<EventAge>1d 0h 0m</EventAge>
<ArchiveEvents>false</ArchiveEvents>
<PurgeEvents>true</PurgeEvents>
<IncludeLogBlobs>false</IncludeLogBlobs>
</ArchiveRule>
</ArchiveTask>
Requirement– Purge audit trail and system events older than 5 days
<ArchiveTask>
<ArchiveRule>
<Name>System Events</Name>
<PartnerName>(SYSTEM)</PartnerName>
<StorageLocation>c:\temp\archive\system</StorageLocation>
<EventAge>5d 00h 00m</EventAge>
<ArchiveEvents>false</ArchiveEvents>
<PurgeEvents>true</PurgeEvents>
<IncludeLogBlobs>true</IncludeLogBlobs>
</ArchiveRule>
</ArchiveTask>
After the archive rules are defined in the specification file, run the archive utility with the command line. The archive utility creates the archive file and deletes the archived events from B2B Data Exchange.
The archive utility uses the following syntax:
archive
<-s|--specification> file
<-u|--user> userID
<-p|--password> user password
[--server "hostname:port"]
The following table describes options and arguments for the archive utility commands:
Option |
Argument |
Description |
---|---|---|
-s |
file |
Required. Absolute path and file name of the archive specification file. |
-u |
userID |
Required. User ID of a B2B Data Exchange user account with archiving privileges. |
-p |
User password |
Required. B2B Data Exchange user password. Enter a value depending on whether ISP or native authentication mode is used. |
--server |
“hostname:port” |
Optional. Host name and port number of the Data Exchange server. If this option is not passed, the archive utility connects to the localhost server with the default port 18095. The argument must be enclosed in quotation marks, such as: archive --server “localhost:18095”... |
Windows:
<DXInstallationDir>\dx-tools\archive.bat -s c:\temp\archive\archive_spec_file.xml -u admin -p xxxx --server “infa-server:18095”
Unix
<DXInstallationDir>\dx-tools\ archive.sh -s \infa\temp\archive\archive_spec_file.xml -u admin -p xxxx --server “infa-server:18095”
Follow the steps below to delete all of the event history in the B2B DX repository at once:
Note: The command executes the ‘truncate table …’ which means that there is no database transaction log of that operation.
Success
Link Copied to Clipboard