Command Line Purge Examples

Note: The password or encrypted password is required when the com.tibco.mdm.clipassword.enable property is set to true in the Configurator.

Example Specify in Command Line Expected Output
Purge History and Event
Purge History Older than 100 Days for All Enterprises datacleanup.bat -o history
-an ALL -d 100
-m = IDofSuperuser
Purge history older than 100 days for all enterprises.
Purge History Older than 100 Days for an Enterprise ID 239382 datacleanup.bat -o history
-a 239382 -d 100
-m 20101
Purge history older than 100 days for an enterprise ID 239382.
Purge History Older than 100 Days for a Specific Enterprise datacleanup.bat -o history
-an MYENTP1 -d 100
-m 20101
Purge history older than 100 days, for enterprise = MYENTP1 and member ID=20101
Purge history older than 90 days for a specific enterprise datacleanup.bat -o history
-an MYENTP1 -mn admin
-pp MEDIUM
Purge history older than 90 days, for enterprise = MYENTP1 and member ID=20101

PurgePolicy MEDIUM indicates 90 days retention

Purge History for a Repository with start date and end date datacleanup.bat -o history
-a 35320 -sd "2016-01-14 00:00:00" -ed "2016-01-17 00:00:00"
-m 35623 -pwd k
Purge history for an enterprise "35320" with start date "2016-01-14" and end date "2016-01-17".
Purge History Older than 100 Days and In-progress Event for All Enterprises datacleanup.bat -o historyForce
-an ALL -d 100
-m IDofSuperuser
Purge history older than 100 days, including the inprogress events for all the enterprises using an ID of the superuser, that is, tadmin.
Purge Policy datacleanup.bat -o history
-an TEST1 -mn admin
-pp MEDIUM
Purges history older than 90 days, for enterprise = TEST1 (Purge history PurgePolicy MEDIUM means a 90-day retention).
Purge an Event ID datacleanup.bat -o event
-an MYENTP1 -e 38990
-m 20101
Purge an event with an event ID 38990 for enterprise = MYENTP1 and member ID=20101.
Record Versions
Clean up Record Versions for a Repository datacleanup.bat -o recordversions
-r 68990 -d 90
-v 3 -m 20101
Cleans all record versions for a repository ID 68990 and member ID 20101 with cut off date as 90 days and at least 3 versions prior to cut-off date.
Clean up Record Versions for a Repository within an Enterprise datacleanup.bat -o recordversions
-rn MYREPO -a 68990
-d 90 -v 3 -m 20101
Cleans all record versions for a repository= MYREPO and enterprise ID 68990 and member ID 20101 with cut off date as 90 days and at least 3 versions prior to cut off date.
Clean up Record Versions for All Repositories within an Enterprise datacleanup.bat -o recordversions
-a 68990 -rn ALL
-d 90 -v 3 -m 20101
Cleans record versions for all repositories in an enterprise ID 68990 and member ID 20101 with cut off date as 90 days and at least 3 versions prior to cut off date.
Clean up Record Versions for All Repositories within All Enterprises datacleanup.bat -o recordversions
-an ALL -rn ALL
-d 90 -v 3 -m = tadmin user id
Cleans record versions for all repositories in all enterprise for using tadmin user ID with cut off date as 90 days and at least 3 versions prior to cut off date.
Purge all Records for a Repository with Start Date and End Date datacleanup.bat -o recordversions
-r 36000 -sd "2016-01-14 00:00:00"
-ed "2016-01-17 00:00:00" -v 3
-m 35623 -pwd k
Purge record versions for repository ID "36000" with start date "2016-01-14" and end date "2016-01-17" for member ID "35623" and at least three versions prior to end date.
Purge Record Versions for a Repository and Retain Only the Golden Copy Version datacleanup.bat -o recordversionsGoldenCopy
-an TEST1 -mn admin
-rn MYREPO
Purges record versions and only retains the Golden Copy version with the enterprise name TEST1 with member name admin and repository name MYREPO.
Incremental Purge datacleanup.bat -o recordversions
-an TEST1 -mn admin
-rn MYREPO -d 90
-v 3 -ip Y -n JOBNAME1
Purges all record versions with Incremental=true for the repository name MYREPO and enterprise name TEST1 and the user admin with cut off date as 90 days and at least 3 versions prior to cut off date and the job name as JOBNAME1.
Time and Record Count Bounded Purge

When both the execution modes are specified, time bounded purge takes precedence. It is best to use one execution mode at a time.

Cleans up record versions for a specific time duration for all repositories within an enterprise datacleanup.bat -o recordversions
-an ACME -mn ACME
-rn ALL -d 30 -v 3 -tbp 3600 -pwd abc

Cleans record versions for an hour with cut off date as 30 days with at least 3 versions prior to cut off date for all repositories in the ACME enterprise for ACME member name.

Purges records based on the specific record count for all repositories within an enterprise datacleanup.bat -o recordversions
-an ACME -mn ACME
-rn ALL -d 30 -v 3
-rcbp 1000000 -pwd abc
Cleans one million records with cut off date as 30 days with at least 3 versions prior to cut off date for all repositories in the ACME enterprise for ACME member name.
Cleans up golden copy record versions for a specific time duration for all repositories within an enterprise datacleanup.bat -o recordversionsGoldenCopy
-an ACME -mn ACME
-rn ALL
-tbp 3600 -pwd abc
Cleans golden copy record versions for one hour for all repositories within ACME enterprise.
Purges golden copy records based on the record count specified; purge applies to all repositories within an enterprise datacleanup.bat -o recordversionsGoldenCopy
-an ACME -mn ACME
-rn ALL -rcbp 1000000
-pwd abc
Cleans one million golden copy records with cut off date as 30 days with at least 3 versions prior to cut off date for all repositories in the ACME enterprise for ACME member name.
Cleans up record versions for the specified duration. You can specify the job name for all repositories within an enterprise datacleanup.bat -o recordversions
-an ACME -mn ACME
-rn ALL -d 30 -v 3
-tbp 3600 -n x111 -pwd abc
Cleans record versions for the x111 name for an hour with cut off date as 30 days with at least 3 versions prior to cut off date for all repositories in the ACME enterprise for ACME member name.

If the name (-n) is not specified, the following purge execution modes are used for running the purge operation:

  • For all enterprises: $executionmode "allenterprises"
  • For an enterprise: $executionmode $enterprisename
  • For a repository: $executionmode $enterpriseID_$repositoryname or $executionmode_$enterprisename $repositoryname

Clean up Repository
Purge All Records of a Repository datacleanup.bat -o repository
-r 29390 -m 20101
Purges all records of a repository ID 29390 and member ID 20101.
Purge All Records for a Repository with an Enterprise ID datacleanup.bat -o repository
-rn MYREPO -a 68990
-m 20101
Purges all records of a repository =MYREPO and enterprise ID 68990 and member ID 20101.
Purge All Records for a Repository within an Enterprise datacleanup.bat -o repository
-rn MYREPO -an MYENTP1
-m 20101
Purges all records of a repository =MYREPO and enterprise = MYENTP1 and member ID 20101.
Purge All Records for All Repositories of an Enterprise datacleanup.bat -o repository
-a 69390 -rn ALL
-m 20101
Purges all records of all repositories and enterprise ID 69390 and member ID 20101.
Clean up Metadata
Clean up Metadata for a Repository within an Enterprise datacleanup.bat -o metadata
-a 68990 -rn MYREPO
-m 20101
Cleans metadata for a repository = MYREPO and enterprise ID 68990 and member ID 20101.
Clean up Metadata for a Repository within an Enterprise datacleanup.bat -o metadata
-an MYENTP1 -rn MYREPO
-m 20101
Cleans metadata for a repository = MYREPO and enterprise = MYENTP1 and member ID 20101.
Clean up Metadata for All Repositories within an Enterprise datacleanup.bat -o metadata
-a 68990 -rn ALL
-m 20101
Cleans metadata for all repositories ID 68990 and member ID 20101.
Clean up Metadata for a Data Source datacleanup.bat -o metadata
-ds 34291 -a 34326
-m 20101
Cleans metadata for a datasource 34291 for enterprise ID 34326 and member is 20101.
Clean up Metadata for a Data Source for an Enterprise datacleanup.bat -o metadata
-dsn MYDS -an MYENTP1
-m 20101
Cleans metadata for a datasource named MYDS for enterprise = MYENTP1 and member ID 20101.
Clean up Metadata for a Data Source for an Enterprise datacleanup.bat -o metadata
-dsn MYDS -a 68890
-m 20101
Cleans metadata for a datasource named MYDS for enterprise ID 68990 and member ID 20101.
Clean up Metadata for All Data Sources for an Enterprise datacleanup.bat -o metadata
-a 68990 -dsn ALL
-m 20101
Cleans metadata for all datasource for enterprise ID 68990 and member ID 20101.
Clean up Metadata for All Data Sources for an Enterprise datacleanup.bat -o metadata
-an MYENTP1 -dsn ALL
-m 20101
Cleans metadata for all datasource for enterprise = MYENTP1 and member ID 20101.
Clean up Metadata for All Data Sources for All Enterprises datacleanup.bat -o metadata
-an ALL -dsn ALL
-m = tadmin user id
Cleans metadata for all datasource for all enterprises and tadmin user ID.
Clean up Metadata Versions
Clean up Metadata Version for a Repository datacleanup.bat -o metadataversions
-r 68990 -m 20101
Cleans metadata versions for a repository ID 68990 and member is 20101.
Clean up Metadata Version for All Repositories within an Enterprise datacleanup.bat -o metadataversions
-a 68990 -rn ALL
-m 20101
Cleans metadata versions for all repositories of enterprise ID 68990 and member ID 20101.
Clean up Records
Purge Multiple Records with Bulk Mode datacleanup.bat -o record
-r 36000 -uf "../../MyResource/my_test.csv"
-m 20101 -b Y -pwd Abcdef1234
Purges multiple records with repository ID "3600" in the my_text.csv file with member ID "20101". The file path is relative to the user's home.
Purge Multiple Records with Batch Mode datacleanup.bat -o record
-r 36561 -uf "../../MyResource/example.csv"
-m 36483 -pwd Admin1234
Purges multiple records with repository ID "36561" in the example.csv file with member ID "36483". The file path is relative to the user's home.
Purge a Record with a Key datacleanup.bat -o record
-r 34921 -p 349390
-m 20101
Purges a record for repository ID 34921 with a key ID 349390 and member ID 20101.

When you purge a record with a record key, only the specified record is purged.

  • all the history for the specific record is removed.
  • the relationship between parent and child record is removed.

However, the child record is not removed until you explicitly remove it from the repository.

Note: To purge multiple record IDs in a single command, specify comma separated record IDs. For example, datacleanup.bat -o record
-r 34921 -p 349390,349440,339678
-m 20101

Delete Record Hierarchy
Purge the entire hierarchy for an enterprise datacleanup.bat -o record
-r 34948 -p 10023
-mn admin -an ACME
-pwd Tibco321 -dh y
Purges the entire hierarchy for the specified records with the 34948 repository ID and the 10023 record key ID from the ACME enterprise.
Purge hierarchy from the input file. The file path is relative to the user home. datacleanup.bat -o record
-r 34948 -uf "purge.txt"
-mn admin -an ACME -pwd Tibco321 -dh y

 

 

Purges the entire hierarchy for the specified records and the purge.txt input file from the ACME enterprise.

Purge hierarchy from the input file. The file path is absolute. datacleanup.bat -o record
-r 34948 -uf "C:\MDM_Installations\mdm\Purge\purge.txt"
-mn admin -an ACME
-pwd Tibco321 -dh y
Purge hierarchy from the input file, excluding multiple relationships. datacleanup.bat -o record
-r 41162 -uf "/bin/purge.txt"
-mn admin -an ACME -pwd Admin123
-dh y -exrel EmployeetoDepartment1,EmployeetoDepartment2
Purges the entire hierarchy for the specified records and the purge.txt input file from the ACME enterprise excluding the EmployeetoDepartment1 and EmployeetoDepartment2 relationship names.

The file is placed at a path relative to the user home.

Purge hierarchy with the preview mode. datacleanup.bat -o record
-r 41162 -uf "purge.txt"
-dh y -exrel rel1,rel2
-m 36483 -pwd Admin1234 -prev y
Print preview of qualified records in the purge log. Records are not deleted.
Purge relationships along with root records datacleanup.bat -o record -r 41162 -uf "purge.txt" - -ic rel1,rel2 -m 36483 -pwd Admin1234

Use -ic when delete hierarchy is false (-dh is not specified or -dh n).

You can specify relationships for the -ic option. The specified relationships and root records are deleted.

If -dh and -ic options are specified, -dh takes precedence.

Deleted Records
Purge All Deleted Records From a Repository datacleanup.bat -o deletedRecord
-an TEST1 -mn admin
-rn MYREPO
Purges all deleted records with the enterprise name TEST1 with member name admin and repository name MYREPO.
Purge 10,000 Deleted Records from a Repository datacleanup.bat -o deletedRecord
-an TEST1 -mn admin
-rn MYREPO -l 10000
Purges 10,000 deleted records with the enterprise name TEST1 with member name admin and repository name MYREPO.
Others
Purge Enterprise datacleanup.sh -o enterprise
-an ACME -mn tadmin
-pwd 'euc!1dAl'

where ACME is the enterprise to be purged and tadmin and euc!1dAl are super user credentials.

Removes all data pertaining to an enterprise. Be careful before deleting the enterprise as this command purges the entire enterprise.
Warning: Only the super user can delete an enterprise. If other user deletes the enterprise, a warning message is displayed: The user does not have a super user role permission. Only the super user can delete an enterprise.