Anda di halaman 1dari 13

BANGALORE TECHNICAL TRAININGS Onlinetrainingsbglr@gmail.

com +917411642061

Lab 12
Features and Techniques II

Lab at a Glance................................................................2 Objectives..............................................................2 Duration.................................................................2 Exercises..........................................................................3 Exercise 1: Shortcuts ............................................3 Exercise 2: The Find Feature ................................4 Exercise 3: View Dependencies.............................6 Exercise 4: Comparing Objects .............................7 Exercise 5: Overview Window .............................10 Exercise 6: Copying and Pasting Objects ............11 Reference.......................................................................11 Shortcuts..............................................................11 Comparing Objects..............................................12 Copying & Pasting Objects...................................13

PowerCenter 9.x Level I Developer Lab Guide

12 - 1

Lab 12. Features and Techniques II

Lab at a Glance
Objectives
After completing the lab, the student will be able to: Use shortcuts. Find objects (use various search options). View object dependencies. Compare objects and mappings. Use the Overview window. Copy objects across mappings.

Duration
This lab should take approximately 40 minutes.

12 - 2

PowerCenter 9.x Level I Developer Lab Guide

Lab 12. Features and Techniques II

Exercises
Exercise 1: Shortcuts
Step 1. Create a shortcut to source. Expand the Shared_Student folder:

Ensure the mapping from the previous lab is open in the workplace and click-and-drag the EMPLOYEE source definition into the mapping. As the cursor enters the workspace, the icon should look as follows:

If it does not, start over and make sure the object is being dragged in from the Shared_Student folder. On releasing the mouse button, the following dialog box appears:

To copy an object from a shared folder (rather than creating a shortcut), hold down the CTRL key before dropping the object.

Click on Yes to create the shortcut make sure it doesnt say Copy. The curved arrow in the upper-left corner of the source definition shows that the source is a shortcut:

PowerCenter 9.x Level I Developer Lab Guide

12 - 3

Lab 12. Features and Techniques II

Step 2. Do not save changes. Disconnect from the Studentxx folder and do not save the changes from the previous lesson.

Exercise 2: The Find Feature


The Designer includes the Find Next and Find in Workspace features to help find columns or ports in repository objects, or strings in the output window. This can be very helpful in any number of scenarios including: Tracing the impact of change through a mapping. Debugging an invalid port. Recognizing a miscalculated port value. Detecting a mapping logic flow error. 1. Use the Find in Workspace feature.
The Find in Workspace feature searches all of the transformations in the workspace for port or transformation names. It can search for column, port or table names that match the search string. The search can span across all names in the workspace, or across the business name of a table, column or port. The search can be case sensitive and match on a whole word. By default, it is not case sensitive. However there are additional checkboxes to select, which will force it to be.

Open the studentxx folder. Open the m_ODS_EMPLOYEE_xx mapping. Click the Find in Workspace
Find in Workspace.

button or choose Edit |

In the Find What field, enter type_code and click on the Find Now button.

12 - 4

PowerCenter 9.x Level I Developer Lab Guide

Lab 12. Features and Techniques II

The choices are to search for field names or table names matching the search text. If Fields is selected, the Designer searches for column or port names matching the search text. If Tables is selected, the Designer searches for table names matching the search text. The Designer saves the last 10 search strings used, in the drop -down list from both the Find in workspace and Find Next (discussed in the next step).

Double-click on the exp_ODS_EMPLOYEE result.


In the Iconic view, Find in Workspace does the same thing. However, the transformation object would have to be opened to the Normal view to see the port.

Notice that the workspace is re-positioned so that exp_ODS_EMPLOYEE is in the top left corner. Click Close. Step 2. Use the Find Next feature.
The Find Next features searches for a column or port name (or any set of characters in a name) in the following objects: transformations, mapplets, and source and target definitions. Unlike Find in Workspace, the Find Next feature searches one object at a time. It cannot search multiple objects at the same time. The Find Next feature works in each Designer tool. In addition, this is the only way to do a full text search in any of the tabs in the Output

Select the Source Qualifier transformation. Enter EMPLOY in the Find box on the Standard toolbar.

(The search is not case-sensitive.) Select Edit | Find Next or click the Find Next Function key F3, to search for the string button or

The Designer finds the first occurrence of the search


12 - 5

PowerCenter 9.x Level I Developer Lab Guide

Lab 12. Features and Techniques II

window (e.g., Save, Validate, Debugger, etc.). This feature is extremely useful when debugging. Select a single transformation or click in the Output window before performing the search otherwise, the Find Box will remain grayed out.

string.

Press Enter again to search for the next occurrence of the search string.

Exercise 3: View Dependencies


Step 1. Use the View Dependencies feature.
The View Dependencies feature is a quick and powerful way to do a dependency analysis on virtually any object in the repository. This is especially powerful because it can be executed from the Designer tool. A simple example is when a source needs to be changed. View Dependencies will show all of the mappings associated with the source. In turn, View Dependencies on those mappings impacted by the source change identifies the session tasks associated with the mappings.

In the Navigator window, expand the Targets node in the assigned Student_xx folder.

The folder must be open (active) in the workspace for this feature to work.

Right-click on the ODS_CUSTOMER_ACTIVE target definition and select Dependencies

12 - 6

PowerCenter 9.x Level I Developer Lab Guide

Lab 12. Features and Techniques II

Accept the default settings and click OK. Note its dependencies including the m_ODS_CUSTOMER_ACTIVE mapping.

Right-click the m_ODS_CUSTOMER_ACTIVE mapping and select View Dependencies. Note its dependencies including the INVOICE source definition.

Exercise 4: Comparing Objects


Step 1. Compare instances within mappings or mapplets. In Mapping Designer, open the mapping
m_ODS_ORDER_AMOUNT_xx.

Right-click on the header of jnr_ODS_ORDER_AMOUNT and select Compare Objects

Select srt_ODS_ORDER_AMOUNT as Instance 2 and click on the Compare button.


All differences will appear in red. On the

Click through the different tabs to see any differences,

PowerCenter 9.x Level I Developer Lab Guide

12 - 7

Lab 12. Features and Techniques II

Ports tab, note the port names that are

highlighted have identical names and are shown in the same row. Note also that the ORDER_DATE port has a different data type and precision and is further highlighted in red.

shown in red text.

Step 2. Compare target definitions.


ODS_EMPLOYEE_ROOKIE and DIM_REP will be used in the later labs.

However, they are good examples to demonstrate the feature.

Import ODS_EMPLOYEE_ROOKIE and the DIM_REP tables from the target database. These additions should not be saved after this lesson. Expand the Targets node in the Navigator window and pull ODS_EMPLOYEE into the Warehouse Designer workspace.

There is one key difference between this use of the Compare feature, and the last. The dialog box for initiating the compare now has a Browse button that will allow searching through all open folders for objects of the same type.

Right-click on ODS_EMPLOYEE, select Compare Objects and a different dialog box will appear. Click on the Browse button to the right of the Target 2: window.

Again, all differences would appear in red. In this case, the difference is the table name.

Drill down through the assigned student folder to the Targets node to select ODS_EMPLOYEE_ROOKIE. Click OK. Click on the Compare button and view the Columns tab.

12 - 8

PowerCenter 9.x Level I Developer Lab Guide

Lab 12. Features and Techniques II

Close and try the same steps with the DIM_REP table. Compare ODS_EMPLOYEE to DIM_REP.
Columns that do not match by name appear on different lines. There is nothing in red to indicate any differences. Only when the column names are the same will differences appear in red.

Click on the Compare button and view the Columns tab.

Step 3. Compare mapping instances. Disconnect from the Studentxx folder and do not save the changes from the previous lesson. Open the Studentxx folder. Open the Shared_Student folder. In the Studentxx folder, open the m_ODS_ORDER_AMOUNT_xx mapping. Select Mappings | Compare from the main menu. Click on the Browse button for Mapping 2 and select the m_ODS_ORDER_AMOUNT_xx mapping in the Shared_Student folder.
PowerCenter 9.x Level I Developer Lab Guide 12 - 9

Lab 12. Features and Techniques II

Click on Compare button. Again, any differences will be highlighted in red. Key differences will be listed on the Summary tab, such as in this case:

Instance srt_ODS_ORDER_AMOUNT is present only in mapping in your folder. Click on the Instances tab and in the Transformations Instances, and select the agg_ODS_ORDER_AMOUNT instance. Click on the Compare Instances button. Click through the tabs to find the differences. The only difference should be on the Properties tab the Sorted Input flag was set to True for the mapping in your folder. Close the Shared_Student folder.

Exercise 5: Overview Window


This feature assists with maneuvering around mappings with many transformation instances. Step 1. Using the Overview Window. Arrange the open m_ODS_ORDER_AMOUNT_xx mapping to the Normal view using Layout | Arrange All.
Select View | Overview Window: or select the button.

12 - 10

PowerCenter 9.x Level I Developer Lab Guide

Lab 12. Features and Techniques II

Drag the box around to re-position the mapping in the workspace. Draw a box around a couple of transformations in the workspace. Observe that the selected objects are highlighted in red in the Overview window. The Overview window remains on top of any client application (not just the Designer) until closed.

Exercise 6: Copying and Pasting Objects


Step 1. Copy and paste objects. Open the m_ODS_ORDER_AMOUNT_xx mapping. Arrange the mapping to the Iconic view. Draw a box around the Expression, Sorter and Aggregator. Observe that their outline changes to show they are selected. Press Ctrl-C to copy. Create a new mapping via Mappings | Create and select the default name. Click in the workspace and press Ctrl-V to paste. Disconnect from the Studentxx folder without saving changes.

Reference
Shortcuts One of the primary advantages of using a shortcut is maintenance savings. If a change is needed to all instances of an object, make the change to the original repository object and all shortcuts to it will automatically inherit those changes. In contrast, if there are multiple copies of an object, each will need to be updated. Note that changes can also invalidate mappings and sessions. The key is to use the dependency analysis features to determine the impact of the change and plan accordingly. If the change is needed immediately, temporarily make a copy of the object until the shortcut can be updated.

PowerCenter 9.x Level I Developer Lab Guide

12 - 11

Lab 12. Features and Techniques II

Shortcuts have the following advantages over copied repository objects: Allow the developer to maintain a common repository object in a single location. Objects inherit all changes. Provide developers to a set of predefined metadata by incorporating the shortcuts into their work instead of developing repository objects independently. Share complex mappings, mapplets or reusable transformations across folders and repositories (if the repository housing the shared folder is a global repository). Saves space in the repository by maintaining a single repository object and using shortcuts to that object, instead of creating copies of the object in multiple folders or multiple repositories. As with copying objects, the destination folder must be open to the appropriate tool. Shortcuts cannot be created to objects from non-shared folders. Comparing Objects The Designer allows detailed comparison of two repository objects of the same type. This includes sources, targets, transformations instances, mapplets, mappings and mapping/mapplet dependencies. The comparison can be based on two objects within the same mapping, two objects across open folders or across repositories (e.g. - Development, Test, and Production). Use the following tools to compare sources, targets, or transformations: - Compare two sources, two source shortcuts or a source with a source shortcut
Source Analyzer

- Compare two targets, two target shortcuts or a target with a target shortcut.
Warehouse Designer

- Compare two reusable transformations, two reusable transformation shortcuts, or a reusable transformation with a reusable transformation shortcut.
Transformation Developer

12 - 12

PowerCenter 9.x Level I Developer Lab Guide

Lab 12. Features and Techniques II

- Compare two source instances, two transformation instances, two target instances or two mapplet instances. Instances of different types cannot be compared (e.g. - source instance with a transformation instance).
Mapping / Mapplet Designer

Copying & Pasting Objects The developer can copy and paste objects from mappings and mapplets within the same folder. One of the primary advantages is the ability to select more than one object at a time and paste the objects into a mapping, mapplet or both. Keep the following concepts in mind when copying and pasting objects within a folder. Objects can be copied from any mapping or mapplet in a folder to any new or existing mapping or mapplet in the same folder. Multiple objects can be copied from the workspace. Selected objects can be viewed by choosing View | Overview. Selected objects will appear in color. Objects cannot be copied from a shortcut to a mapping or mapplet. Nor is it allowed to paste objects into a shortcut to a mapping or mapplet.

PowerCenter 9.x Level I Developer Lab Guide

12 - 13

Anda mungkin juga menyukai