Previous Topic: Filter the Archive and Purge History ListNext Topic: Search the Archive and Purge Rule List


Archive and Purge Rules

You can define the rules you want to use for running archive and purge jobs on your database. The product provides a set of out-of-box Archive and Purge rules. You can choose to modify and activate existing rules instead of creating new ones.

More information:

Define the Archive and Purge Path

Create an Archive and Purge Rule

Search the Archive and Purge Rule List

Edit an Archive and Purge Rule

Run the Archive and Purge Rule

Define the Archive and Purge Path

You can define the location where you want to store the archived data. This path can be the root directory of a remote server or a UNC path. Depending on your CA SDM configuration, the following servers must run on Windows to access the UNC path:

Follow these steps:

  1. Log in to web UI from the following CA SDM servers, depending on your CA SDM configuration:
  2. If you want to archive and purge attachments, complete the following steps:
    1. Select Attachments Library, Repositories on the Administration tab.

      The Repositories page opens.

    2. Right-click on a repository (such as Service Desk) and click Edit.

      The repository details page opens.

    3. Edit the following fields:
      Archive Type

      Specifies the archive and purge action to be taken on the contents of the repository. Following values are the valid:

      None: No archive and purge process is performed.

      Archive and Purge: The historic records are written to the file specified in the archive field and purged from the database.

      Purge Only: The historic records are purged from the database, but are not written to the archive file.

      Archive Path

      Specifies the directory path or the UNC path to which files in the repository are moved during the archive process.

      UNC Credentials

      Specifies the credentials to access the UNC path. Click UNC Credentials to open the Credentials Search page.

      • If you have already created the credentials to access the specified UNC path, search using the fields and select the credentials.
      • If you want to create the credentials, click Create New. For more information about creating credentials, see the Create UNC Credentials topic.
    4. Click Save.
  3. If you want to archive and purge data other than attachments, complete the following steps:
    1. Select Archive and Purge, Archive and Purge Settings on the Administration tab.
    2. Enter the path where you want to store the archived and purged data as the Archive Purge Rule Path.
    3. If you are using a UNC path to store the archived data, click UNC Credentials.

      The Credentials Search page opens.

      • If you have already created the credentials to access the specified UNC path, search using the fields and select the UNC credentials.
      • If you want to create the credentials, click Create New. For more information about creating credentials, see the Create UNC Credentials topic.
    4. Click Save.

    The archive and purge path is defined.

Create an Archive and Purge Rule

Before you can perform an archive or purge, you create a rule. The rule defines what you want to archive and when.

Example: You create an archive and purge rule to remove deleted forums from the database.

Follow these steps:

  1. Select Archive and Purge, Archive and Purge Rules on the Administration tab.

    The Archive and Purge Rule List page opens.

  2. Click Create New.

    The Create New Archive and Purge Rule page opens.

  3. Complete the archive and purge rule fields, as appropriate.
  4. Click Save.

    The new rule is displayed on the Archive and Purge Rule List page.

Example: You create an optional configuration rule inside the arcpur_cfg.xml and itil_arcpur_cfg.xml files to archive and purge the KPI_Ticket_Data node.

Follow these steps:

  1. Log in to the following server, depending on your CA SDM configuration:
  2. Find the following files in the $NX_ROOT/site/cfg/ directory:
  3. Edit the files to define the end_time (last_mod_dt) in KPI_Ticket_Data node. It specifies the criteria to select the records for archive and purge.
  4. Link the records in the KPI_Ticket_Data table to the records in the Ticket table (such as cr, chg, or iss). This ensures that all ticket related records in the KPI_Ticket_Data table are archived and purged.
  5. KPI_Ticket_Data node does not have a SREL relationship with any Ticket node and it relies on two fields, obj_name, and obj_id, to link with a ticket. The obj_name value can be cr, chg, or iss and the obj_id value is the ticket id. Define a main_obj for each ticket object.

    The following is a sample main_object definition for the ticket object, cr:

    <!-- KPI Ticket Data -->
    
    <main_obj>
    
    <name>KPI Ticket Data</name>
    
    <internal_name>KPI Ticket Data</internal_name>
    
    <factory>ktd</factory>
    
    <default_query>obj_name='cr'</default_query>
    
    <date_field>end_time</date_field>
    
    <ref_by value="obj_id">cr.id</ref_by>
    
    </main_obj> 
    

    Note: The configuration rule can only select records for cr. The ref_by tag can match the value of obj_id in KPI Ticket Data to the value of id in cr. If a match is found, it means that a KPI Ticket Data record is referenced by a cr record, so the KPI Ticket Data record is not archived and purged.

  6. After adding the configuration rules for all ticket objects, depending on your CA SDM configuration, do one of the following:

    These configuration rules become selectable configuration object names in the Archive and Purge Rule Detail form.

Archive and Purge Rule Fields

You can use the following fields to define or edit rule definitions.

Rule Name

Specifies a unique identifier for the rule.

Status

Indicates whether this rule is active. The inactive rule runs only once, even if it is scheduled for a recurrent process.

Schedule

Specifies a workshift during which the rule should be in effect.

Recurrence Interval

Specifies how often this rule will run.

Archive File Name

Specifies the name of the file where you want to store the historic records. Enter the file name that you have mentioned while defining the archive and purge path. For more information, see the Define the Archive and Purge Path topic.

Operation Type

Specifies one of the following types of operation that the rule must execute:

Archive/Purge

Archives the historic records to a file and purges the archived records from the database.

Purge Only

Purges historic records from the database, but they are not written to the archive file.

Archive Only (Test Run)

Writes historic records to the archive file without purging them from the database. Use this option to test a newly created or edited archive and purge rule.

Config. Object Name

Specifies the name of the database object this rule can archive and purge. The Object Name field is automatically populated according to your selection in the Config. Object Name field.

Days Inactive

Specifies the number of days a record is inactive to be eligible for the archive and purge from the database.

Additional Query

Archives and purges specific inactive records among the existing inactive records. Use this field when you want to create different rules for archiving and purging the subsets of expired records for the same object. Use the same syntax as you use for stored queries.

The following query archives and purges only assigned inactive request records with a priority of 1:

priority = 1 AND (assignee IS NOT NULL OR group IS NOT NULL) and active = 0

The following query format archives and purges records based on time-span:

close_date < EndAtTime(\'LAST_YEAR\')