TMM - Replace Data Representation

Tools & Utilities
Enthusiast

TMM - Replace Data Representation

Imported a Logical Model Data Representation previously and performed some mappings from the Source Tables to the LDM.  I made some updates to the LDM and trying to re-import it in so that it is replaces the original LDM DR with the new information. 

I tried Import->Replace Contents to existing DR and Import-> New Data Representation->Relate this new DR to an existing DR, but they both seem to create a new DR and does not replace the existing version, and the mappings I created based on the original DR is not copied over to the new DR.

Has anyone been able to get the Import wizard to replace an existing DR with a new version?  Thanks

15 REPLIES
Enthusiast

Re: TMM - Replace Data Representation

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

Enthusiast

Re: TMM - Replace Data Representation

Thank you for the response.  I am working through your suggestion above.  I am still running into issues copying the mapping from one working data set to another, but I have a few more things to try.

One thing I am curious about, on the Import wizard there are options to append/replace contents of existing Data Representation.  This always seems to create a new Data representation and the information replaced/appended is not reflected in the working data set.  Is this expected? 

Enthusiast

Re: TMM - Replace Data Representation

Import-append does not create a new data representation (DR), but rather just adds new data structures/elements to the existing DR or adds custom property values if the values are in the import file AND the existing DR has NO value for a given instance of custom property.

Import-replace does create a new DR.

The import-replace function has changed functionality over time. It used to actually replace the current DR, probably as you would expect it to do,  but some users found that they wanted to revert to the old DR and it no longer existed. The new definition of this function is a bit confusing so I recommend that you use import-relate instead (select Import New DR option and check the Relate this DR to an Existing DR box). They both perform essentially the same operation except that import-replace renames the existing DR. In either case, the new map set windows are not automatically configured. You must Insert > Map Set for each map set that existed to the old DR, except that you use the new DR instead of the old DR in the map set definitions.

Enthusiast

Re: TMM - Replace Data Representation

OK that makes sense.

Have an additional question for the Copy Function mapping, in the Source LDM Element List template it uses Entity Name/Attribute Name column names, but when I do the Import-Relate, the copy function mapping only allows me to select Data Structure/Data Element in my Match criteria.

I am wondering if this is why my mappings are not copied over?

Enthusiast

Re: TMM - Replace Data Representation

The default names for structure and element names are Data Structure Name and Data Element Name. If your Data Element import file has Entity Name and Attribute Name, then that is OK (if the appropriate preference is selected to allow import of user-defined column names) and those names will be used in data set windows as column header names and a few other places in the user interface - but the import wizard - copy function dialog will still use Data Structure Name and Data Element Name in the element and structure property name lists. I just tried an import-relate-copy operation using a data element import file with Entity Name and Attribute Name column headers in the import file and mappings were copied properly. You are required to Insert > Map Set (one or more times) using the new DR name and other DR names to which the old DR was mapped.

Enthusiast

Re: TMM - Replace Data Representation

I think it's starting to clear up.  When you do an import-relate the mappings are copied over, BUT the # of mappings does not display on the Working Data Set until you insert a new map set with the new DR referenced.  Is that correct?

If so, that may be where my confusion has been, after the import-relate the # of mappings is displaying 0; therefore, I thought the mappings were not copied over.

Enthusiast

Re: TMM - Replace Data Representation

That is correct. A WDS only shows mapping counts for mappings in map sets that are in the bottom list on the WDS Properties > Map Sets tab. Map sets are automatically placed on this list when you insert a map set for a given WDS, but no map sets exist for any new import-relate DRs until you manually insert them.

Re: TMM - Replace Data Representation

I am just unable to define the WDS favorably..It displays an error called "undefined database"...What does it mean?




http://www.googleappsdirectory.com
Enthusiast

Re: TMM - Replace Data Representation

The WDS is defined automatically when you successfully import a new or replacement data representation. What steps were you performing when you got the undefined database error?

The only situation that I can think of that would return that error is when you provide a correct IP address for a Teradata server when connecting to a TMM repository but the database name that you provide does not exist.

You included a hyperlink with your post but it did not have any information about your problem...