Volume and database management utilities
purge_datasets
Removes (purges) old versions of datasets from the database and outputs a list of each dataset purged, along with the owning user and group. Note Normally, Teamcenter stores a fixed number of dataset versions in the database. The maximum number of datasets retained is set using the AE_dataset_default_keep_limit preference. Certain conditions prevent automatic purging of old datasets. For example, when a user does not have permission to purge a dataset owned by another user, or when a group is given read/write permission but not delete permission. Additionally, datasets are not purged when the named references in version0 do not match the named references in the latest dataset version. Use the -skipInconsistencyCheck argument to bypass this named references check. Use this argument only in situations in which you know why the named references differ and are confident that purging the older dataset versions will not result in loss of needed data. Possible situations include CAD integrations in which custom code is implemented, wrong coding exists from custom ITK programs, and PLM XML import. Before using the -skipInconsistencyCheck argument, run this utility without the argument and review the output for any failed purges. Investigate all datasets that did not purge, correcting problems if necessary. For example, version0 of a dataset contains three named references: a.txt, b.txt and c.txt. The latest version of the same dataset contains two named references: a.txt and b.txt. Using this utility to purge this dataset fails because of the inconsistency between the named references. The utility logs an inconsistent data message. In this situation, you should compare the named references between the versions and resolve the inconsistency if necessary. Compare the named references of the two versions in the rich client by choosing View→Named References. Correct the inconsistency by copying the c.txt named reference from version0 to the clipboard, then pasting it into the latest version. The named references must be in the same order for both versions. Rerunning the utility would purge this dataset. Alternatively, checking the dataset out, making changes, and checking it back in synchronizes the named references between the versions. If it is not possible to synchronize the named references, for example, the datasets are already released (and thus read-only), then use the -skipInconsistencyCheck argument to purge the datasets. Syntax purge_datasets [-u=user-id {-p=password | -pf=password-file} -g=group] [-b=beginning_anchor] [-e=ending_anchor] [-k=keep-limit] [-set] [-report] [-replica_only] [-site=site-name] [-start_date="DD-MMM-YYYY HH:MM:SS"] [-end_date="DD-MMM-YYYY HH:MM:SS"] [-itemidsfile=item-id-file-name] [-itemKeyFile=item-key-file-name] [-grmtypesfile=relation-types-file-name] [-anchorfile=revision-anchor-file-name] [-includeFolderContents] [-skipInconsistencyCheck] [-h] Arguments -u Specifies the user ID. This is a user with Teamcenter administration privileges. If Security Services single sign-on (SSO) is enabled for your server, the -u and -p arguments are authenticated externally through SSO rather than being authenticated against the Teamcenter database. If you do not supply these arguments, then the utility attempts to join an existing SSO session. If no session is found, you are prompted to enter a user ID and password. -p Specifies the password. -pf Specifies the password file. For more information about managing password files, see Manage password files. This argument is mutually exclusive with the -p argument. -g Specifies the group associated with the user. If used without a value, the user's default group is assumed. -b Specifies the first version anchor (beginning_anchor) of a contiguous series to be purged. The default value is 1. Version anchors are objects that keep track of a set of versions of an object. Datasets are one such class of objects. -e Specifies the last version anchor (ending_anchor) of a contiguous series to be purged. The default value is last. Version anchors are objects that keep track of a set of versions of an object. Datasets are one such class of objects. -k Specifies the keep limit for purging. For example, if the -k argument is set to -k=4, then a dataset is purged down to four versions. If the -k argument is not used, then the current version limit of the dataset is used as the purge keep limit. -set For the datasets to be purged, sets the version limit to the -k argument value. The -set argument has no effect if the -k argument is not used. -report Produces output showing the datasets to be purged, but does not purge the datasets from the database. -replica_only Specifies that only replica datasets are purged. The -site argument can be used in conjunction with the -replica_only argument to purge only the datasets replicated from a specific site. -site Specifies the site from which replica datasets are purged. Valid only in conjunction with the -replica_only argument. -start_date Specifies the start date/time for which datasets are purged. -end_date Specifies the end date/time for which datasets are purged. This argument is optional and must be used only with the -start_date argument. -itemidsfile Specifies an input file containing a list of item IDs. Use the -itemidsfile argument followed by the directory path and file name. In the input file, enter one item ID per line, or you can enter multiple item IDs on one line separated by commas. For example, a file item_uid.txt might contain this list: Copy 000041 000051 000078 -itemKeyFile Specifies an input file containing a list of item keys <attr1=value1,attr2=value2,...>. Use the -itemKeyFile argument followed by the directory path and file name. In the input file, enter one item key per line, or you can enter multiple item IDs on one line separated by commas. -grmtypesfile Specifies an input file containing a list of specified relation types to use. Enter one relation type per line, or enter multiple relation types on one line separated by commas. If this parameter is not specified, then all relation types are used. This parameter is valid only with the -itemidsfile argument. -anchorfile Specifies the name of a file that contains UIDs of revision anchors to process. On very large databases, the number of objects processed may make this utility run slow or fail. Using an anchor file can prevent failures and increase the speed of the dataset purge process. To generate a list of UIDs to process, use the item_report utility with its -anchorfile argument. -includeFolderContents Gets all the datasets related to the Item IDs specified for purge in the input file in -itemidsfile. This parameter is optional and is valid only with the -itemidsfile argument. -skipInconsistencyCheck Bypasses the consistency check of named references and purges previous versions of a dataset even if the named references in version0 of the dataset are not the same as the named references in the latest version. If -skipInconsistencyCheck is not specified, then a dataset is not purged if the named references in version0 of the dataset are not the same as the named references in the latest version. -h Displays help for this utility. Environment As specified in Manually configure the Teamcenter environment.. Files As specified in Log files produced by Teamcenter. Restrictions The purge_datasets utility must be run by the a user with Teamcenter administration privileges. This automatically enables the bypass feature and purges old datasets regardless of owning user and group. Examples Purge the range of contiguous datasets down to the specified keep limit, and set the version limit of the current dataset to the keep limit value: Copy $TC_BIN\purge_datasets -u=Tc-admin-user -p=password -g=group -b=beginning-anchor -e=ending-anchor -k=keep-limit -set Purge datasets with specified item ids, and also purge their related items: Copy $TC_BIN\purge_datasets -u=Tc-admin-user -p=password -g=group -itemidsfile=D:\workdir\item_uid.txt -includeFolderContents Related Topics Introduction to administering volumes
Source: https://docs.sw.siemens.com/documentation/external/PL20251212545240207/en-US/tc_help/utilities_reference/uqa1737253718952/purge_datasets.html · retrieved Fri Jul 31 2026 00:00:00 GMT+0000 (Coordinated Universal Time)