bryson collab10 owbhandsonlabs

Upload: krishnakanth171

Post on 02-Jun-2018

231 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    1/26

    Oracle Warehouse Builder 11gR2

    Development & Deployment

    Student Examples

    Rittman Mead Consulting 2009

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    2/26

    OWB Installation and Database Setup

    Hands-On Exercise 1: Creating the OWB Repository & User

    Open a terminal window.

    Set the environment variables:

    export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1export ORACLE_SID=orcl

    Make sure the database and listener are started:

    lsnrctl startsqlplus / as sysdbaSQL> startup

    Unlock the OWBSYS account. This is required for repository installation.

    SQL> alter user owbsys identified by password account unlock

    Exit sqlplus by typing : exit

    Start the Repository Assistant.

    cd $ORACLE_HOME/owb/bin/unixRun: ./reposinst.sh

    Click next to proceed from the welcome pageStep 1-10. Enter database information:

    Host: localhostPort: 1521Oracle Service Name: orcl.localdomain

    Click Next.

    Step 2-10. Choose Operation

    Select Manage Warehouse Builder Workspaces.

    Click Next.

    Step 3-10. Choose Workspace Operations.

    Choose Create a New Warehouse Builder workspace.

    Step 4-10. New or Existing User

    Choose Create a workspace with a new user as workspace owner

    Click Next.

    Step 5-10. DBA Information

    User Name: sysPassword: ioug10

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 2 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    3/26

    Click Next.

    Step 6-10. Workspace Owner (New)

    Workspace Owners User Name: owb_reposWorkspace Owners Password: passwordWorkspace Name: training

    Click Next.

    Step 7-10. OWBSYS Information.

    Fill in the password for the previously unlocked OWBSYS account. Click Next.

    Step 8-10. Select Tablespaces.

    Leave the defaults in place:

    Tablespace for Data: USERSTablespace for Indexes: USERSTablespace for Temporary Data: TEMPTablespace for Snapshots: USERS

    Click Next.

    Step 9-10. Select Languages.

    Leave the default in place:

    Base Language : AMERICAN ENGLISH

    Select no additional display languages

    Click Next.

    Step 10-10. Workspace Users (Optional)

    Create the following users with passwords password.Select the USERStablespace for data and indexes, and TEMPfor the temporarytablespace.

    training_stg

    Click Next.

    Summary.

    Check the summary and click Finish to create the repository and your database users.This may take a while to complete.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 3 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    4/26

    Hands-On Exercise 2: Prepare for future exercises

    Download the ORDERS_SRC dump file by opening a terminal and executing:

    wget http://dl.dropbox.com/0/view/77gp8zjcqp5h0fl/Collaborate%2010/

    orders_src.dmp

    Create the ORDERS_SRC user:

    sqlplus / as sysdbaSQL> create user orders_src identified by password;SQL> grant connect, resource to orders_src;

    Import the ORDERS_SRC schema:

    imp orders_src/password file=orders_src.dmp full=y

    Prepare for the external table demonstration later:

    Create a directory on your PC, and note its location. For this example, we will use adirectory called/home/oracle/Source_Data. Move into this directory and then pull downthe customers_csv file:

    wget http://dl.dropbox.com/0/view/kcxnc6z9g93x2ez/Collaborate%2010/customers_csv

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 4 of 26

    http://dl.dropbox.com/0/view/kcxnc6z9g93x2ez/Collaborate%2010/customers_csvhttp://dl.dropbox.com/0/view/kcxnc6z9g93x2ez/Collaborate%2010/customers_csvhttp://dl.dropbox.com/0/view/kcxnc6z9g93x2ez/Collaborate%2010/customers_csvhttp://dl.dropbox.com/0/view/kcxnc6z9g93x2ez/Collaborate%2010/customers_csvhttp://dl.dropbox.com/0/view/77gp8zjcqp5h0fl/Collaborate%2010/orders_src.dmphttp://dl.dropbox.com/0/view/77gp8zjcqp5h0fl/Collaborate%2010/orders_src.dmphttp://dl.dropbox.com/0/view/77gp8zjcqp5h0fl/Collaborate%2010/orders_src.dmphttp://dl.dropbox.com/0/view/77gp8zjcqp5h0fl/Collaborate%2010/orders_src.dmp
  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    5/26

    Hands-On Exercise 3

    Open a terminal window as the oracle user and set the proper ORACLE_HOME andORACLE_SID.

    Then run the OWB Design Center:

    cd $ORACLE_HOME/owb/bin/unixRun: ./owbclient.sh

    When the Design Center Logon dialog shows enter the following details:

    User Name : owb_reposPassword: password

    Ensure the Connection Details option is selected, and enter the following details:

    Host: localhostPort: 1521Service Name: orcl.localdomain

    Click Ok.

    When the Oracle Warehouse Builder opens, explore the user interface, taking a look atthe application toolbar, the Project Navigator tab, the Locations Navigator tab and theGlobals tab.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 5 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    6/26

    Hands-On Exercise 4: Creating a Project

    Select File > New.

    The object gallery opens. Select Project

    Alternatively right-click on MY_PROJECTand select New...

    Enter the following details in the Create Project dialog:

    Name : Training_ProjectDescription : This is a project for the training exercise.Expand the new project in the Projects Navigator to see the objects it contains.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 6 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    7/26

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 7 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    8/26

    Hands-On Exercise 5: Creating a Data Source Module

    Within the TRAINING_PROJECT project you just created, expand the Databasesand

    Oracleentries.Right-click on the Oracleentry, and select New Oracle Module

    The Create Module wizard will now be displayed.Click Next.

    Step 1-2: Name and Description dialog

    Enter and select the following values:

    Name : ORDERS_SRCModule Status : DevelopmentStep 2-2. Connection Information

    Press the Editbutton and enter the following connection details:

    Name : ORDERS_SRC_LOCATION1Description : Orders source dataType : HOST:PORT:SERVICEUser Name : orders_srcPassword : passwordHost : localhostService Name : orcl.localdomainVersion : 11.2

    Leave all other settings as the default. Press the Test Connectionbutton to check thatthe details are entered correctly, and press OKto save the connection details.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 8 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    9/26

    Click Next in the wizard and verify that Summary window that opens.If all looks ok then click Finish to create the new ORDERS_SRC module.

    Click the Save-All icon in the toolbar to save your changes.

    This can also be done using File->Save Allor by pressing CTRL-S.

    Make sure to do this regularly since it will commit the changes to the database.

    Note: unchanged items in the repository will show up in italic in the Oracle WarehouseBuilder interface.

    Right-click on the new ORDERS_SRC module in the projects navigator, and selectImport->Database Objects

    The Import Metadata Wizard will open.Click Next to continue.

    Step 1-3. Filter InformationSelect Tableclick Next.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 9 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    10/26

    Step 2-3. Object Selection page.

    Expand the list of tables and copy all of them across to the Selected pane.

    Press Next, review the selected tables, and press Ok to complete the metadata import.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 10 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    11/26

    Review the imported table metadata in the Design Center Project Explorer, and use theSave All button on the Warehouse Builder toolbar to save your project.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 11 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    12/26

    Hands-On Exercise 6: Creating Target Modules

    Within the TRAINING_PROJECT, expand the Databasesand Oracleentries. Right-Click

    on the Oracle entry and select New Oracle ModuleStep 1-2. Name and Description pageEnter the following details:

    Name : TRAINING_STGModule Status : DevelopmentStep 2-2. Connection Information page

    Press the Edit button, create location TRAINING_STG_LOCATION1and fill in the detailsfor the TRAINING_STG user that was created when the repository was created (seeearlier lab). Make sure to test the connection before clicking Ok.

    User Name : TRAINING_STG

    Password : passwordHost : localhostPort : 1521Service Name : orclSchema : TRAINING_STGVersion : 11.2

    Click Nextand then Finishto create the module. Do not attempt to import any tablemetadata in to the new module, as the underlying schema is currently empty.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 12 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    13/26

    Repeat this step again but this time create a module called TRAINING_DW, this timecreating the location TRAINING_DW_LOCATION1.

    Once these steps are completed, view the new Oracle Database modules in your project.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 13 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    14/26

    Hands-On Exercise 7: Importing Files, Creating an External Table

    Within the TRAINING_PROJECT, locate the Filesentry. Right-Click on it and select New

    Flat File Module.In the Create Module wizard Name and Description page, enter the following details:

    Name : SOURCE_FILESDescription : Source files used in training projectOn the Connection Information page, press the Editbutton, and enter the followingvalues:

    Name : SOURCE_FILES_LOCATION1Type : general

    Then use the Browsebutton to locate the directory that you created earlier, and in whichthe source file is located.

    Press OK to save the Source File location.When you return to the Connection Information page, check the Import After Finishcheckbox so that Warehouse Builder starts the file metadata import processautomatically.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 14 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    15/26

    Press Finishto complete the wizard.When the Import Metadata Wizard starts, click Add Sample File.Using the Opendialog, select the customers_csvfile and click Open.

    On the File Importpage the file has now been added as a Sample File.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 15 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    16/26

    Click Importto continue. This will open the Flat File Sample Wizard.

    Step 1-3. Name.

    On the Flat File Sample wizard, press Nextand then review the file details. Leave allvalues as the default, and then press Next.

    Strep 2-3. Simple delimited.

    On the Simple Delimited page, check that Records delimited byis checked with a valueof , and that Field Delimiteris set to Comma (,).

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 16 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    17/26

    Click Next.

    Step 3-3. Field Properties.

    On the Field Properties check the checkbox Use the First Record as the Field

    Names.

    Press Nextto review the summary and click Finishto complete the wizard.Save you changes.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 17 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    18/26

    Now that you have imported the file metadata, you will now create an external table tomake accessing the data within it more convenient. Locate the TRAINING_STG modulewithin your project, then locate the External Tables entry, right-click on it and select NewExternal Table.

    The Create External Table Wizardopens.Click Nextto continue.

    Step 1-3. Name and Description

    Name the external table stg_customers_extand press Next.Step 2-3. File Selection.

    On the File Selectionpage, select the customer_csvfile that you imported previously.

    Click OK to save the location details, Nextand then Finishto complete the wizard. Saveyour changes.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 18 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    19/26

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 19 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    20/26

    Hands-On Exercise 8: Creating Relational Objects

    In this exercise, you will create three tables to hold data on customers, orders andproducts. Later on, you will map data in to these tables before loading them in to your

    data warehouse.

    Locate the TRAINING_STGOracle Database module in your project, expand it andlocate the Tablesentry.Right click on the Tables entry and select New Table.

    Enter the name STG_PRODUCTS and clickOk.A new tab will open, allowing to enter details on the newly create table.

    Using the Columnstab, enter the following column details:

    Name Data Type Length Precision Scale Not Null

    PROD_ID NUMBER 6 0 !

    PROD_NAME VARCHAR2 20 !

    COLOUR VARCHAR2 20

    PRICE NUMBER 10 2

    COST NUMBER 10 2

    PROD_TYPE_ID NUMBER 6 0

    PROD_TYPE_DSC VARCHAR2 20

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 20 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    21/26

    Hands-On Exercise 9: Deploying Relational Objects

    In this hands-on exercise, you will deploy the tables and external table that you designed

    in the previous exercises.SQL> grant create any directory to training_stg;SQL> grant drop any directory to training_stg;

    Using Oracle Warehouse Builder, select Tools> Control Center Managerto start theControl Center Manager application.Locate the TRAINING_STG_LOCATION1entry in the list of locations, expand it, andthen expand the TRAINING_STGmodule to display the list of objects that it contains.Click on and select the TRAINING_STGmodule, as shown in the figure below.

    Click on the Default Actionsbutton on the right-hand side of the Control CenterManager, to set the Deploy Action for each of the selected objects to Create.Since none of the objects have been previously deployed the deployment action is set toCreatefor all objects.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 21 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    22/26

    From the application menu, select File> Deploy> To Control Center.

    When prompted to register the TRAINING_STG_LOCATION1 location, enter thepassword and click Test Connectionto check the connection details are valid. Onceconfirmed, press OKto save the location details, and then check that the deploymentwas successful (see below) before proceeding.

    Once you have checked that the tables have been deployed correctly, close the ControlCenter Manager and return to the Design Center.

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 22 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    23/26

    Hands-On Exercise 10: Creating Data Mappings

    In this first mapping, we will take data from the source PRODUCT, PRODUCT_DETAILSand PRODUCT_TYPES tables, join them and load the results in to the

    STG_PRODUCTS table.In the Project Explorer, within the TRAINING_PROJECT, expand the DatabasesandOracleentries. locate the TRAINING_STG module and the Mappings folder within it.Right-click on the mappings folder and select New Mapping.Call the mapping MAP_STG_PRODUCTSIn the mapping editor, locate the Component Palette. If not found it can be opened bychoosing View->Component Palette.Drag and drop a Table Operator on to themapping canvas. Using the Add Table Operator dialog, select the PRODUCTS table fromwithin the ORDERS_SRC module. Repeat the process to add the PRODUCT_DETAILSand PRODUCT_TYPES tables.

    Note that you can multi-select these 3 files at once as well.

    Using the mapping operator palette, drop a Joiner operator on to the mapping canvas, tothe right of the three tables you just added.

    Double-click on the Joiner operator and select the Groups.

    Rename INGRP1 and INGRP2 to PRODUCTS and PRODUCT_DETAILS respectively.

    Add a 3rdinput group called PRODUCT_TYPES.

    Rename OUTGRP1 to STG_PRODUCTS, like this:

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 23 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    24/26

    Press OK to save the details.On the mapping canvas, select the INOUTGRP1 entry in the PRODUCTS table, anddrag and drop it on to the PRODUCTS group in the Joiner operator. Do the same withthe PRODUCT_DETAILS table, dragging its INOUTGRP1 column on to thePRODUCT_DETAILS Joiner group, and drag the PRODUCT_TYPES header on to thePRODUCT_TYPES joiner group, like this:

    Single-click on the Join operator, and then click in the Join Conditionproperty in theProperty Inspector (if not open it can be opened usingView->Property Inspector).Press the ellipses button () to bring up the Expression Builder.

    Using the Expression Builder, join the three input tables in the following way:

    PRODUCTS.PROD_TYPE_ID = PRODUCT_TYPES.PROD_TYPE_IDand

    Oracle Warehouse Builder 11gR2 Development & Deployment

    Rittman Mead Consulting Page 24 of 26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    25/26

  • 8/10/2019 Bryson Collab10 Owbhandsonlabs

    26/26

    Select File> Validatefrom the menu or click its corresponding icon in the toolbar tocheck that the mapping is valid, and then save and close the mapping.

    Before we can deploy this new mapping to the database, we need to ensure that theTRAINING_STG user you created previously can access tables in the ORDERS_SRCschema. Normally, your DBA would grant access to these tables individually, but for now,the course instructor will connect to the database as the SYSTEM user and grant theSELECT ANY TABLE role to the TRAINING_STG account.

    SQL> grant select any table to training_stg;

    Using the Control Center Manager, deploy the new mapping to the database, and ensure

    that it compiles and deploys correctly.Still within the Control Center Manager, select in turn each of the mappings, right-click onthem and select Start.

    Oracle Warehouse Builder 11gR2 Development & Deployment