4 Copyright © 2009, Oracle. All rights reserved. Designing Mappings with the Oracle Data...

Post on 27-Dec-2015

215 views 2 download

Transcript of 4 Copyright © 2009, Oracle. All rights reserved. Designing Mappings with the Oracle Data...

4Copyright © 2009, Oracle. All rights reserved.

Designing Mappings with the Oracle Data Integration Enterprise Edition License

Copyright © 2009, Oracle. All rights reserved.4 - 2

Objectives

After completing this lesson, you should be able to:

• Explain how to define new code templates for heterogeneous connectivity to non-Oracle sources

• Work with execution units– Use the execution view and logical view of the mapping

• Deploy CT mappings– Manage the privileges required of Java 2, Enterprise Edition

users and agents for placing agents in sources

Copyright © 2009, Oracle. All rights reserved.4 - 3

Lesson Agenda

• Comparing traditional OWB mappings with CT mappings

• Using code templates in mappings

• Combining traditional OWB mapping functionality with CT functionality

• Deploying CT mappings– Privileges for J2EE users and agents– Starting the default agent– Setting up credentials for the default agent– Mapping modules and agent locations

Copyright © 2009, Oracle. All rights reserved.4 - 4

Traditional Versus CT Mappings

• When creating new mappings, you first need to consider whether you will be using code templates.

• This determines under which node to create the mapping.

Code template mappings

Traditional mappings

Copyright © 2009, Oracle. All rights reserved.4 - 5

Integrate CTs into an OWB Mapping Framework

OWB

OWB UIOWBRepository

Maps

CTs

AddOWBxforms

Deploymap toJ2EE

Startmap

ApplyCT tomap

Deploymap toJ2EE

StartmapImport

some CTs

Codetemplates

Copyright © 2009, Oracle. All rights reserved.4 - 6

Additional Tasks for Using CTs in Mappings

1. Create project.

2. Define a platform.

3. Import code templates (CTs) that you will be using.

4. Construct mapping.

4.a. Create execution units, assign code template to each execution unit.

5. Validate mapping.

6. Generate mapping.

7. Deploy mapping.

8. Execute mapping.

Use code templates for direct, native access to non-Oracle systems.

Minimum set of metadata necessary toconnect to a source or target system

Copyright © 2009, Oracle. All rights reserved.4 - 7

Lesson Agenda

• Comparing traditional OWB mappings with CT mappings

• Using code templates in mappings

• Combining traditional OWB mapping functionality with CT functionality

• Deploying CT mappings– Privileges for J2EE users and agents– Starting the default agent– Setting up credentials for the default agent– Mapping modules and agent locations

Copyright © 2009, Oracle. All rights reserved.4 - 8

Execution Units in a CT Mapping

Unit

Unit

UnitOracle target

execution unit

SQL Serversource

execution unit

DB2 sourceexecution unit

Code template

Code Template

Copyright © 2009, Oracle. All rights reserved.4 - 9

Execution View Versus Logical ViewCode template mapping

Execution

UnitExecution

Unit

Execution

UnitSource

execution

unit

Target

execution

unit

Execution view (physical design)Alternate

Codetemplate

Oracle target

Codetemplate

SQL to Oracle

Defaultconfiguration

(active)- SQL to Oracle- Oracle target- Parallel- . . . .

CodetemplateSQL to SQL

CodetemplateData Pump

Logical view

Assign each execution unit a code template.

The active configuration brings into play its execution view.

Copyright © 2009, Oracle. All rights reserved.4 - 10

Default Configuration and Its Execution View

Execution unit Assigned code template

Stage Customers LCT_SQL_TO_ORACLE

Stage Details LCT_SQL_TO_SQL

Merge DEFAULT_ORACLE_TARGET_CT

Default configuration

Execution unit

Execution unit

Execution unit

LCT_SQL_TO_ORACLE

LCT_SQL_TO_SQL

DEFAULT_ORACLE_TARGET_CT

Copyright © 2009, Oracle. All rights reserved.4 - 11

Alternate Configuration and Its Execution View

Execution unit Assigned code template

Stage Customers LCT_ORACLE_TO_ORACLE_DBLINK

Stage Details LCT_SQL_TO_SQL

Merge DEFAULT_ORACLE_TARGET_CT

Alternate configuration

Execution unitExecution unit

Execution unitLCT_ORACLE_TO_ORACLE_DBLINK

LCT_SQL_TO_SQL

DEFAULT_ORACLE_TARGET_CT

Copyright © 2009, Oracle. All rights reserved.4 - 12

Customers

GIS Details

Cust Info

Staging Target

LoadIntegrate

Mechanics of Template-Based Mappings

LCT_SQL_TO_ORACLE

LCT_SQL_TO_SQL

DEFAULT_ORACLE_TARGET_CT

Copyright © 2009, Oracle. All rights reserved.4 - 13

New Properties in the Location Dialog Box Support Code Template Mappings

OWB 11g Release 2 offers many location properties, logically grouped among six tabs:• Details• Registration• Advanced• Prefix• Mask• Connection Pool

Copyright © 2009, Oracle. All rights reserved.4 - 14

Customers

GIS Details

Cust Info

Staging Target

Location Information for CT-Based Mappings

Copyright © 2009, Oracle. All rights reserved.4 - 15

Staging Table Prefixes

Copyright © 2009, Oracle. All rights reserved.4 - 16

Create a List of Favorite Operators

Operators used in execution units that have code templates assigned for loading or integration

Copyright © 2009, Oracle. All rights reserved.4 - 17

Quiz

Which of the following statements are true?

a. Each configuration can have its own unique execution view.

b. An execution unit can be assigned multiple, concurrent code templates.

c. Each execution unit is assigned a single code template.

Copyright © 2009, Oracle. All rights reserved.4 - 18

Lesson Agenda

• Comparing traditional OWB mappings with CT mappings

• Using code templates in mappings

• Combining traditional OWB mapping functionality with CT functionality

• Deploying CT mappings– Privileges for J2EE users and agents– Starting the default agent– Setting up credentials for the default agent– Mapping modules and agent locations

Copyright © 2009, Oracle. All rights reserved.4 - 19

Convert a Classic Mapping to a CT Mapping That Utilizes Data Pump

Classic set-based SQL mapping

Logical view:Move Oracle table between two Oracleinstances

Generationresults:INSERTstatement

Copyright © 2009, Oracle. All rights reserved.4 - 20

Copy and Paste a Classic Mapping to a Template Mapping Node

From the classic mapping node…… to the template mapping node

Copyright © 2009, Oracle. All rights reserved.4 - 21

Execution View of a Code Template Version of the Mapping

We can replacethis defaultOracle target CTwith one that usesData Pump.

Copyright © 2009, Oracle. All rights reserved.4 - 22

Assign the USE_DATA_PUMP Code Template

Execution unit with Data Pump template assigned

Copyright © 2009, Oracle. All rights reserved.4 - 23

Lesson Agenda

• Comparing traditional OWB mappings with CT mappings

• Using code templates in mappings

• Combining traditional OWB mapping functionality with CT functionality

• Deploying CT mappings– Privileges for J2EE users and agents– Starting the default agent– Setting up credentials for the default agent– Mapping modules and agent locations

Copyright © 2009, Oracle. All rights reserved.4 - 24

Reminder of CT-Based Mapping Architecture

Warehouse Builder

Data typemapping design

Code templates

in mapping

Platform properties

Connectivity(JDBC, ODBC,

and Native)

Metadata infrastructure

1. 2. 3. 4.

Code template–based mapping = Mapping design + code templates + platform definition

Copyright © 2009, Oracle. All rights reserved.4 - 25

OWB

Browser

Browser

Server

Local OC4J

Design

Design

Reports

Audit

Reports

Client

Design

Client Oracle DB

OWB Control

Center Service

Repository

OWB Code

Workspace1

Audit

Tables

Control Center Agent

Local OC4J

C$ = prefix for load table for staging

DS = data source credentials (location details)

ExU = execution unit

Source Tables

DB2

SQL Server

Source Tables

Data Schema

TGT1

TGT2

ExU3

DeployDeploy

Map1DS1

DS2

DS3

ExU 1 ExU2

ExecuteExecute

Stage

Remote SQL

C$EXU1

C$EXU2

ExU3

Execute

Loads data from staging to target

Integrate CT

Load CT

OWB Topology with CCA on Oracle Target Server

Copyright © 2009, Oracle. All rights reserved.4 - 26

Privileges for J2EE Users and Agents

CT-driven mappingsin heterogeneous

environmentsrequire agents to which

to deploy.

Copyright © 2009, Oracle. All rights reserved.4 - 28

1. Starting the Default Agent

In Windows, navigate to <OWB_HOME>\owb\bin\win32

and execute:

ccastart.bat

In Linux, open a terminal session, navigate to <OWB_HOME>/owb/bin/unix, and perform the following:

We will use welcome as the OC4J Administrator’s password

Copyright © 2009, Oracle. All rights reserved.4 - 29

2. Setting Up Credentials for Default Agent

welcome

Copyright © 2009, Oracle. All rights reserved.4 - 30

3. Mapping Modules and Agent Locations

CT-based heterogeneous mappings must be created in the top-level Template Mappings node.

Copyright © 2009, Oracle. All rights reserved.4 - 31

Agents Need Information About Locations

Copyright © 2009, Oracle. All rights reserved.4 - 32

Installing the OWB Agent on Another System

Copyright © 2009, Oracle. All rights reserved.4 - 33

System A - SQL Server Source

OWB Infrastructure with Agent on Oracle Target

SQL Server Database

System B – Oracle Target

Oracle Database

OWBdesignclient

Execute Local SQL

Move data over JDBC to staging table

Execute Remote SQL

Loads data from staging to target

Load CT Integration CT

Audit

Agent

Deploy EAR file to agent.Contains all SQL.

6

5

4

3

3

2

1

6

Copyright © 2009, Oracle. All rights reserved.4 - 34

System A - SQL Server Source

OWB Infrastructure with Agent on Remote Source

Agent

SQL Server Database

System B – IBM DB2 Target

Oracle Database

OWBdesignclientDeploy EAR file to agent

Contains all SQL

Execute SQL

Move data over

via SQL Loader

Execute Remote SQL

Loads data from staging to target

Load CT Integration CT

Audit

6

5

4

3

3

2

1

6

Copyright © 2009, Oracle. All rights reserved.4 - 35

Monitoring Deployments with HRAB Reports

• Heterogeneous Repository Audit Browser (HRAB) reports are useful for monitoring deployments to heterogeneous databases.– Scripts are provided for you to audit the deployment and

execution of mappings to Oracle, DB2, and SQL Server environments.

• The HRAB reports are a subset of the Repository Browser reports, with fewer details.

Copyright © 2009, Oracle. All rights reserved.4 - 36

Quiz

CT-driven mappings in heterogeneous environments require which of the following for successful deployment?

a. Pluggable mappings

b. Database links

c. Agents

d. All of the above

Copyright © 2009, Oracle. All rights reserved.4 - 37

Summary

In this lesson, you should have learned how to:

• Explain how to define new code templates for heterogeneous connectivity to non-Oracle sources

• Work with execution units– Use the execution view and logical view of the mapping

• Deploy CT mappings– Manage the privileges required of Java 2, Enterprise Edition

users and agents for placing agents in sources

Copyright © 2009, Oracle. All rights reserved.4 - 38

Practice 4-1 Overview: Using Code Templates in Mappings

This practice covers the examination and modification of a code template–based mapping.

CT-basedmapping

Sourcemodule

Sourcetables

MDL-importedproject

Targetmodule

Targettable

Sourceflat file