Purge Store Command

The Purge Store command is used to purge files from store locations.

This page discusses:

Syntax

purge store STORE_NAME [before DATE] [beforeAtime DATE] [commit N][continue] 
[location LOCATION_TARGET{,LOCATION_TARGET}] [!|not]deletefiles;

If the Purge Store command is used with just a store name, it does a purge on all locations, leaving files only in the default place defined in the store object. For example, if you wanted to purge all files in the store called Maps, you would enter the following MQL command:

purge store Maps;

Optional clauses provide more control over which files are deleted. In addition, you can trace the purge event using the trace type store command that logs the store’s events. For more information, see trace Command.

Before Clause

For more flexibility, you can add a date restriction to the Purge Store command to remove only files that were last checked in prior to the date specified in the command. For example, if you want to purge only files last checked in prior to February 28, 2014 at 9:57:32 AM EST in the store called Maps, enter the following MQL command:

purge store Maps before “Thu Feb 28, 2014 9:57:32 AM EST”;

BeforeAtime Clause

Include the BeforeAtime clause to remove files that were accessed before the date specified in the command. For example:

purge store Maps beforeAtime “Thu Feb 28, 2014 9:57:32 AM EST”;

If you use a date without specifying a time, the default time is set to 12:00:00 AM.

Continue Clause

Include the keyword continue if you don’t want the command to stop if an error occurs. If the log file is enabled, failures are listed in the file. For more information, see trace Command. For example:

purge store "Engineering-Dallas" continue;

If an error occurs when using the continue clause, the existing transaction is rolled back, so any database updates that it contained are not committed. The command starts again with the next business object. For this reason, when using the continue clause you should also include the commit clause, described below.

Commit N Clause

Include the commit N clause when purging large stores. The number N that follows specifies that the command should commit the database transaction after this many objects have been purged. The default is 10. For example:

purge store "Engineering-Dallas" continue commit 20;

Location Clause

To specify a subset of locations that you want purged, include the location clause. For example:

purge store "Engineering-Dallas" continue commit 20 location London,Paris,Milan;

When listing locations, delimit with a comma but no space.