Volume and database management utilities
dataset_cleanup
Repairs corrupted datasets and removes orphaned datasets and revision anchors. Caution Siemens Digital Industries Software recommends that you run this utility only when there is no other activity on the database. Problem Identifiers A dataset is identified as corrupted if any of the following problems are found: Dataset has no reference to an ImanFile object. Dataset has reference to an ImanFile object, but the corresponding operating system file does not exist and the dataset is not archived. Dataset is an orphan (that is, the dataset refers to the anchor but the anchor does not go to dataset). Anchor refers to datasets that do not exist. Anchor size = 0. Object Cleanup Rules A dataset object is reattached to revision anchor if it is an orphan but is referenced by some other objects, or deleted if it meets the following criteria: Dataset is an orphan and is not referenced. Dataset is not archived and the associated operating system file does not exist. Anchor cleanup rules The dataset_cleanup utility repairs dataset revision anchors as follows: If the anchor refers to nonexistent datasets, the references are removed from the anchor. If the anchor size = 0, the anchor is deleted. Syntax dataset_cleanup [-u=user-id {-p=password | -pf=password-file} -g=group] [-reportCorruption | -fixCorruption | -reportBadAnchor | -fixBadAnchor | -reportRestorable | -fixRestorable | -reportOrphan | -deleteOrphan] -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, 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. This argument is mutually exclusive with the -pf argument. -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. -reportCorruption Generates a report of all corrupted dataset versions and anchors. The report file, dataset_cleanup_actions.log, is generated in the running directory and overwrites any existing dataset_cleanup.log file. -fixCorruption Either fixes or removes all corrupted dataset versions and anchors. A report file of corrections, dataset_cleanup.log, is generated in the running directory and overwrites any existing dataset_cleanup.log file. -reportBadAnchor Generates a report of all bad anchors. The report file, dataset_cleanup.log, is generated in the running directory and overwrites any existing dataset_cleanup.log file. -fixBadAnchor Fixes all bad dataset anchors. The report file, dataset_cleanup_fix_anchor.log, is generated in the running directory and overwrites any existing dataset_cleanup.log file. -reportRestorable Generates a report of all restorable orphaned datasets. The report file, dataset_cleanup.log, is generated in the running directory and overwrites any existing dataset_cleanup.log file. -fixRestorable Fixes all restorable orphaned datasets. The report file, dataset_cleanup_restore.log, is generated in the running directory and overwrites any existing dataset_cleanup.log file. -reportOrphan Generates a report of all invalid and orphaned datasets. The report file, dataset_cleanup.log, is generated in the running directory and overwrites any existing dataset_cleanup.log file. -deleteOrphan Deletes all invalid and orphaned datasets. The report file, dataset_cleanup_delete.log, is generated in the running directory and overwrites any existing dataset_cleanup.log file. -h Displays help for this utility. Legacy dataset_cleanup [-u=user-id {-p=password | -pf=password-file} -g=group] -rf=file-name | -if=file-name [-of=log-file-name] [-b=beginning-anchor] [-e=ending-anchor] [-start_date=start-date] [-end_date=end-date] -h -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, 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. This argument is mutually exclusive with the -pf argument. -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. -rf Creates a report file listing the corrupted datasets. If the location of the output file should be other than the current folder, include the path as well as the output file name. -if Uses the report file as input to purge corrupted and orphaned datasets and repair revision anchors. Caution This option deletes orphaned datasets. Carefully examine the input file and remove from the list any orphaned datasets that you wish to retain. It is also an administrative best practice to paste important datasets into a folder to prevent inadvertent deletion. -of Cleans up and logs the results to a log file. This argument must be supplied if the -if argument is used but is optional with the -rf argument. -a Specifies that corrupt anchors (those that are orphaned and are not referenced by a dataset) be deleted and a message be provided. -b Specifies the first revision anchor of a contiguous series to be repaired. The default value is 1. -e Specifies the last revision anchor of a contiguous series to be repaired. The default value is last. A revision anchor is an object that keeps track of a set of revisions of some object. One such class of objects is datasets. -start_date Specifies the starting date to search for datasets that have been modified from this date. Use this argument with the -end_date argument. The format of the date is “DD-MMM-YYYY HH:MM:SS” and must be inside the double quotes because of the space between the year and the hour. This argument is used only with the -rf argument. -end_date Specifies the ending date to search for datasets that have been modified until this date. This argument is optional and is used only with the -start_date argument. If this argument is not specified, the end date is the current date. The format of the date is “DD-MMM-YYYY HH:MM:SS” and must be inside the double quotes because of the space between the year and the hour. This argument is used only with the -rf argument. -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 None. Examples To generate a report file called myreportfile listing corrupted dataset objects, enter the following command on a single line: Copy $TC_ROOT/bin/dataset_cleanup -u=admin-user -p=admin-password -g=dba -rf=myreportfile To run the dataset_cleanup utility using the myreportfile file as input, enter the following command on a single line: Copy $TC_ROOT/bin/dataset_cleanup -u=admin-user -p=admin-password -g=dba -if=myreportfile -of=mylogfile On a database with 1000 dataset revision anchors, you could run the dataset_cleanup utility as follows: Copy $TC_BIN/dataset_cleanup -u=admin-user -p=admin-password -g=dba -b=1 -e=500 -rf=dataset_cleanup_500.report $TC_BIN/dataset_cleanup -u=admin-user -p=admin-password -g=dba -b=501 -e=1000 -rf=dataset_cleanup_1000.report To purge all datasets with modification dates between Oct-01-2020 and Oct-10-2020: Copy dataset_cleanup -u=admin-user -p=admin-password -g=dba -start_date="01-OCT-2020 00:00:00" -end_date="10-Oct-2020 00:00:00" -rf=ttt.txt To purge all datasets with modification dates from Oct-01-2020 to the current date: Copy dataset_cleanup -u=admin-user -p=admin-password -g=dba -start_date="01-OCT-2020 00:00:00" -rf=ttt.txt Cleaning Up Datasets and Repairing Revision Anchors Perform the following steps to clean up corrupted datasets: Use the dataset_cleanup utility to generate a report file called myreportfile listing the corrupted dataset objects in the database by entering the following command on a single line: Copy $TC_ROOT/bin/dataset_cleanup -u=admin-user -p=admin-password -g=dba -rf=myreportfile The report file contains a list of corrupted datasets sorted by Object_UID. The report also contains the problem identifier, dataset name, and ownership. If the -a argument is specified on the command line, the utility deletes the corrupt anchors and displays a message to the user. If the -a argument is not supplied, a message is displayed indicating that the anchor was skipped and the -a option should be used. You must review the report file and decide which datasets, if any, should not be purged from the database. Use a text editor to remove any references to dataset objects that should not be purged from the database from the report file. Run the dataset_cleanup utility using the myreportfile file as input to purge corrupted dataset objects from the database or fix anchors and log the results to the mylogfile file by entering the following command on a single line: Copy $TC_ROOT/bin/dataset_cleanup -u=admin-user -p=password -g=dba -if=myreportfile -of=mylogfile The utility attempts to fix the revision anchor, attach the dataset to another revision anchor, or purge the datasets from the database. A final output report is generated showing the results for each dataset. The report displays the following message if the operation is successful: Copy problem deleted If the operation is unsuccessful, the following message is displayed: Copy could not delete error stack number Display information about the dataset cleanup process by entering the following command: Copy ps -ef | grep data Kill the dataset cleanup process by entering the following command: Copy kill -9 PID PID is the operating system process ID returned in step 4. Related Topics Introduction to administering volumes
Source: https://docs.sw.siemens.com/documentation/external/PL20251212545240207/en-US/tc_help/utilities_reference/uqa1737253718952/dataset_cleanup.html · retrieved Fri Jul 31 2026 00:00:00 GMT+0000 (Coordinated Universal Time)