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:
user is the database username.
password is the database user password.
server is the name of the machine on which the database resides.
database is the database or TNS name.
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.
Open a command window and navigate to the directory where you downloaded the scripts.
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
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.
purge_by_days.cmd - Purges the history data by the specified number of days.
arch_by_days.cmd - Archives the history data by the specified number of days.
Open a command window and navigate to the directory where you downloaded the scripts.
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.
Open a command window and navigate to the directory where you downloaded the scripts.
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.
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.
purge_by_bpname.cmd - Purges the history data by the specified Business Process name.
arch_by_bpname.cmd - Archives the history data by the specified Business Process name.
Open a command window and navigate to the directory where you downloaded the scripts.
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.
Open a command window and navigate to the directory where you downloaded the scripts.
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.
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.
purge_by_appname.cmd - Purges the history data by the specified application name.
arch_by_appname.cmd - Archives the history data by the specified application name.
Open a command window and navigate to the directory where you downloaded the scripts.
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.
Open a command window and navigate to the directory where you downloaded the scripts.
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.