Tips on using the DR Import-Relate-Copy feature to import a new version of a data model and copy mappings from the old version to the new version. This procedure can also be used to copy mappings from a logical model to a physical version of the same model, at least if you are using ERwin as a data modeling tool.
TMM installs pre-created ERwin report templates under “My Documents\Teradata Mapping Manager\ERwin TMM Reports” (different versions for ERwin 7 and ERwin 8). These Query Tool reports can be used to create TMM import files for your models. If you are not using ERwin, then you may have to create your own export reports...
1. Create the first pass of your logical data model, up to the point where you are ready to start creating TMM mappings for the model.
2. Use TMM-ERwin “query tool” report templates provided by TMM to export your logical model into TMM import files. Do not use the report builder 7.x reports as they cannot export attribute IDs. Use the examples that export entity and attribute IDs (e.g. Global-Attributes-8.2-v1.qry, creates data element custom property named AttributeUniqueId in the TMM import file, with the unique IDs populated in that property). There is an in-app help topic for using ERwin TMM Reports if you need help:
“Working with data representations > Creating data representations > Importing data representations > Using Erwin reports to create data representation import files”
3. Import the logical model as a data representation (DR), see in-app help topic if you do not remember how to do this from the TMM tutorial:
“Working with data representations > Creating data representations > Importing data representations ”
4. Start creating mappings in TMM to this DR.
5. Continue making changes, as needed, to the logical model in ERwin. If you need to make a copy of the model to create a change report later, or whatever, continue making changes in the original ERwin file. ERwin will change all the unique IDs in a copy of a model file, preventing you from using unique IDs to copy mappings in TMM.
If this is a problem for you, an option is to export the unique IDs and import them back into ERwin as User Defined Properties (UDPs), but that process is not described in this FAQ.
6. When you are ready to import a new logical model version into TMM, perform the following steps:
6a. If you made a lot of model changes, you may want to run a model change report now. I do not know how modelers do this, I have just seen the output. Of most interest are deleted entities and attributes that may have mappings in TMM. Also, entities or attributes that changed function such that mappings need to be reconsidered – you may want to force a change of unique ID for columns and/or tables where the latter happens – or just remember to check those mappings later.
6b. Use the import-relate operation to import the new model version and copy the mappings from the old version to the new version. The new DR will need a unique name, so you may want to include a version number in the DR names.
Here are the basic steps:
File > Import Content > type new DR Name in box, Select the “Relate this DR to another” option, Press Next > Select existing logical model DR from Existing DR Name drop-down list, Press Next > select import files, Press Next >
(Import Copy Function wizard step):
Click on one of the rows in Property Match Criteria box and press Delete to remove it (sometimes have to click on the second one to make selection work)
Repeat for the other row in Property Match Criteria
Find “AttributeUniqueId” or whatever you named the (old DR) unique attribute ID in Select Origin Property list and select it
Find “AttributeUniqueId” or whatever you named the (new DR) unique attribute ID in Select Destination Property list and select it
Press Add
Select Structure Properties option
Find “EntityUniqueId” or whatever you named the (old DR) unique entity ID in Select Origin Property list and select it
Find “EntityUniqueId” or whatever you named the (new DR) unique entity ID in Select Destination Property list and select it
Press Add
Press Next, Finish
For every map set that exists to the old LDM DR (working data set), insert a similar map set except using the new DR/WDS instead of old DR.
Most of the mappings and mapping custom properties should have been copied.
For now, we do not have a report to show the mappings that were not copied, this is a manual exercise to identify them (you could export all map sets and use Excel comparison features to compare a pair at a time).
7. When you have finished your logical mappings and are ready to start your physical data model, forward engineer your logical model into a PDM in ERwin, resulting in a single logical-physical model file. This should retain the same (ERwin) unique entity and attribute IDs for forward engineered tables/columns, although it would not hurt to verify a few tables at this point – see below for TMM reports to do this if you do not know how.
8. Make your physical-only model changes. Apply your physical side naming rules (nsm file, I think) Where you are rolling up or down super type-sub type entities, the super or sub type will go away and you should make note of all of these instances as TMM cannot auto-migrate mappings from those entities.
9. Use the ERwin TMM Reports to export the PDM with unique IDs (e.g. Global-Columns-8.2-v1.qry report). Note that the Global Columns and Global Tables reports have custom properties ColumnUniqueId and TableUniqueId, respectively. If you have a combined logical-physical Erwin file, then these ID values should match the AttributeUniqueIds and EntityUniqueIds that you exported for the logical model.
Import these files as a new DR: File > Import Content > type new DR Name in box, Select the “Relate this DR to another” option, Press Next > Select logical model DR from Existing DR Name drop-down list, Press Next > select import files, Press Next >
(Import Copy Function wizard step):
Click on one of the rows in Property Match Criteria box and press Delete to remove it (sometimes have to click on the second one to make selection work)
Repeat for the other row in Property Match Criteria
Find “AttributeUniqueId” or whatever you named the (LDM DR) unique attribute ID in Select Origin Property list and select it
Find “ColumnUniqueId” or whatever you named the (PDM DR) unique column ID in Select Destination Property list and select it
Press Add
Select Structure Properties option
Find “EntityUniqueId” or whatever you named the (LDM DR) unique entity ID in Select Origin Property list and select it
Find “TableUniqueId” or whatever you named the (PDM DR) unique table ID in Select Destination Property list and select it
Press Add
Press Next, Finish
For every map set that exists to the LDM DR/WDS, insert a similar map set except using the PDM DR/WDS instead of LDM DR.
You may want to export the map sets and compare them at this point.
Note that the import-replace operation still keeps the old DR and creates a new DR, but the new DR adopts the name of the old DR and the old DR name has a timestamp added to it. If you accept the default options for import-replace, you can also copy mappings using that operation.
-clark
Tips on using the DR Import-Relate-Copy feature to import a new version of a data model and copy mappings from the old version to the new version. This procedure can also be used to copy mappings from a logical model to a physical version of the same model, at least if you are using ERwin as a data modeling tool.
TMM installs pre-created ERwin report templates under “My Documents\Teradata Mapping Manager\ERwin TMM Reports” (different versions for ERwin 7 and ERwin 8). These Query Tool reports can be used to create TMM import files for your models. If you are not using ERwin, then you may have to create your own export reports...
1. Create the first pass of your logical data model, up to the point where you are ready to start creating TMM mappings for the model.
2. Use TMM-ERwin “query tool” report templates provided by TMM to export your logical model into TMM import files. Do not use the report builder 7.x reports as they cannot export attribute IDs. Use the examples that export entity and attribute IDs (e.g. Global-Attributes-8.2-v1.qry, creates data element custom property named AttributeUniqueId in the TMM import file, with the unique IDs populated in that property). There is an in-app help topic for using ERwin TMM Reports if you need help:
“Working with data representations > Creating data representations > Importing data representations > Using Erwin reports to create data representation import files”
3. Import the logical model as a data representation (DR), see in-app help topic if you do not remember how to do this from the TMM tutorial:
“Working with data representations > Creating data representations > Importing data representations ”
4. Start creating mappings in TMM to this DR.
5. Continue making changes, as needed, to the logical model in ERwin. If you need to make a copy of the model to create a change report later, or whatever, continue making changes in the original ERwin file. ERwin will change all the unique IDs in a copy of a model file, preventing you from using unique IDs to copy mappings in TMM.
If this is a problem for you, an option is to export the unique IDs and import them back into ERwin as User Defined Properties (UDPs), but that process is not described in this FAQ.
6. When you are ready to import a new logical model version into TMM, perform the following steps:
6a. If you made a lot of model changes, you may want to run a model change report now. I do not know how modelers do this, I have just seen the output. Of most interest are deleted entities and attributes that may have mappings in TMM. Also, entities or attributes that changed function such that mappings need to be reconsidered – you may want to force a change of unique ID for columns and/or tables where the latter happens – or just remember to check those mappings later.
6b. Use the import-relate operation to import the new model version and copy the mappings from the old version to the new version. The new DR will need a unique name, so you may want to include a version number in the DR names.
Here are the basic steps:
File > Import Content > type new DR Name in box, Select the “Relate this DR to another” option, Press Next > Select existing logical model DR from Existing DR Name drop-down list, Press Next > select import files, Press Next >
(Import Copy Function wizard step):
Click on one of the rows in Property Match Criteria box and press Delete to remove it (sometimes have to click on the second one to make selection work)
Repeat for the other row in Property Match Criteria
Find “AttributeUniqueId” or whatever you named the (old DR) unique attribute ID in Select Origin Property list and select it
Find “AttributeUniqueId” or whatever you named the (new DR) unique attribute ID in Select Destination Property list and select it
Press Add
Select Structure Properties option
Find “EntityUniqueId” or whatever you named the (old DR) unique entity ID in Select Origin Property list and select it
Find “EntityUniqueId” or whatever you named the (new DR) unique entity ID in Select Destination Property list and select it
Press Add
Press Next, Finish
For every map set that exists to the old LDM DR (working data set), insert a similar map set except using the new DR/WDS instead of old DR.
Most of the mappings and mapping custom properties should have been copied.
For now, we do not have a report to show the mappings that were not copied, this is a manual exercise to identify them (you could export all map sets and use Excel comparison features to compare a pair at a time).
7. When you have finished your logical mappings and are ready to start your physical data model, forward engineer your logical model into a PDM in ERwin, resulting in a single logical-physical model file. This should retain the same (ERwin) unique entity and attribute IDs for forward engineered tables/columns, although it would not hurt to verify a few tables at this point – see below for TMM reports to do this if you do not know how.
8. Make your physical-only model changes. Apply your physical side naming rules (nsm file, I think) Where you are rolling up or down super type-sub type entities, the super or sub type will go away and you should make note of all of these instances as TMM cannot auto-migrate mappings from those entities.
9. Use the ERwin TMM Reports to export the PDM with unique IDs (e.g. Global-Columns-8.2-v1.qry report). Note that the Global Columns and Global Tables reports have custom properties ColumnUniqueId and TableUniqueId, respectively. If you have a combined logical-physical Erwin file, then these ID values should match the AttributeUniqueIds and EntityUniqueIds that you exported for the logical model.
Import these files as a new DR: File > Import Content > type new DR Name in box, Select the “Relate this DR to another” option, Press Next > Select logical model DR from Existing DR Name drop-down list, Press Next > select import files, Press Next >
(Import Copy Function wizard step):
Click on one of the rows in Property Match Criteria box and press Delete to remove it (sometimes have to click on the second one to make selection work)
Repeat for the other row in Property Match Criteria
Find “AttributeUniqueId” or whatever you named the (LDM DR) unique attribute ID in Select Origin Property list and select it
Find “ColumnUniqueId” or whatever you named the (PDM DR) unique column ID in Select Destination Property list and select it
Press Add
Select Structure Properties option
Find “EntityUniqueId” or whatever you named the (LDM DR) unique entity ID in Select Origin Property list and select it
Find “TableUniqueId” or whatever you named the (PDM DR) unique table ID in Select Destination Property list and select it
Press Add
Press Next, Finish
For every map set that exists to the LDM DR/WDS, insert a similar map set except using the PDM DR/WDS instead of LDM DR.
You may want to export the map sets and compare them at this point.
Note that the import-replace operation still keeps the old DR and creates a new DR, but the new DR adopts the name of the old DR and the old DR name has a timestamp added to it. If you accept the default options for import-replace, you can also copy mappings using that operation.
-clark