Administering the Sun Business Process Manager Database

Purging and Archiving Sun BPM Data

Scripts for purging and archiving Sun BPM data are included with the compressed database files that you can download from Enterprise Designer (see Downloading the Compressed Script Files). The purge scripts delete older records (instances only) from the database tables based on the specified number of days, Business Process name, or application name. The archive scripts copy the history records into tables ending with _hist based on the specified number of days, Business Process name, or application name. Only records with a status of COMPLETE, ERROR, TERMINATED, ERROR_ON_RECOVER are purged or archived.

In the instructions in this section, the following arguments are used:

Installing the Purge and Archive Database Components

Before you can run the purge and archive scripts you need to install the stored procedures and tables to support the processes. Make sure you have created the database and downloaded the compressed database scripts as described in Downloading the Compressed Script Files before beginning this procedure.

ProcedureTo install the purge and archive database components

  1. Open a command window and navigate to the directory where you downloaded the scripts.

  2. Do one of the following:

    • For Oracle and DB2 databases, enter the following command:

      install_arch_and_purge_scripts user password database

    • For Sybase and SQL Server databases, enter the following command:

      install_arch_and_purge_scripts user password server database

Archiving and Purging by Retention Days

The following scripts are provided to archive and purge records based on the specified number days. The UNIX versions of these scripts have a .sh extension.

ProcedureTo purge records based on days

  1. Open a command window and navigate to the directory where you downloaded the scripts.

  2. Do one of the following:

    • For Oracle and DB2 databases, enter the following command:

      purge_by_days user password database days

    • For Sybase and SQL Server databases, enter the following command:

      purge_by_days user password server database days

    Where days is the number of days to retain. For example, if you specify 4 days, then any records older than 4 days are purged.

ProcedureTo archive records based on days

  1. Open a command window and navigate to the directory where you downloaded the scripts.

  2. Do one of the following:

    • For Oracle and DB2 databases, enter the following command:

      arch_by_days user password database days

    • For Sybase and SQL Server databases, enter the following command:

      arch_by_days user password server database days

    Where days is the number of days to retain. For example, if you specify 4 days, then any records older than 4 days are archived.

Archiving and Purging by Business Process Name

The following scripts are provided to archive and purge records based on the specified Business Process. The UNIX versions of these scripts have a .sh extension.

ProcedureTo purge records based on Business Process name

  1. Open a command window and navigate to the directory where you downloaded the scripts.

  2. Do one of the following:

    • For Oracle and DB2 databases, enter the following command:

      purge_by_bpname user password database name

    • For Sybase and SQL Server databases, enter the following command:

      purge_by_bpname user password server database name

    Where name is the Business Process name to purge. For example, if you specify BusinessProcess1, then all instances of BusinessProcess1 are purged.

ProcedureTo archive records based on Business Process name

  1. Open a command window and navigate to the directory where you downloaded the scripts.

  2. Do one of the following:

    • For Oracle and DB2 databases, enter the following command:

      arch_by_bpname user password database name

    • For Sybase and SQL Server databases, enter the following command:

      arch_by_bpname user password server database name

      Where name is the Business Process name to archive. For example, if you specify BusinessProcess1, then all instances of BusinessProcess1 are archived.

Archiving and Purging by Application Name

The following scripts are provided to archive and purge records based on the specified application. The UNIX versions of these scripts have a .sh extension.

ProcedureTo purge records based on application name

  1. Open a command window and navigate to the directory where you downloaded the scripts.

  2. Do one of the following:

    • For Oracle and DB2 databases, enter the following command:

      purge_by_appname user password database name

    • For Sybase and SQL Server databases, enter the following command:

      purge_by_appname user password server database name

      Where name is the application name to purge. For example, if you specify Application1, then all instances of Application1 data are purged.

ProcedureTo archive records based on application name

  1. Open a command window and navigate to the directory where you downloaded the scripts.

  2. Do one of the following:

    • For Oracle and DB2 databases, enter the following command:

      arch_by_appname user password database name

    • For Sybase and SQL Server databases, enter the following command:

      arch_by_appname user password server database name

      Where days is the application name to archive. For example, if you specify Application1, then all instances of Application1 data are archived.