Debugging Mappings

Debugging Mappings

Oracle Warehouse Builder, version 9.2 and higher, features a graphical mapping debugger that enables you to see the data flow through the mapping in a graphical interface. The mapping debugger is embedded in the Mapping Editor.

This lesson walks you through a debugging session for an existing mapping. In daily practice, you will use the debugger more often in order to debug a new mapping.

Topics

This lesson will discuss the following:

Overview
Prerequisites
Defining Test Data
Setting Break Points
Setting Watch Points
Stepping Through the Mapping With Test Data
Summary

This lesson will take approximately 60 minutes to complete.

Move your mouse over this icon to show all screenshots. You can also move your mouse over each individual icon to see only the screenshot associated with it.


Overview

This lesson will teach you how to debug the MAP_CUSTOMER mapping using the debugger provided in the Mapping Editor.

Back to Topic List

Back to Topic List

In order for this lesson to work successfully, you will need to have performed the following:

1.

Completed Overview lesson.

2.

Completed Logging in to OWB lesson.

3.

Completed Importing Source Metadata lesson.

4.

Completed Defining Target Module lesson.

5.

Completed Dimensional Design using Oracle Warehouse Builder lesson.

6 .

Completed Designing ETL Data Flow Mappinglesson.

7 .

Completed Deploying Targets lesson.

8 .

Completed Designing Process Flows lesson.

9 .

Completed Gaining Flexibility and Performance with External Tables lesson.

10 .

Completed Ensuring Data Quality lesson.

Defining Test Data

Back to Topic List

The definition of test data involves three steps: identifying source tables, creating a test target table, and generating and deploying the test package.

Identifying Test Data
Generating and Deploying the Test Package

Identifying Test Data

Back to SubTopic List

1.

This debugging session requires that you first deploy two target objects: CUSTOMER dimension and UNASSIGNED_CUSTOMERS table.

In the Runtime Repository Connections node, open OBE_RUNTIME_CONNECTION, using connect_user as the password.

Expand TARGET_LOC location and WH module. Expand Dimensions and select CUSTOMER. Expand Tables, hold down the Ctrl key and also select UNASSIGNED_CUSTOMERS. Click the Default Action key to change the deploy status to Create.

Move your mouse over this icon to see the image

Generate and deploy these two objects.

This debugging session also requires that you first deploy a source object: CUSTOMERS_VIEW_STG view table. In the TARGET_LOC location, expand the STG module, expand Views, and select CUSTOMERS_VIEW_STG. Click the Default Action key to change the deploy status to Create. Generate and deploy this object.

Close Deployment Manager.

 

2.

Expand OWB10g_DEMO, expand Databases, expand WH and double-click MAP_CUSTOMER to open the mapping editor. Maximize the window.

Move your mouse over this icon to see the image

 

3.

Click the Debug Start button in the toolbar. Specify connection details to the target schema.

Schema Name: target_schema
Password: target_schema
Hostname: localhost
Port Number: 1521
Service Name obeowb

Move your mouse over this icon to see the image

Click OK.

 

4.

The debugger will try to locate objects in the target schema based on the names of the operators. When you run the mapping in debug mode for the first time Warehouse Builder will not be able to identify links to all source tables.

Move your mouse over this icon to see the image

Click OK.

 

5.

The mapping editor reappears with debugging panels in the lower left and lower right corners. The Test Data tab in the lower left panel indicates that, for REGIONS and COUNTRIES, the source tables need to be found. For CUSTOMERS_VIEW_STG, a new debugging table needs to be created.

REGIONS is highlighted. Click Edit in the lower left panel.

Move your mouse over this icon to see the image

 

6.

A warning appears, indicating that no source object can be found for REGIONS.

Move your mouse over this icon to see the image

Click OK.

 

7.

The Define Test Data window appears. Click the Browse button.

Move your mouse over this icon to see the image

 

8.

The Choose Entity window appears. Select the HR schema. Warehouse Builder automatically selects the REGIONS table.

Move your mouse over this icon to see the image

Click OK.

 

9.

The Define Test Data window reappears, showing test data for the REGIONS table that you chose from the HR schema.

Move your mouse over this icon to see the image

Click OK.

 

10.

The mapping editor reappears. Notice that the Test Data tab now shows a checkmark next to REGIONS, indicating that data has been found for that test table.

In the Test Data tab, select the COUNTRIES table, click Edit, and perform the same steps that you performed for REGIONS in steps 6 through 9.

( As you did in step 8, select the HR schema, and Warehouse Builder will automatically select the COUNTRIES table.)

 

11.

When you finish finding data for the COUNTRIES test table, return to the Test Data tab, select CUSTOMERS_VIEW_STG, and click Edit to create a new debugging table for CUSTOMERS_VIEW_STG.

Move your mouse over this icon to see the image

 

12.

The Define Test Data window appears. Instead of browsing for test data as you just did for REGIONS and COUNTRIES, click the Create New Table button. This will create a copy of the real view table, allowing yout to modify the data for debugging purposes.

Move your mouse over this icon to see the image

The table will be named DBG_<operator name>, thereafter, suffixed with a sequence number if the object name would clash with an existing object

.

13.

To modify some of the test data, select the User Data Edit Mode check box in the upper left corner in the Test Data window. A warning appears about manipulating data.

Move your mouse over this icon to see the image

Click OK.

 

14. The Define Test Data window reappears. Change some of the CUST_FIRST_NAME values. Click Commit. Click OK. An OWB Note appears, Commit data edits, Click Yes

Generating and Deploying the Test Package

Back to SubTopic List

1.

The mapping editor reappears. Generate the debug package by clicking the Reinitalize button in the toolbar.

Move your mouse over this icon to see the image

 

2.

An OWB Note pops up, confirming that the definitions are the ones that you want to use.

Move your mouse over this icon to see the image

Click OK.

 

3.

Correlated commit is a feature that was added to the OWB 9.2 release. The feature helps you to manage a multi-target situation in which commits would happen based on row selects; not based on a target-by-target selection.

The debugger takes this setting into account and warns that all targets will have to be processed at the same time.

Move your mouse over this icon to see the image

Click OK.

 

4.

The mapping editor reappears. The Messages tab in the lower left panel indicates successful debug initialization.

Move your mouse over this icon to see the image

 

Back to SubTopic List

Setting Break Points

Back to Topic List

Once the generation and deployment of the debug package has finished, you can start running the debug session.

1.

Before running the session, select the CUSTOMER target dimension on the right side of the mapping and click the Set Breakpoint button.

Move your mouse over this icon to see the image

 

2.

Notice that the Breakpoints tab appears in the panel in the lower left corner of the mapping editor.

Breakpoints can be set during the mapping debug run and can be activated and de-activated as the mapping runs.

 

Setting Watch Points

Back to Topic List

In addition to break points, you can set watch points to examine test data flowing into and out of selected mapping objects.

1.

With the CUSTOMER dimension still selected on the right side of the mapping, click the Set Watch Point button.

Move your mouse over this icon to see the image

 

2.

Setting watch points enables you to view the data flowing into this target dimension.

 

Stepping Through the Mapping with Test Data

Back to Topic List

Now that you have set a watch point, you can step through the mapping and watch data flow into the selected object.

1.

Click the Step button several times to retrieve rows for the debug run.

Move your mouse over this icon to see the image

Observe the rows of data in the Step Data tab in the panel in the bottom right of the mapping editor.

 

2.

Click the Skip button to run all remaining rows for the operator.

.Move your mouse over this icon to see the image

Click Step again.

 

3.

The Map Path Choice dialog pops up. It allows you to choose the next group (path) in the mapping whose data you wish to step through. Select EXPR.OUTGRP1 and click OK.

Move your mouse over this icon to see the image

 

4.

Click Step and see the rows appearing in the OUTGRP1 panel.

Move your mouse over this icon to see the image

 

5.

Click the Resume button to resume execution, either until a breakpoint is hit or until the mapping finishes.

Move your mouse over this icon to see the image

In this case, a breakpoint was hit at the CUSTOMER dimension. The Messages tab on the bottom left panel indicates this.

 

6.

Click Step a few times and notice that the records get the INSERT action; some records might get the UPDATE action, depending on what you did in previous lessons.

Move your mouse over this icon to see the image

 

7.

Run to the end of the mapping path by clicking the Resume button.

 

8.

Click the Step button again. An OWB Note pops up, indicating that the map execution is done.

Move your mouse over this icon to see the image

Remember that Warehouse Builder warned about the Correlated commit set to true. If Correlated commit had been set to false, you would have been able to debug another path. However, you can still look at what happened in the other path. Click OK.

 

9.

Select the FLTR operator and click Set Watch Point.

Move your mouse over this icon to see the image

Notice that the filter is allowing only those records with an empty ACCOUNT_MGR_ID to pass.

 

10.

Quit the debug session by clicking the Debug End button . Close the mapping editor .

 

Summary

Back to Topic List

Oracle Warehouse Builder provides a powerful graphical debugger. By running mappings in debug mode the user can get insight into the behavior at runtime and potential problems can be pro-actively resolved. Building and verifying a mapping is now easier than ever!

In this module you should have learned how to:

Define test data for sources and targets.
Set break points and watch points.
Step through a mapping with test data.

Move your mouse over this icon to hide all screenshots

 

 

 

E-mail this page
Printer View Printer View
Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy