TeamcenterKnowledge

Data sharing utilities

sync_on_demand

Synchronizes or reports the synchronization state of a specified component, assembly, or object. The synchronization state indicates whether the replica is up-to-date and whether any object that has been added to the owning site has been replicated by the site running the utility. For 4th Generation Design (4GD) objects, this utility can be used to report the synchronization state of objects between the central site and the local site. The synchronization state of 4GD objects is not affected. The site that runs the sync_on_demand utility and the site that owns the component, assembly, or object being synchronized must both be instances of Teamcenter that support on-demand synchronization. If an assembly contains components from sites that do not support on-demand synchronization, the state of those components are reported as unknown. Component synchronization allows you to determine the state of, or synchronize, all objects associated with the specified revision, such as BVR and attachments. Assembly synchronization allows you to determine the state of, or synchronize, an entire assembly. Object synchronization allows you to determine the state of individual objects, such as a dataset or form. You can also select item or item revisions for object synchronization, however the state or objects associated with the item or item revision is not reported or affected. This utility uses the IDSM process at the remote replica's owning site to accomplish the report task and remote import to accomplish the synchronization. Syntax sync_on_demand [-u=user-id {-p=password | -pf=password-file} -g=group] -f ={sync | report [-uid_report=uid-report-file-name]} -type={object | component | assembly | 4GD -recipe=recipe-name -site=site-name-for-4gd-compare} [-rev_rule=revision-rule | -rev=rev-id] [-assy_level=number] [-item_id=item-id | -key=keyAttr1=keyVal1 [,keyAttr2=keyVal2]…[,keyAttrN=keyValN] | template | -folder=folder-name | -name=wso-name | -filename=file-name | -itemKeyFile=file-name] [-class=wso-class-name | -classoffile=class-name] [-exclude=relation-type1 [-exclude=relation-type2 …] ] [-include=relation-type3 [-include=relation-type4… ] ] [-exclude_folder_contents] [-exclude_protected_objects] [-exclude_protected_comp] [-batch_size=number-of-objects-per-batch] [-report_file=report-file-name] [-error_report=error-file-name] [-separator=uid-separator-characters] [-h] Arguments Note Entries in parentheses are accepted abbreviations for arguments. -u Specifies the user ID. This is 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 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. -f Specifies the function to perform. Valid values are sync or report (rep). Where sync performs a synchronization on the specified object, component, or assembly, and report returns the synchronization state. -uid_report (ur) Returns a report on the specified object, component, or assembly that contains the UIDs of objects enclosed within square brackets ([ ]) by default. The characters used to enclose the UIDs are configurable through the -separator argument. This file can be processed by a custom script to create an input file that the data_share utility uses to import objects from a remote site. Using UIDs for remote import increases performance by eliminating the remote query required to determine an item or item revision UID. -separator (sep) Designates the start and end characters used to enclose the UID of objects in a uid_report file. If this argument is not specified, the UIDs are enclosed in square brackets ([ ]). -type Specifies the type of Teamcenter object on which to perform the function. Valid values are: object (obj) component (comp) assembly (assy) 4GD Reports the status of 4GD object synchronization between the target site and the local site. Synchronization status (-f=report) is the only supported function for this type of object. See Restrictions.) -recipe Specifies the 4GD recipe name (mdl0SubsetDefinition) used for reporting 4GD synchronization state between sites. This argument is valid only with the report function (-f=report) argument and 4GD type (-type=4GD) argument. The recipe must exists and be identical at the sites being compared. The -site argument is also required and all other arguments are ignored. -site Specifies the central (target) site name. This site is compared to the local site (site where you are running the utility) for 4GD synchronization state reporting. This argument is only valid with the report function (-f=report) argument and 4GD type (-type=4GD) argument. The -recipe argument is also required and all other arguments are ignored. -rev_rule Specifies the name of the revision rule used to perform the synchronization or report function. This name must specify and existing revision rule at the local site. This value is passed to the owning site where it is used to determine the item revision to report status for or synchronize. You must supply this argument if the target object is an assembly. -rev Specifies the revision ID of the revision to report the status of or synchronize. -assy_level (al) Specifies the number of levels of the assembly to report. This argument is valid only for the report function. -item_id (item) Specifies the ID or template of items to report the status of or synchronize. Mutually exclusive with the -name, -folder, -key, -itemKeyFile, and -filename arguments. -key Specifies the keys of the items to export. Use the following format: Copy keyAttr1=keyVal1 ,keyAttr2=keyVal2… ,keyAttrN=keyValN To find the key of an object, use the get_key_string utility. For more information, see BMIDE for Data Model Design. Mutually exclusive with the -name, -folder, -filename, -itemKeyFile, and -item_id arguments. -folder (fl) Specifies the folder that contains the object to report the status of or synchronize. If the folder is not unique, the first folder found that matches this value is used. Mutually exclusive with the -name, -filename, -key, -itemKeyFile, and -item_id arguments. -name Specifies the name of a single workspace object to be precessed. If not an item, use the -class option to specify the class of the object. Mutually exclusive with the -folder, -filename, -key, -itemKeyFile, and -item_id options. -filename (fn) Specifies the name of the input file containing IDs or names of objects to report the status of or synchronize. Mutually exclusive with the -name, -folder, -key, -itemKeyFile, and -item_id arguments. If the input file contains names, the -classoffile argument is required. -itemKeyFile Specifies the name of the output file containing the keys to export, for example: -itemKeyFile=itemids.txt An example of the file format is: Copy item_id=export_001 item_id=M2Item1_001,object_name=M2Item_name1,object_type=M2Item1 To find the key of an object, use the get_key_string utility. For more information, see BMIDE for Data Model Design. Mutually exclusive with the -name, -folder, -filename, -key, and -item_id arguments. -class (cl) Specifies the Teamcenter class of the object specified by the -name argument. This argument is valid only with the -name argument. If not specified, Item is the default class. -classoffile (cof) Specifies the class of objects in the input file. This argument is valid only with the -filename argument. If not specified, Item is the default class. Folder is a valid class for synchronization. -exclude Excludes the specified relation type. This argument may be given multiple times and must use the database name (not the display name) of the relation type. Tip For best tcxml performance, use a closure rule for relation instead of include/exclude. -include Includes the specified relation type. This argument may be given multiple times and must use the database name (not the display name) of the relation type. Use this argument to force the inclusion of a relation type that may have been excluded during the last export. Tip For best tcxml performance, use a closure rule for relation instead of include/exclude. -exclude_folder_contents (efc) Excludes the contents of a folder. Intended for use with NX part families where family members are stored in a folder that is related to the item. -exclude_protected_object (epo) Excludes export protected objects. -exclude_protected_comp (epc) Excludes export protected components. This argument is valid only when the -type argument is set to assembly. -batch_size (bs) Specifies the number of objects per batch; a new process is created per batch. Default batch size is 1000. Must be a positive integer. This is useful when processing thousands of objects, because it helps avoid memory and disk space shortage problems. -report_file (rf) Generates a report that is output to the specified file. If the function specified is report, the report contains the synchronization state of each object, component, or components of an assembly. If the function specified is sync, the report shows all successful imports and any errors that occur during the synchronization. If the function specified is report and this argument is not supplied, the report is displayed in a shell (std out). -error_report (erep) Generates a error report that is output to the specified file. This file contains only error information. It provides no synchronization information. If a file name is not supplied, the report is displayed in a shell. This argument is normally used with the -sync argument to provide error information during the synchronization process. -h Displays help for this utility. Restrictions Identical 4GD search recipes must exist at both the local and central sites. The 4GD on demand synchronization feature requires the -f=report, -recipe, and -site arguments and supports the -report_file argument. All other arguments are not supported and are ignored if supplied. Examples Note Required logon information is omitted from the following examples. To synchronize an assembly and output any errors that occur to stdout: Copy sync_on_demand -f=sync -type=assembly -rev_rule="Latest Working" -item_id=Item100/A -error_report=err_rep.txt The assembly components are synchronized and errors are output to stdout. To generate a report called assy_sync.rpt for the Item100/A assembly: Enter the following command on a single line: Copy sync_on_demand -f=report -type=assy -rev_rule="Latest Working" -item_id=Item100/A -report_file=assy_sync.rpt An example of the contents of the assy_sync.rpt file on the owning site: Copy Component Owning Sync Master LMD Replica LMD Site State Item100/A Site1 09/25/05 09/25/05 Item100/A-view Site1 09/25/05 09/25/05 Item101/B Site2 out of date 10/25/05 09/25/05 Item101/B-view Site2 out of date 10/25/05 09/25/05 Item102/A Site2 09/25/05 09/25/05 Item102/A-view Site2 09/25/05 09/25/05 Item103/C Site1 09/25/05 09/25/05 Item104/B Site3 unknown The report contains components up to the highest level that is out-of-date within a branch. For example, in the sample report, the BVR of component Item101/B is out of date and no further expansion is done to show its children in this branch. The branch with Item102/A has an up to date BVR so it is expanded until a leaf node is encountered or until a BVR with an out-of-date or unknown status is found. To generate a report called comp_sync.rpt for the Item100 component: Enter the following command on a single line: Copy sync_on_demand -f=report -type=comp -rev_rule="Latest Working" -item_id=Item100/A -report_file=comp_sync.rpt An example of the contents of the comp_sync.rpt file on the owning site: Copy Object String Type Relation Owning Sync Master Replica Site State LMD LMD

Item100 Item out of date 10/25/05 09/25/05 Item100 Item Master IMAN_master_form Site1 09/25/05 09/25/05 Item100-view BOMView Item100/A Item Revision Revision Site1 out of date 10/25/05 09/25/05 Item100/A Rev Master IMAN_master_form Site1 09/25/05 09/25/05 Item100/A-spec UGMASTER IMAN_specification Site1 out of date 10/25/05 09/25/05 Item102/B-ref Text IMAN_reference Site2 unknown Item100/A-view BOMViewRev Site1 09/25/05 09/25/05 To create a file (uids_list.txt) containing UIDs that can be processed for use as input for the data_share utility: Copy sync_on_demand -f=report -uid_report=uids_list.txt To create both a report file (uids_list.txt) containing UIDs and a synchronization report file (sync.txt): Copy sync_on_demand -f=report -report_file=sync.txt -uid_report=uids_list.txt To create a report file (uids_list.txt) containing UIDs enclosed by brackets ({ }): Copy sync_on_demand -f=report -uid_report=uids_list.txt -sep="{}" To create a report file showing the synchronization status of 4GD data between the local and target site: Copy sync_on_demand -f=report -type=4GD -recipe=Bridge -report_file=4gd_report.txt -site=CentralSite Related Topics TC XML and PLM XML Configuration for Data Import and Export Multi-Site Collaboration

Source: https://docs.sw.siemens.com/documentation/external/PL20251212545240207/en-US/tc_help/utilities_reference/avt1737253695886/sync_on_demand.html · retrieved Fri Jul 31 2026 00:00:00 GMT+0000 (Coordinated Universal Time)