Maintenance utilities > Audit Manager
audit_purge
Archives audit logs in TC XML format (based on retention period and audit log type) and purges audit log records. In addition, this utility supports archive and restore of audit logs: Use the nearline_archive argument to move the production data to the archive site. Use the nearline_restore argument to move the archive data from the archive site to the production site. Note The nearline arguments do not require -archive or -purge flags. Syntax audit_purge [-u=user-id {-p=password | -pf=password-file} -g=group] [-logtype=audit-log-business-object-name] {-purge | -archive | -archive-purge } [-sublogtype=process_audit | signoff_audit | other] [-retentionperiod=retention-period-of-audit-log-business-object] [-archivelocation=path-of-archive-location] [-nearline_archive] [-nearline_restore] [-maxlimit_nearline_archive_restore=max-audit-logs] [-batchsize_nearline_archive_restore=batch-size] [-dryrun] [-report_file] [-verbose] [-force_retraverse] [-max_limit=5000] [-opt_skip_exp_orgobj_allprops] [-objecttype=Item,ItemRevision,other ] [-eventtype=__Check_In,__Check_Out,modify,other] [-created_before=date, time] [-created_after=date, time] [-object_uids_file_path=file-path] [-groupname=dba, Engineering] [-owner=Tc_admin] [-skip_object_type=Dataset,Part,other] {-skipInProcessWorkflowAudit} [-objectid=objectid] [-h] Arguments -u Specifies the user ID. This must be a user with Teamcenter administration privileges. Note 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 cannot be replaced with the -pf argument. -pf Specifies the password file. For more information about managing password files, see the Teamcenter Utilities. 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. -logtype Specifies the name of the audit log business object. For example, Fnd0WorkflowAudit, Fnd0ScheduleAudit. Note If the audit log is Fnd0WorkflowAudit, you must also use the -sublogtype argument. -purge Purges the specified audit logs If you do not also specify the -retentionperiod argument, Teamcenter selects the retention period from the Fnd0RetentionPeriod business constant. -archive Archives the audit log in TC XML format. If you do not also specify the -archivelocation argument, Teamcenter uses the archive location specified in the Fnd0ArchiveLocation constant. -sublogtype Specifies the sublog types of the Fnd0WorkflowAudit object. The sublog types of the Fnd0WorkflowAudit object are process_audit and signoff_audit. -retentionperiod Specifies the retention period in days. For example, a value of 90 will purge/archive audit entries more than 90 days old. A value of 0 (zero) will not retain any log data; it will purge/archive the entire log. The -retentionperiod argument overrides the retention period specified in the Fnd0RetentionPeriod constant. Note -retentionperiod cannot be used with -created_before= or -created_after= options. -nearline_archive Archives audit records from production site to archive site and purges audit records from production site. This archives in-process workflow audit logs. Use the -skipInProcessWorkflowAudit argument to retain in-process audit logs at production site. Note Nearline archived audit records data can be restored from production site with -nearline _restore argument. -nearline_restore Restores audit records from archive site to production site and purges audit records from archive site. -maxlimit_nearline_archive_restore Indicates the maximum number of audit logs allowed for nearline archive and nearline restore per execution. The default limit is 1000000. Note This option should be used only when -nearline_archive or -nearline_restore argument is provided. -batchsize_nearline_archive_restore Indicates the number of audit logs to be processed per batch. The audit logs are processed in multiple batches based on the total number of audit logs found and the given batch size. The default batch size is 50000. Note This option should be used only when -nearline_archive or -nearline_restore argument is provided. -dryrun Performs dry run and reports the objects that would be archived or restored from production site. Note This option should be used only when -nearline_archive or -nearline_restore argument is provided. -report_file Specifies that a report be output to the given file path. Note This option should be used only when -nearline_archive or -nearline_restore argument is provided. -verbose Runs in Verbose mode to show detailed messages in the utility's output. Note This option should be used only when -nearline_archive or -nearline_restore argument is provided. -archivelocation Specifies the path of the archive location. The -archivelocation argument overrides the value of archive location specified in the Fnd0ArchiveLocation constant. -force_retraverse Re-archives audit logs. Use this argument with the -archive argument to archive the same objects again. -max_limit Specifies the maximum number of audit logs to archive per xml file. For example, filename_1.xml [1-5000 records], filename_2.xml [5001-10000 records] -opt_skip_exp_orgobj_allprops Provides the option to purge or archive audit records based on a specified object type. -objecttype=Item,ItemRevision,other Specifies the object type. Provides the option to purge or archive audit records based on a specified event object type. -eventtype=__Check_In,__Check_Out,modify,other Specifies the event type. Provides the option to purge or archive audit records based on a specified event type. -created_before=date, time Specifies the created before date and time. Provides the option to purge or archive audit records created before a specified date. -created_after=date, time Specifies the created after date and time. Provides the option to purge or archive audit records created after a specified date. Note -retentionperiod cannot be used with -created_before= or -created_after= options. -object_uids_file_path=file-path Specifies the file path of a .txt file created by the administrator that contains the UIDs of the workspace objects for which audit logs were generated. Provides the option to purge or archive audit records based on the UIDs of workspace objects in the .txt file. -groupname=dba, Engineering Specifies the group name. Provides the option to purge or archive audit records based on a specified group. -owner=Tc_admin Specifies the User id. Provides the option to purge or archive audit records based on a specified owner. -skip_object_type=Dataset,Part,other Specifies the object type to skip. Provides the option to skip the object type during purge. Note -skip_objecttype and -objecttype cannot be used together. -skipInProcessWorkflowAudit Provides the option to archive or purge audit records for completed and aborted workflows. Note This should be used when -logtype is Fnd0WorkflowAudit. -objectid=objectid Provides the option to purge or archive audit records based on a specified object. Note Value of object id should be Primary Object ID for Audit record. -h Displays help for this utility. Restrictions Requires Teamcenter administrator privileges. Examples Note When archiving or purging the Fnd0WorkflowAudit audit log, you must use the -sublogtype argument with the -logtype argument. The sublog types of the Fnd0WorkflowAudit audit log are process_audit and signoff_audit. To purge the signoff audit logs of the Fnd0WorkflowAudit signoff audit log: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0WorkflowAudit -sublogtype=signoff_audit -purge -retentionperiod=90 To purge the process audit logs of the Fnd0WorkflowAudit signoff audit log with a retention period of 90 days: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0WorkflowAudit -sublogtype=process_audit -purge -retentionperiod=90 Note Data more than 90 days old will be purged. Data generated within 90 days will be not be purged. To archive the process audit logs of the Fnd0WorkflowAudit audit log: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0WorkflowAudit -sublogtype=process_audit -archive -retentionperiod=90 -archivelocation=c:\archive
To archive the process audit logs of the Fnd0WorkflowAudit audit log with a retention period 90 days: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0WorkflowAudit -sublogtype=process_audit -archive -retentionperiod=90 -archivelocation=c:\archive To archive the process audit logs of the Fnd0WorkflowAudit audit log with the archive location specified as c:\archive: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0WorkflowAudit -sublogtype=process_audit -archive -retentionperiod=90 -archivelocation=c:\archive To purge audit records based on persistence object model object types: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -objecttype=Document -purge -retentionperiod=90 To purge or archive audit records based on a check in event: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -eventtype=__Check_In -purge -retentionperiod=90 To purge audit records created before June 16, 2018 at 4pm: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -created_before="16-Jun-2018 16:00" -purge To purge audit records created after June 16, 2018 at 4pm: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -created_after="16-Jun-2018 16:00" -purge To purge audit records specific to the Engineering group: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -groupname=Engineering -purge -retentionperiod=90 To purge audit records owned by a user named Paul Programmer: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -owner=Paul -purge -retentionperiod=90 To skip persistence object model object types during purge: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -skip_object_type=Document -purge -retentionperiod=90 To archive audit records data from production site to the archive site for specified time period of 30 days: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -created_after="01-Jun-2018 00:00" -created_before="30-Jun-2018 00:00" -nearline_archive To restore the general audit logs of object of having id as 200012 from the archive site to the production site keeping latest 90 day’s audit records data: Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -objectid=200012 -retentionperiod=90 -nearline_restore To archive 1100000 audit logs, set the maximum limit to 1100000. Note If you do not specify the maximum limit argument, you will not be able to archive audit logs exceeding 1000000 for the given input arguments. Copy audit_purge -u=Tc-admin-user -p=password -g=group -logtype=Fnd0GeneralAudit -created_after="09-Mar-2020 00:15" -created_before="30-Mar-2020 00:16" -verbose -nearline_archive -maxlimit_nearline_archive_restore=1100000 To restore 5000 audit logs in two batches, you can set the batch size to 3000: Note If you do not specify the batch size argument in this example, all 5000 audit logs are restored in a single batch. Copy audit_purge -u=Tc-admin-user p=password -g=group -logtype=Fnd0GeneralAudit -created_after="09-Mar-2020 00:15" -created_before="09-Mar-2020 00:16" -verbose -nearline_archive -batchsize_nearline_archive_restore=3000 Related Topics Audit Logs Management
Source: https://docs.sw.siemens.com/documentation/external/PL20251212545240207/en-US/tc_help/utilities_reference/mna1737253705286/svn1737253705693/xid453102.html · retrieved Fri Jul 31 2026 00:00:00 GMT+0000 (Coordinated Universal Time)