Using Archive, Purge, and Restore operations in NCM
search cancel

Using Archive, Purge, and Restore operations in NCM

book

Article ID: 315710

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

To provide steps on how to use the Archive, Purge, and Restore operations in the Network Configuration Manager (NCM) and what these operations do.

Environment

NCM 10.1.X

Resolution

Steps:

  1. Shut down NCM services on the Application Server prior running the db-utility tool
  2. Ensure that NCM services are stopped on the Application Server before implementing any Archive, Purge, and Restore operations in the Network Configuration Manager.
  3. Open a command prompt and navigate to $VOYENCE_HOME/tools/db-utility/.

    For example:
    cd /opt/smart-ncm/tools/db-utility/
    
  4. Run the database-utility.pl script using the following syntax:

    ./database-utility.pl <COMMAND> <TYPE> <ARGUMENTS>
    • Where <COMMAND> is archive, delete, purge, prune, or restore.
    • Where <TYPE> is auditHistory, events, jobs, latestRAAuditTrail, or revisions
    • Where <ARGUMENTS> contains the required arguments defined below.

Arguments:

The following are the required arguments for the value, when using the perl database-utility.pl script.

The events type requires two arguments:

  • Type of event (device, system, security, or all)
  • Number of days to retain (for example, 1, 2, 3)

The jobs type requires one argument:

  • Number of days to retain (for example, 1, 2, 3)

The revisions type requires one argument:

  • Number of revisions to retain per device (for example 1, 2, 3)

If the <COMMAND TYPE> is delete revisions, it needs two arguments:

  • Time interval for saving data enclosed in quotation marks

    For example: – Linux: ‘2 years’ or ‘3 days’ – Windows: “2 years” or “3 days”

  • Number of revisions to retain per device (for example 1, 2, 3).

If the <COMMAND TYPE> is purge ra, no arguments are required.

If the <COMMAND TYPE> is retain latestRAAuditTrail, no arguments are required.

  • This option deletes all the old Audit Trail records from RA tables like cm_rpt* and retains only the latest Audit Trail record.

If the <COMMAND TYPE> is purge auditHistory, it needs one argument:

  • Number of days to retain the audit data (for example, 1,2,3)
     

Note: Event Pruning retains last Nx24 hours of events, whereas Job Pruning retains last N days of
jobs.

Examples: The following examples show the usage for the database-utility.pl script

  database-utility.pl archive events all 14
  database-utility.pl archive jobs 30
  database-utility.pl archive revisions 5
  database-utility.pl purge jobs 90
  database-utility.pl purge events system 30
  database-utility.pl prune revisions 10
  database-utility.pl purge ra
  database-utility.pl delete revisions '2 years' 10 -->This example retains 2 years of revision data and also maintains 10 revisions per device. It deletes all other revisions from the voyence schema.
  database-utility.pl delete revisions '30 days' 5
  database-utility.pl delete revisions '6 months' 5
  database-utility.pl  purge auditHistory 30
  database-utility.pl  retain latestRAAuditTrail