Archiving and restoring data in the Performance Data Warehouse database

You use the archive command to mark records in the Performance Data Warehouse with an ARCHIVED time stamp. You use the restore command to null out the ARCHIVED time stamp. Both commands leave the database in a pending state, and you use the pending command to complete the archive or restore operation.

When you use one of the commands, a SQL script is generated, which you can use to make the appropriate database changes. You can run the resulting SQL scripts by using the database application appropriate for your environment, or you can use the execute argument included with the command-line tool.

The commands are described in the following table:

Table 1. Archive, restore, and pending commands
Command Action
archive Archives the snapshots that you specify and marks all the metadata in those snapshots with an ARCHIVED time stamp. IBM® Business Process Manager does not use archived metadata when it generates Performance Data Warehouse schema and views.

To specify snapshots, use the ID for each snapshot from the SNAPSHOTS view in the performance database.

restore Restores the snapshots that you specify by nulling out the ARCHIVED time stamp and allowing the metadata of the snapshots to contribute to the Performance Data Warehouse physical schema and views.

To specify snapshots, use the ID for each snapshot from the SNAPSHOTS view in the performance database.

pending Identifies failed definition records and resolves their pending state. You can review and then commit pending schema changes from the archive and restore commands.

Before you begin

Before you run a command, complete the following tasks:

  • Ensure that you have installed or upgraded your Performance Data Warehouses to the latest version of IBM BPM.
  • Start the Performance Data Warehouse. If you are running in a clustered environment, ensure that all servers in the cluster are running.
  • Create a backup of the performance database.
  • Go to the following directory: install_root\profiles\profile_name\bin
    Remember: perfDWTool must be run from an active node in the support cluster.

Pending arguments

The following arguments are available for use with the pending command:

Note: The archive and restore commands leave the system with pending actions, so you must use the pending command to either preview or complete the schema changes.
Table 2. Arguments available for the pending command
Argument Action
-preview Generates a preview of the SQL script that was generated as a result of the invoked command. No changes are made to the database.
-prepare Generates a preview of the SQL script and prepares the database for the pending actions.
-execute Invokes the command without providing a preview SQL script.
Note: Use the -execute argument with extreme caution. It is run when the Performance Data Warehouse is running (online), and you cannot review the SQL script before its start.

If the scope of changes is complex, there is a chance of data loss because, during the running of the command, data might become out of sync, which might cause a failure from which the system is not able to recover.

Running the archive command

You can invoke the archive command as shown in the following example:

perfDWTool.bat -u user_name -p password -nodeName node_name archive snapshot-id-1 snapshot-id-2 ...

Where snapshot-id is the SNAPSHOT_ID from the SNAPSHOTS view in the Performance Data Warehouse database.

Use the pending command to complete the archive. You can use the pending command with the -preview argument to review the changes before they are completed. Or, you can simply start the archive by using the pending command with the -execute argument.

Running the restore command

You can invoke the restore command as shown in the following example:

perfDWTool.bat -u user_name -p password -nodeName node_name restore snapshot-id-1 snapshot-id-2 ...

Where snapshot-id is the SNAPSHOT_ID from the SNAPSHOTS view in the Performance Data Warehouse database.

Use the pending command to complete the restore. You can use the pending command with the -preview argument to review the changes before they are completed. Or, you can simply run the restore by using the pending command with the -execute argument.

Running the pending command

To invoke the pending command with the -preview argument, complete the following steps:

  1. Run the pending -preview command against the performance database as shown in the following example:

    perfDWTool.bat -u user_name -p password -nodeName node_name pending -preview c:\temp\PS_pending_script.sql

  2. Review the SQL script that was saved to the specified output file (c:\temp\PS_pending_script.sql, in this example).

To invoke the pending command with the -prepare argument, complete the following steps:

  1. Run the pending -prepare command against the performance database as shown in the following example:

    perfDWTool.bat -u user_name -p password -nodeName node_name pending -prepare c:\temp\PS_pending_script.sql

    The command-line tool creates the SQL script and prepares to move the pending records to the database. During this time, data loading is disabled until the pending actions are complete.

  2. Stop all Performance Data Warehouses.
  3. Review the SQL script that was saved to the specified output file (c:\temp\PS_pending_script.sql, in this example).
  4. Run the SQL script against the performance database by using the database maintenance tool of your choice.

    The pending records are added to the database.

  5. Restart all Performance Data Warehouses.
Important: Use the pending -execute command only in a development environment where potential data loss is not a concern.

To invoke the pending command with the -execute argument, complete the following steps:

  • Run the pending -execute command against the performance database as shown in the following example:

    perfDWTool.bat -u user_name -p password -nodeName node_name pending -execute

    The command-line tool runs the SQL script against the performance database so that tracked data records that were in a pending state are successfully transferred to the database.