Sei sulla pagina 1di 14

BANGALORE TECHNICAL TRAININGS Onlinetrainingsbglr@gmail.

com +917411642061

Lab 5
Using the Debugger

Lab at a Glance................................................................2 Objectives..............................................................2 The Problem...........................................................2 Duration.................................................................3 Exercises..........................................................................4 Exercise 1: Prepare Debugger...............................4 Exercise 2: Run the Debugger...............................7

PowerCenter 9.x Level I Developer Lab Guide

5-1

Lab 5. Using the Debugger

Lab at a Glance
The exercises in this lab are designed to familiarize the student with the process of using the PowerCenter Debugger. In this lab, the student will troubleshoot a mapping that is not producing the correct data results.

Objectives
After completing the lab, the student will be able to: Use the PowerCenter Debugger. Start and stop the Debugger. Set breakpoints in the Debugger.

The Problem
A mapping created by another developer produces the following target table, with some TYPE_CODE values NULL.

5- 2

PowerCenter 9.x Level I Developer Lab Guide

Lab 5. Using the Debugger

Duration
This lab should take approximately 30 minutes.

PowerCenter 9.x Level I Developer Lab Guide

5-3

Lab 5. Using the Debugger

Exercises
Exercise 1: Prepare Debugger
This exercise sets up the Mapping Designer in preparation for debugging. Some of the steps may not be necessary if the Designer has remained open since the previous labs. Step 1. Open the Designer. Select Start | Programs | Informatica Platform 9.0 | Informatica PowerCenter Client 9.0 | Designer . Connect to the PC_Course repository. Step 2. Close the mapping. Open the Mapping Designer by clicking the button in the toolbar:

Close the mapping by selecting Mappings | Close or by clicking the Close Mapping toolbar (if visible). button in the Mappings

Step 3. Copy the mapping to be debugged. Ensure the Designer is in workbook mode by selecting View | Workbook. When in workbook mode, the bottom of the Workspace will display tabs for all of the open folders.
Simply selecting or expanding your folder does not actually open it. There are several ways to open it: - Double-click on it. - Right-click it and select Open from the popup menu. - Left-click it and click control-O. - Left-click it and select the folder-open icon in the toolbar.

Open the Studentxx folder. Locate the Shared_Student folder in the Navigator window and expand it by clicking on the + sign to the left of the folder name. Continue to drill down to the Mappings node and select the m_ODS_EMPLOYEE_BAD mapping:

5- 4

PowerCenter 9.x Level I Developer Lab Guide

Lab 5. Using the Debugger

When a mapping is copied, any associated targets and sources are also copied to the destination folder.

Select Edit | Copy, or Ctrl-C to copy the mapping. Paste the mapping by selecting the Studentxx folder and selecting Edit | Paste, or Ctrl-V.

Click Yes. If there is a conflict with any existing objects, the Copy Wizard opens. Select Replace. Collapse the Shared_Student folder by clicking on the - to the left of the folder name in the Navigator window. Save the repository.

PowerCenter 9.x Level I Developer Lab Guide

5-5

Lab 5. Using the Debugger

Step 4. Open the mapping. In the Navigator window, locate the m_ODS_EMPLOYEE_BAD mapping (just copied) in the Mappings node of the Studentxx folder. Click and hold the mouse button, then drag-and-drop the mapping into the Workspace:

Step 5. Edit the mapping. Select Mappings | Edit. The Edit Mapping dialog box appears.

Change the mapping name to m_ODS_EMPLOYEE_BAD_xx (where xx represents the assigned student number). Save the repository. Step 6. Arrange the mapping. Right-click in the Workspace and select Arrange All. The mapping is arranged neatly in normal view. Right-click in the Workspace and select Arrange All Iconic. The mapping is now displayed in iconic view.

5- 6

PowerCenter 9.x Level I Developer Lab Guide

Lab 5. Using the Debugger

Exercise 2: Run the Debugger


Step 1. Activate the Debugger toolbar. Select Tools | Customize and check the Debugger checkbox on the Toolbars tab:

The Debugger toolbar is added to the available toolbars:

Select Tools | Options. Select the Debug tab. Under Data Display, if Value is not in Selected, move it there.

Step 2. Start the Debugger. Click on the Start Debugger


| Debugger | Start Debugger

button, or select Mappings or click F9.

The Debug Mapping window appears.

PowerCenter 9.x Level I Developer Lab Guide

5-7

Lab 5. Using the Debugger

Click on the Next button. The next Debug Mapping wizard page appears.

Since no session has been created to represent this new mapping, the Debug Mapping Wizard has the ability to create one on the fly. This is especially useful for a developer to test complex expressions and logic before trying to create a workflow with a session task.

Leave PC_Server as the Server to use for the debug session. In the Session field, leave the default radio button (Create a debug session instance for this mapping ) selected. Click on the Next button.

5- 8

PowerCenter 9.x Level I Developer Lab Guide

Lab 5. Using the Debugger

Select the same native connections, for source and target, used to run the workflow in the previous lab. Select the Properties tab and select Normal for the Target load type property:

Click on the Next button twice.

Leave the default settings on this page of the wizard and click on the Next> button.

PowerCenter 9.x Level I Developer Lab Guide

5-9

Lab 5. Using the Debugger

On the last page of the wizard (not shown), leave the Discard target data checkbox selected. Click on the Finish button and wait for the spinning (initializing) of the Debugger icon to stop before proceeding. Assuming that the Informatica service is started, a debug session will start.

Click on the Debugger Log tab to watch the real-time log creation.

The Debugger toolbar becomes active in debug mode:

5- 10

PowerCenter 9.x Level I Developer Lab Guide

Lab 5. Using the Debugger

Step 3. Debug the mapping. Select the sq_EMPLOYEE source qualifier in the mapping. Click on the Next Instance rows through the Debugger. button to start moving

The small green arrow displays a flashing yellow indicator as long as rows are being read. Continue click on the Next Instance button and notice the processing progress (indicated by yellow arrow) as each row moves from the sq_EMPLOYEE to the exp_EMPLOYEE. Examine the data in the Instance window and notice the pull-down list can be used to see a row in either of the two transformations in the mapping. Click the Step to Instance button and watch each row move through one transformation. Compare the data from one transformation to the next and determine where the mapping errors are.

PowerCenter 9.x Level I Developer Lab Guide

5 - 11

Lab 5. Using the Debugger

Step 4. Stop the Debugger. Once the errors in the data mapping have been discovered, stop the Debugger by clicking on the Stop the
Debugger

button.

The Designer will ask for confirmation:

Click on Yes. The Debugger Server will shut down and return to the normal Mapping Designer Workspace. Step 5. Set Debugger breakpoints. Restart the Debugger. Click on the Edit Breakpoint button.

The Edit Breakpoints dialog box appears.

Select sq_EMPLOYEE from the Instance Name pull-down list. Click on the Add button in the Breakpoints: section of the dialog box. Click on the Add a new column to this table
5- 12

button in

PowerCenter 9.x Level I Developer Lab Guide

Lab 5. Using the Debugger

the Condition section the dialog box. Select <<ANY-PORT>> from the Port pull-down list. Select ISNULL from the Operator pull-down list.

Click OK to save the breakpoint.


Best practice is to restart the Debugger, since Continue will miss breakpoints on rows that have already been processed.

Click the Continue

button on the Debugger toolbar.

The Debugger will run through all the rows until the first occurrence of a NULL. Note that two rows pass to the target, then the Debugger pauses. Check the Instance window and note the presence of a NULL in the TYPE_CODE column.

Click the Continue


Note that the defined breakpoint is still present. Breakpoints remain associated with a mapping until they are deleted. A breakpoint can be edited as long as the Debugger is not running.

button.

Ten rows enter the target and the Debugger pauses when it encounters a row where the TYPE_CODE column is NULL. Click the Continue button.

PowerCenter 9.x Level I Developer Lab Guide

5 - 13

Lab 5. Using the Debugger

A NULL is not found in any other rows. All rows continue to the target. Click the Continue The Debugger stops. Add additional breakpoints and experiment. To shut down the Debugger, click the Stop the Debugger button. button.

5- 14

PowerCenter 9.x Level I Developer Lab Guide

Potrebbero piacerti anche