ODI 12c



Comments



Description

PurposeThis tutorial walks you through the steps that are needed to create an Oracle Data Integrator Studio (ODI) procedure and scenario, and schedule the scenario to run at a later time. Time to Complete Approximately 1 hour. Introduction When a set of objects is complete and tested, a good practice is to create an ODI scenario for packages and sometimes procedures. After a scenario is created, it cannot be edited, and the code for the object is regenerated and stored in the scenario. The created scenarios can also be scheduled for running virtually on any time interval within ODI. In this OBE, you create an ODI procedure, then schedule a scenario for the procedure at a later time. This is the fourth in a series of four OBEs in the Oracle Data Integrator 12c: Getting Started series. Scenario Linda works as a database administrator for Example Enterprise Corp (http://www.example.com). In Example Enterprise, Linda is responsible for performing database management and integration tasks on various resources within the organization. In particular, Linda is responsible for data loading, transformation, and validation. To begin working on her projects, she created the new Master repository and Work repository. Linda also created the project and the procedure to create a relational table and populate it with data. She set up and installed an ODI Agent as a service. Now Linda needs to create and schedule an ODI scenario to run the procedure at the appropriate time. Hardware and Software Requirements The following is a list of software requirements: o A supported operating system (the OS shown here is 64-bit Oracle Enterprise Linux release 6.7 (Santiago), other versions such as Windows are supported as well) o Oracle Database (the version shown here is Enterprise Edition 12.1.0.2.0, other versions are supported as well) o Oracle Data Integrator 12c (the version shown here is 12.2.1) The following is a list of OPTIONAL software: o Oracle WebLogic Server (WLS) 12c (other versions are supported as well) o Oracle SQL Developer 12c (included with Database 12c install) If WLS is present, it must be in the same Middleware HOME directories as ODI. Prerequisites Before starting this tutorial, you should have: o Started Oracle Database services and components such as the Listener. o A Database user with DBA role privileges such as the SYS or SYSTEM account. o Installed the HR schema included in the Oracle Database. The Sample Schemas Installation Guide is part of the Oracle Database documentation set, and is also available online at: http://otn.oracle.com. o Already installed and configured ODI Master and Work repositories (instructions on how to do this are contained in the first of four OBEs in the ODI 12c Getting Started series). o Already created an ODI project and mapping for a flat file to a relational table (instructions on how to do this are contained in the second of four OBEs in the ODI 12c Getting Started series). o Already created both a physical and logical agent, and still have a running ODI agent process (instructions on how to do this are contained in the third of four OBEs in the ODI 12c Getting Started series). 1. Creating an ODI Project An ODI project contains (among other things) ODI procedures, scenarios, and schedules. To create a project to hold the components of this OBE, perform the following steps: 1.1 Starting ODI Studio Start ODI Studio by running odi.sh. OS Prompt [myuser@myhost ~]$ cd $ODI_HOME/studio [myuser@myhost studio]$ pwd /u01/app/oracle/Middleware/Oracle_Home/odi/studio [myuser@myhost studio]$ ./odi.sh Oracle Fusion Data Integrator Studio 12c Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. The splash screen and progress bar displays briefly. On the left panel, on either the Designer or Topology tab, click Connect To Repository... Enter the Wallet Password. (It may be pre-stored.) Click OK to continue. Enter the SUPERVISOR Password. (It may be pre-stored.) Click OK to continue. A progress bar is displayed briefly. When ODI Studio is finished connecting to the repositories, the navigation panel on the left is populated. In summary, you have started ODI Studio. 1.2 Creating a Project On the left, on the Designer tab, expand Projects. On the Projects pull-down (three colored squares icon), select New Project. An unnamed Project panel opens on the right. On the right, on the Definition tab, in Name, enter Proc-Crt-Tbl (Procedure Create Table, though you could name it anything). on the Designer tab. An unnamed procedure panel opens on the right. Right-click Procedures and select New Procedure. Save your work by clicking . you can anticipate many common situations. You should now see your new Project in the tree on the left. To create and run a procedure. . On the right. perform the following steps: 2. It may contain SQL and file operations. though this OBE does not depend on them. You can close open tabs on the right. choose Oracle. In summary. you created a new project to hold the objects you are about to create. There may be other previous projects there as well. Using checkboxes for options. 2. Creating and Running a Procedure An ODI procedure is like a script. In the Target Technology pull-down. on the Procedure panel. expand Projects > Proc-Crt-Tbl > First Folder > Procedures. on Name enter Procedure-create-populate-table .1 Configuring the Definition On the left. select the following pull-downs:  Technology = Oracle  Context = Global  Schema = DB-HR In Command. click Add (the green plus).planets in the big box. 2. Note that the Source Technology does not apply in this example. a procedure defintiion with no tasks yet. but the blue line gets populated by your entering information on the bottom Properties panel. in Name enter Drop Table .2 Task Drop Table On the Tasks tab. Notice there is no punctuation after the table name. enter DROP TABLE hr. an empty Procedure has been created. It creates a blue line on the top. . that is. no semi-colon. In summary. In the Properties panel below. in the General section. Select Ignore Errors to cover the situation where you try to drop a non- existent table. nothing. you don't enter anything on the blue line itself. In the Target Command section. Note the blue line getting completed above as you work below. 2. It might not be a bad idea to save things at this point. but you do not have to. the task just ignores the error. rather than trying to type something bigger than the box. It creates a second blue line on the top. Later you can change the order of the lines up or down. If the table does not exist. click on the gear to the right of the box. select the following pull-downs:  Technology = Oracle  Context = Global  Schema = DB-HR In Command. you entered a single SQL command to drop a table. in Name enter Create Table .3 Task Create Table On the Tasks tab. In the Properties panel below. in the General section. In the Target Command section. . click Add (the green plus) a second time. In summary. At some later time you can decide whether it is wiser to DROP versus TRUNCATE a table. The gear opens an Edit Expression pop-up dialog box. You can type the SQL expression by hand. or use the functions to build the expression. Or you can cut-n-paste from here. . rather than trying to type something much bigger than the box. select the following pull-downs (same as the previous step):  Technology = Oracle  Context = Global  Schema = DB-HR In Command. in the General section. Click OK to continue. click on the gear to the right of the box. In summary. In the Target Command section. Later you can change the order of the lines up or down.4 Task Populate Table Now you need to populate the new table with data. On the Tasks tab. 2. Notice again that there is no punctuation at the end of a single SQL statement. in Name enter Populate Table . click Add (the green plus) a third time. It creates a third blue line on the top. In the Properties panel below. . you created a task step with a single SQL statement to create the empty table and associated primary key index. Or you can cut-n-paste from here. in the block of instructions for this step. The gear opens an Edit Expression pop-up dialog box. so there is no need to have your own commit.Notice that these DML statements are by default Transaction = Autocommit. You can type the SQL expressions by hand. or use the functions to build the expressions. . Right-click Procedure-create-populate-table and select Run. click Yes to continue. and the final block end statement also terminates with a semi-colon. and must be enclosed in a begin/end. Click OK to close the Edit Expression panel and continue. In a multi-user environment. multi-line sets of SQL statements are punctuated differently than single SQL statements. but each of the INSERT lines does end in a semi-colon. You created a step to populate the new table. it does not matter what you do with locking. The begin keyword has no punctuation. block. expand Projects > Proc-Crt-Tbl > First Folder > Procedures. 2. on the Designer tab. . If you see this message. In a standalone (single-user) environment.5 Running Procedures You may or may not be locking and unlocking the objects as you edit them. Save your work by clicking . it might be safer to lock objects to prevent others from editing them at the same time as you are editing. In summary. On the left.The punctuation for this multi-line set of SQL statements is different than the first two single line statements. On the Run dialog box.There are other ways to get a procedure to run as well. there is nothing you need to do. Click OK to continue. . accept the defaults. On the Information dialog box. .planets. 2014. Last Successful login time: Fri Jul 26 2015 15:02:23 -04:00 Connected to: Oracle Database 12c Enterprise Edition Release 12. SQL Prompt [myuser@myhost ~]$ sqlplus hr/hr SQL*Plus: Release 12.2. Note that the first time you run this procedure. TOAD. but with Ignore Errors selected. On the left.Click OK to continue. that task shows up as a green check mark. SQL Developer.0 Production on Mon Jul 29 13:27:03 2015 Copyright (c) 1982.0 . Oracle. Advanced Analytics and Real Application Testing options SQL> SELECT * FROM hr.1. then the procedure completed successfully.0.1.0. If they are all green. the DROP TABLE technically did not complete. Use either SQL*Plus. expand Date > Today > Procedure-create-populate-table-datetime > Procedure-create-populate-table-datetime and look for the green circle check marks . or equivalent to query the PLANETS table.2. OLAP. Verify that the table was actually populated using a tool outisde of ODI. All rights reserved. on the Operator tab.64bit Production With the Partitioning. 3. perform the following steps: 3. I remember the Good Ole Days when Pluto was a planet.. Using Scenarios Scenarios can be generated from several ODI objects including Packages.-----------.. . Right-click Procedure-create-populate-table and select Generate Scenario. In summary. To create a scenario from a procedure. SUN_ORDER NAME DIAM_KM ---------.) then your procedure worked.----------- 1 Mercury 4878 2 Venus 12104 3 Earth 12742 4 Mars 6779 5 Jupiter 139822 6 Saturn 116464 7 Uranus 50724 8 Neptune 49244 9 Pluto 2390 9 rows selected. scenarios cannot be modified. Generating a scenario for an object compiles the code for this object for deployment and execution in a production environment. expand Projects > Proc-Crt-Tbl > First Folder > Procedures. the procedure was started manually and ran successfully. on the Designer tab. SQL> If you see nine planets (hey. Mappings and Procedures. Being compiled.1 Generating a Scenario On the left. expand Scenarios. . it would be Version 002. Click OK to continue. Notice the dashes in the name turned into underscores. then 003. accept the defaults. and so on. and you should see the new one you just added: PROCEDURE_CREATE_POPULATE_TABLE Version 001.On the New Scenario dialog box. If you were to compile it again. On the left. only scenarios (compiled procedures) can be scheduled. To make sure that the agent is still working. do this: On the left. 4. Scheduling a Scenario Procedures cannot be scheduled. but it won't look any different than running the uncompiled procedure again. or scheduled to run later. You could optionally run the scenario at this time. perform the following steps: 4. To schedule a scenario to run at a later date/time. Scheduling requires an agent. Right-click OracleDIAgent1 and select Test. In summary. making a scenario is all of one step. . on the Topology tab.1 Testing the Agent You created an agent in an earlier OBE. expand Physical Architecture > Agents. Now it exists in a compiled form that can be run manually ad hoc. 4. on the Designer tab. . revisit the previous OBE on Creating an Agent. In summary. one time. Click OK to continue. On the left. expand Projects > Proc-Crt-Tbl > First Folder > Procedures > Procedure-create-populate-table > Scenarios > PROCEDURE_CREATE_POPULATE_TABLE Version 001 > Scheduling. If the test was not successful. An ODI Information dialog box pops up and says that the test was successful.2 Scheduling the Scenario Suppose you want the scenario to run at 4am tomorrow. you have a working agent that can be used to schedule a scenario. Right-click Scheduling and select New Scheduling.There are other ways to get to the test. In the Execution section. On the right.Had you not finished the previous OBE. on the Scheduling panel. then you should not see that message. on the Definition tab. select MyAgent. then go back and redo the previous OBE on Creating an Agent. or click the calendar icon. If you do have this message. you may get a reminder message similar to the one below. in the Logical Agent pull-down. If you did complete the previous OBE. . click OK. you can either set the date/time manually. Click OK to continue. . Save your work by clicking . August 2nd). then click-and-hold the minute hand of the clock and drag it around to the desired time (for example. 4am). click on the calendar one-time date you want (for example.On the Time and Date Selection dialog box. on the Topology tab. Right-click OracleDIAgent1 and select either Update Schedule or Open. Click Update Schedule to continue. On the left. then the next panel displays.You should see the new GLOBAL/MyAgent on the left under the expanded Scheduling. . If you selected Open. expand Physical Architecture > Agents. you only have one repository to choose from.On the Select Repositories dialog box. . The Information dialog box pops up when the update is completed. Click OK to continue. Click OK to continue.3 Testing the Scenario Sometime after the scheduled time. In summary. For the first place to look. Click OK to continue. You can optionally view the schedules for a given agent. That represents the scenario on the timeline. check the status of the run. Click View Schedule to see the timeline. . you have scheduled the scenario to run at 4 in the morning. You can look in several places. on the Operator tab. Since the duration is so very short. Scroll left/right if you cannot see the whole image. in the middle of the dotted line is a solid line (the lower red arrow). on the left. Looking at 4:00am (the upper red arrow). Now we wait for that time to pass! 4. expand Session List > Date > Today > PROCEDURE_CREATE_POPULATE_TABLE-scheduled_time and look for the green circle check marks at the appropriate runtime. the line is hardly visible. . In summary.Alternatively. These two entries are the the same event: one event displayed in two places. for the second place you could have looked under Session List > Agent > OracleDIAgent1 > PROCEDURE_CREATE_POPULATE_TABLE-scheduled_time and look for the green circle check marks at the appropriate runtime. you created a schedule and then used the Operator tab to check the status of the run after the run completed. Description of this image 3. enter the following values and then click OK: o Login Name: Cubes and Dimensions o User: SUPERVISOR o Password: welcome1 Description of this image The user and password is prepopulated from the wallet. In the Oracle Data Integrator Login dialog box. . Description of this image 2. If you're asked for the wallet password. Starting ODI 12.2. Double-click the ODI 12c Studio desktop icon.1 1. click Connect to Repository in the left navigation pane. In ODI. enter welcome1. In the new dimension creation form. Description of this image 2. On the Designer tab. enter CUST in the Find field. . Description of this image. right-click Dimensions. expand Dimensions and Cubes and OBE. and then select New Dimension. Under BI_SALES. In the Select Datastore dialog box. Under Binding. ODI is now started and ready to create cubes and dimensions. and click OK. click Set the datastore for Dimensionnext to the Datastore field. click the Definition tab and enter Customers in the Name field. 3. select CUSTOMERS_TAB. Creating the Customers Dimension 1. City. SubRegion. 5. 4. Description of this image. Province. click Save. Defining the Levels Sections (Customers Dimension) In the following sections. and selecting CUSTOMERS_SEQ Description of this image. Adding the Total Level . Repeat step 3 for Surrogate Key Sequence. Region. entering CUST in the Find field. Country. and Customer. In the ODI menu bar. you create levels for Total. In the Staging Datastore cell. change the name from Level1 to Total. In the Levels table.1. 3. enter CUST in the Find field. click the button to open the Select Datastore dialog box. click Add. . Click the Levels tab. Select CUSTOMERS_TOTAL_STG and click OK. In the Name cell. 2. Description of this image. In the Select Datastore dialog box. Description of this image. In the Staging Datastore cell.CUSTOMERS_REGION_STG and click OK. click Add.) NUMERIC TOTAL_SURROGATE_KEY Natural_Key (Don't select the check box. In the ODI menu bar. click Add. click Add. Description of this image. then select BI_SALES. Name Surrogate_Key Data Type Size Attribute Surrogate_Key (Select the check box.) VARCHAR 40 TOTAL_NATURAL_KEY Name (Don't select the check box. 6. In the Name cell. click Select Columnsand select Size from the menu. In the Natural Key Members table. . In the Levels table. and then enter or select the values listed in the following table.) VARCHAR 65 TOTAL_NAME 5. enter Region. click the button to open the Select Datastore dialog box. click Save. In the Level Attributes table. Description of this image. If the Size column doesn't appear. Adding the Region Level 1. 4. and then enter Natural_Key. ) VARCHAR 65 REGION_NAME 3. In the Parent References table. In the Level Attributes table. confirm that the Parent Key Attribute cell shows CUSTOMERS_TAB. select Total. click Add. In the Parent Level cell. and then enter or select the values listed in the following table: Name Surrogate_Key Data Type Size Attribute Surrogate_Key (Select the check box. Description of this image. In the Name cell. click Add. In the Natural Key Members table. Description of this image.) NUMERIC REGION_SURROGATE_KEY Natural_Key (Don't select the check box.) VARCHAR 40 REGION_NATURAL_KEY Name (Don't select the check box.TOTAL_SURROGATE_KEY and that the Foreign Key Attribute and Foreign Key Staging Attribute cells show TOTAL_SURROGATE_KEY. click Add. . change the name from PARENTREF1 to Region_of_Total. In the Parent Level Reference Key Member table. 2. 4. In the ODI menu bar. enter Subregion. and then enter or select the values in the following table: Name Surrogate_Key Data Type Size Attribute Surrogate_Key (Select the check box. click Add. 5.) NUMERIC SUBREGION_SURROGATE_KEY Natural_Key (Don't select the check box. Description of this image. 2. . click Save. In the Staging Datastore cell.) VARCHAR 40 SUBREGION_NATURAL_KEY Name (Don't select the check box. click Add. then select BI_SALES.CUSTOMERS_SUBREGION_STG and click OK. click Add. In the Natural Key Members table. In the Level Attributes table.) VARCHAR 65 SUBREGION_NAME 3. click the button to open the Select Datastore dialog box. Description of this image. In the Levels table. Adding the Subregion Level 1. In the Name cell. In the Levels table. In the Name cell. Rename PARENTREF1 to Subregion_of_Region and select Region in the Parent Level cell. confirm that the Parent Key Attribute field shows CUSTOMERS_TAB. Description of this image. click Add. 5. click Add. . Description of this image. 4. click Save. click the button to open the Select Datastore dialog box. In the Staging Datastore cell.CUSTOMERS_COUNTRY_STG and click OK. In the ODI menu bar. Adding the Country Level 1.REGION_SURROGATE_KEY and that all other fields show REGION_SURROGATE_KEY. In the Parent Level Reference Key Member table. then select BI_SALES. In the Parent References table. enter Country. In the Level Attributes table. click Add. click Add. In the Parent References table. confirm that the Parent Key Attribute cell shows CUSTOMERS_TAB. In the Parent Level Reference Key Member table. Description of this image.) NUMERIC COUNTRY_SURROGATE_KEY Natural_Key (Don't select the check box. click Add. In the Natural Key Members table. 2.SUBREGION_SURROGATE_KEY and that all other cells show SUBREGION_SURROGATE_KEY. Description of this image. . 4.) VARCHAR 65 COUNTRY_NAME ISO (Don't select the check box.) VARCHAR 40 COUNTRY_NATURAL_KEY Name (Don't select the check box. and then enter or select the values listed in the following table: Name Surrogate_Key Data Type Size Attribute Surrogate_Key (Select the check box.) VARCHAR 2 COUNTRY_ISO 3. Rename PARENTREF1 to Country_of_SubRegion and select Subregion in the Parent Level cell. ) VARCHAR 65 PROVINCE_NAME 3. click Save. click Add. In the Natural Key Members table. Description of this image. then select BI_SALES. Adding the Province Level 1.) NUMERIC PROVINCE_SURROGATE_KEY Natural_Key (Don't select the check box. In the Staging Datastore cell. In the ODI menu bar. click Add. enter Province.CUSTOMERS_PROVINCE_STG and click OK. click the button to open the Select Datastore dialog box. and then enter or select the values listed in the following table: Name Surrogate_Key Data Type Size Attribute Surrogate_Key (Select the check box. 5. In the Name cell. In the Levels table. 2. click Add. Description of this image.) VARCHAR 40 PROVINCE_NATURAL_KEY Name (Don't select the check box. In the Level Attributes table. . 5. Rename PARENTREF1 to Province_of_Country. Description of this image. In the Parent Level cell. Description of this image. click Add. click Add. click Save. In the Staging Datastore cell. 4. enter City. In the Levels table. select Country. In the ODI menu bar.COUNTRY_SURROGATE_KEY and that all other cells show COUNTRY_SURROGATE_KEY. In the Parent References table.CUSTOMERS_CITY_STG and click OK. then select BI_SALES. click the button to open the Select Datastore dialog box. confirm that the Parent Key Attribute cell shows CUSTOMERS_TAB. . In the Name cell. Adding the City Level 1. In the Parent Level Reference Key Member table. In the Level Attributes table. click Add. 2. . click Add.PROVINCE_SURROGATE_KEY and that all other fields show PROVINCE_SURROGATE_KEY. Rename PARENTREF1 to City_of_Province and select Province in the Parent Level cell. and then enter or select the values in the following table: Name Surrogate_Key Data Type Size Attribute Surrogate_Key (Select the check box.) NUMERIC CITY_SURROGATE_KEY Natural_Key (Don't select the check box. In the Natural Key Members table. confirm that the Parent Key Attribute cell shows CUSTOMERS_TAB.) VARCHAR 65 CITY_NAME 3. In the Parent Level Reference Key Member table. Description of this image. In the Parent References table. 4.) VARCHAR 40 CITY_NATURAL_KEY Name (Don't select the check box. click Add. Description of this image. In the Name cell. In the ODI menu bar.In the Staging Datastore cell.) NUMERIC CUSTOMER_SURROGATE_KEY Natural_Key (Don't select the check box. then select BI_SALES.) VARCHAR 40 CUSTOMER_STREET_ADDRESS . click Save. 2. click Add.) VARCHAR 65 CUSTOMER_NAME Gender (Don't select the check box.CUSTOMERS_CUSTOMER_STG and click OK. click the button to open the Select Datastore dialog box. In the Levels table. In the Level Attributes table.) VARCHAR 10 CUSTOMER_GENDER Street_Address (Don't select the check box. and then enter or select the values in the following table: Name Surrogate_Key Data Type Size Attribute Surrogate_Key (Select the check box.) VARCHAR 40 CUSTOMER_NATURAL_KEY Name (Don't select the check box. enter Customer. 5. Adding the Customer Level 1. Description of this image. click Add. Description of this image. In the Parent Level Reference Key Member table. click Add.) VARCHAR 30 CUSTOMER_EMAIL 3. . Description of this image. Rename PARENTREF1 to Customer_of_City and select City in the Parent Level cell. In the Parent References table. In the ODI menu bar. In the Natural Key Members table. confirm that the Parent Key Attribute cell shows CUSTOMERS_TAB. Description of this image. Postal_Code (Don't select the check box. click Add. click Save.) VARCHAR 25 CUSTOMER_PHONE_NUMBER Email (Don't select the check box. 5. 4.) VARCHAR 10 CUSTOMER_POSTAL_CODE Phone_Number (Don't select the check box.CITY_SURROGATE_KEY and that all other fields show CITY_SURROGATE_KEY. Defining the Hierarchies (Customers Dimension) 1. When the “Successful Validation” message appears. Click the Hierarchies tab. and then select New Cube. expand Dimensions and Cubes and OBE. In the ODI menu bar. rename HIERARCHY1 to CUSTOMERS_STD_HIER. Description of this image. and then click Validate. click Add and then add the following levels. click OK and close the Customers dimension tab in your workspace. Creating the Sales Cube 1. Click Add. For hierarchy members. and select the check box in the Default column. right-click Cubes. 2. click Save. 3. On the Designer tab. . leaving the default values in the Parent Level Reference column: o Total o Region o Subregion o Country o Province o City o Customer Description of this image. . In the new cube creation form. under Times. 3. 2. click Set the datastore for Cube next to the Datastore field. In the Select Datastore dialog box. click the Definition tab and enter Sales in the Name field. enter SAL in the Find field. and then click the button in the Level field. Under Binding. Description of this image. 4. In the Select Level dialog box. Click the Details tab. select SALES_TAB. In the Dimensions table. Under BI_SALES. Description of this image. and click OK. 5. and click OK. select Day. click Add. for the End_Date row. Description of this image. In the Key Binding table. Repeat steps 5.Product PRODUCTS . 7. and 7 to add the dimensions listed in the following table: Dimension Level Key Binding Attribute Channels. enter TIMES in the Attribute field. 6. 6.Channel CHANNELS Products. Description of this image. and Cubes and Dimensions. At the bottom of the Details page. click Add for Measures. right-click Mappings and select New Mapping. 13. Mapping the Load Customers Dimension Creating the Mapping 1. and then enter the values listed in the following table: Name Data Type Size Scale Attribute Error Attribute Amount NUMERIC 10 2 AMOUNT AMOUNT Cost NUMERIC 10 2 COST COST Quantity NUMERIC QUANTITY QUANTITY 11. Promotions. Click Validate. click Save in the ODI menu bar. Description of this image. Your Measures table should like the following image: 12. On the Designer tab. . OBE.Promotion PROMOTIONS Customers. expand Projects.Customer CUSTOMERS 8. 10. Description of this image. and then close the Sales Cube tab. Your Sales Cube Details page should look like the following image: 9. CITIES. and REGIONS into the mapping area. COUNTRIES. 2. and click OK. CUSTOMERS. expand Models and BI_XWEEK. deselect Create Empty Dataset. Description of this image. enter Load Customers Dimension in the Name field. 3. In the New Mapping dialog box. On the Designer tab. then drag and drop ADDRESSES. . Description of this image. and drag and drop it into the mapping area. Description of this image. In the Components palette. . Adding Components 1. select DISTINCT. between CUSTOMERS and REGIONS so that it's next to CITIES. In the DISTINCT_ . .Properties pane. 2. and enter PROVS_ONLY in the Name field. click the General tab. Description of this image. In the mapping area. select DISTINCT_. select JOIN. 3. Drag and drop the following into JOIN: ISO_CODE (COUNTRIES) and COUNTRY_ISO_CODE (PROVS_ONLY). Drag and drop STATE_PROVINCE and COUNTRY_ISO_CODE from CITIES into PROVS_ONLY. 4. and drag and drop it next to COUNTRIES and PROVS_ONLY in the mapping area. In the Components palette. Description of this image. Description of this image. . 7. 6. In the JOIN . Description of this image. 5. Drag and drop the following into JOIN1: ID (CUSTOMERS) and CUSTOMER_ID (ADRESSES). verify that CUSTOMERS. Select JOIN. Description of this image.ISO_CODE appears in the Join Condition field.ISO_CODE = COUNTRIES. drag and drop JOIN next to CUSTOMERS and ADDRESSES in the mapping area.COUNTRY. In the Components palette. verify that PROVS_ONLY. .Properties pane. In the JOIN1 - Properties pane.ID = ADDRESSES.CUSTOMER_ID appears in the Join Condition field. Description of this image. 8. To create a filter, drag and drop REGION_ID from REGIONS into the mapping area. In the FILTER - Properties pane, enter is not null at the end of the Filter Condition field. Description of this image. 9. In the FILTER - Properties pane, click the General tab and change FILTER to SUBREG_ONLY in the Name field. Description of this image. 10. In the Components palette, drag and drop FILTER next to REGIONS in the mapping area. Drag and drop REGION_ID from REGIONS to FILTER. In the FILTER - Properties pane, enter is null at the end of the Filter Condition field. Description of this image. 11. On the General tab of the FILTER - Properties pane, rename FILTER to REG_ONLY. On the Connector Points tab, in the Connected From column, deselect SUBREG_ONLY, click No Selection and select REGIONS. Description of this image. Mapping Attributes 1. On the Designer tab, expand Dimensions and Cubes, OBE, and Dimensions. Drag and drop Customers into the mapping area. On the General tab in the Customers1 - Properties pane, rename Customers1 to Customers_Dim. drag and drop EXPRESSION into the mapping area. In the EXPRESSION . click Add on the Attributes tab and enter the following values in the Attributes table: o Name: TOTAL_NAME o Data Type: VARCHAR o Length: 20 o Expression: 'Customers_Total' . Description of this image. 2. In the Components palette.Properties pane. Description of this image. . 5. 6. Drag and drop NAME (REGIONS) to Region_Name (Customers_Dim). In the Path Selection dialog box. Drag and drop TOTAL_NAME (EXPRESSION) to Total_Natural_Key and Total_Name (Customers_Dim). 4. Drag and drop ID (REGIONS) to Region_Natural_Key (Customers_Dim). 3. then click OK. select REGIONS@REG_ONLY. Select REF_Total_Natural_Key (Customers_Dim) and enter 'Customers_Total' in the Expression field in the Properties pane. Description of this image. In the Path Selection dialog box. Description of this image. then click OK. select REGIONS@SUBREG_ONLY. Drag and drop ID (REGIONS) to Subregion_Natural_Key (Customers_Dim). 7. Map the following source attributes to the specified target attribute in Customers_Dim: . 8. Description of this image. Source Model Source Attribute Target Attribute REGIONS NAME SubRegion_Name REGIONS REGION_ID REF_Region_Natural_Key COUNTRIES ID Country_Natural_Key COUNTRIES NAME Country_Name COUNTRIES ISO_CODE Country_ISO COUNTRIES REGION_ID REF_SubRegion_Natural_Key PROVS_ONLY STATE_PROVINCE Province_Natural_Key PROVS_ONLY STATE_PROVINCE Province_Name COUNTRIES ID REF_Country_Natural_Key CITIES ID City_Natural_Key CITIES NAME City_Name CITIES STATE_PROVINCE REF_Province_Natural_Key CUSTOMERS ID Customer_Natural_Key CUSTOMERS NAME Customer_Name CUSTOMERS GENDER Customer_Gender ADDRESSES CUST_STREET_ADDRESS Customer_Street_Address ADDRESSES CUST_POSTAL_CODE Customer_Postal_Code ADDRESSES PHONE_NUMBER Customer_Phone_Number CUSTOMERS EMAIL Customer_Email ADDRESSES CITY_ID REF_City_Natural_Key 9. Your mapping should look similar to the following image: . Click the Physical tab and review the physical mapping. Description of this image.10. . 11. Description of this image. Description of this image. . click Save in the ODI menu bar. Mapping the Load Sales Cube 1. and Cubes and Dimensions. and click OK. On the Designer tab. enter Load Sales Cube for the name. and then close the Load Customers Dimension tab. 2. In the New Mapping dialog box. OBE. 12. verify that Create Empty Dataset is deselected. expand Projects. Right-click Mappings and select New Mapping. Click Validate the Mapping. Description of this image. and ORDER_ITEMS into the mapping area. On the Designer tab. 3. . Description of this image. ORDERS. expand Models and BI_XWEEK. and then drag and drop CHANNELS. and Cubes. and then drag and drop Sales into the mapping area. next to ORDERS and ORDER_ITEMS. OBE. . In the Components palette. Description of this image. drag and drop JOIN into the mapping area.4. Expand Dimensions and Cubes. 5. ID = ORDER_ITEMS.ORDER_ID appears in the Join Condition field. Drag and drop the following into JOIN: ID (ORDERS) and ORDER_ID (ORDER_ITEMS). Description of this image. In the JOIN - Properties pane. . 6. verify that ORDERS. .NAME. 7. Verify that the join condition shows ORDERS. Description of this image. In the Components palette.CHANNEL = CHANNELS. Drag and drop the following into JOIN1: CHANNEL (ORDERS) and NAME (CHANNELS). drag and drop JOIN next to CHANNELS and ORDERS. .Cost. Description of this image.Quantity are done for you automatically. The mappings for Sales. andSales. click OK. Sales. In the Attribute Mapping dialog box. 8. Create a link between JOIN1 and Sales.Amount. Map the following source attributes to the specified target attributes in the Sales cube object: Source Model Source Attribute Target Attribute ORDERS ORDER_FINISHED Times_End_Date CHANNELS ID Channels_Natural_Key ORDER_ITEMS PRODUCT_ID Products_Natural_Key ORDERS PROMOTION_ID Promtions_Natural_Key ORDERS CUSTOMER_ID Customer_Natural_Key 10. Your mapping should look similar to the following image: . Description of this image. 9. 11. Description of this image. 12. Click the Physical tab and review the physical mapping. . expand Projects. OBE. and then close the Load Sales Cube tab. 13. Description of this image. Double-click Load Sales Cube. Cubes and Dimensions. . and Packages. Editing the Load Sales Cube Package 1. click Save in the ODI menu bar. Click Validate the Mapping. On the Designer tab. 7. If your session wasn't successful. . 6. 5. Description of this image. Repeat steps 2 and 3 for Load Sales Cube to creat a link between Load Customers Dimension and Load Sales Cube. and then create a link between Load Products Dimension and Load Customers Dimension. After the information dialog box indicates that the session has started. 2. In the package menu bar. 4. double-click the failed session to view the associated error messages. and then drag and drop Load Customers Dimension into the Load Sales Cube package. expand Session List. click OK. In the Run dialog box. Date. Expand Mappings. click OK. 3. Description of this image. and Today. Locate your session and verify that the session was successful (a green check mark appears next to each task). Description of this image. Click Next Step on Success. On the Operator tab. click Execute the Package. . 2). STATUS_FLAG VARCHAR2(1 BYTE).ODI 12c SCD Type 2 Step by Step Implementation ODI 12c SCD Type 2 is very easy compare to ODI 11G.0). ENDING_DATE DATE ) TABLESPACE SYSTEM . . FIRST_NAME VARCHAR2(20 BYTE).0). PHONE_NUMBER VARCHAR2(20 BYTE). LAST_NAME VARCHAR2(25 BYTE) NOT NULL ENABLE. CREATE TABLE DEV. COMMISSION_PCT NUMBER(2. EMAIL VARCHAR2(25 BYTE) NOT NULL ENABLE. STARTING_DATE DATE. DEPARTMENT_ID NUMBER(4.2). JOB_ID VARCHAR2(10 BYTE) NOT NULL ENABLE.0). SALARY NUMBER(8. Step1: ------ Import IKM Oracle Slowly Changing Dimension Knowledge module. Please find the below steps for SCD Type 2 implementation. MANAGER_ID NUMBER(6. HIRE_DATE DATE NOT NULL ENABLE.SCD ( EMPLOYEE_ID NUMBER(6. I have created new target table to support SCD behaviour. Step2: -------- Open Target SCD table and Change the SCD Behavior. . .I have select SCD Behavior like below options. Step3: ------- Creating Mapping for Loading the data from Source table (hr.scd). .employees) table to target table (dev. . These three columns we are not receiving from Source . we need to map at direct target table . I have done mapping STATUS_FLAG=1 ( Default Active-1, Inactive-0), STARTING_DATE=SYSDATE , ENDING_DATE = SYSDATE( But it will take default value from IKM SCD as 01-01-2400. Selecting LKM SQL to SQL Knowledge module in Physical Tab Selecting IKM Oracle Slowly Changing Dimension Knowledge Module .Selecting CKM SQL knowledge module for Data Quality validation at I$table. .Running Interface using Run button in Top Menu Target table is empty as of now there is not records in target SCD table. Program executed successfully. . We can see the status as Green . . .110 records are inserted as STATUS_FLAG=1 as New Records or active records. UPDATE hr.employees SET salary=77777 WHERE employee_id=100. Program finished successfully. COMMIT. . I have update data in source table and again i am running my mapping. . FIRST_NAME VARCHAR2(20 BYTE).ODI 12c SCD Type 2 Step by Step Implementation ODI 12c SCD Type 2 is very easy compare to ODI 11G. PHONE_NUMBER VARCHAR2(20 BYTE). JOB_ID VARCHAR2(10 BYTE) NOT NULL ENABLE. STARTING_DATE DATE. SALARY NUMBER(8. HIRE_DATE DATE NOT NULL ENABLE. EMAIL VARCHAR2(25 BYTE) NOT NULL ENABLE. COMMISSION_PCT NUMBER(2. MANAGER_ID NUMBER(6. Please find the below steps for SCD Type 2 implementation. .0).0).2). LAST_NAME VARCHAR2(25 BYTE) NOT NULL ENABLE. CREATE TABLE DEV. DEPARTMENT_ID NUMBER(4. I have created new target table to support SCD behaviour. STATUS_FLAG VARCHAR2(1 BYTE).2). ENDING_DATE DATE ) TABLESPACE SYSTEM . Step1: ------ Import IKM Oracle Slowly Changing Dimension Knowledge module.0).SCD ( EMPLOYEE_ID NUMBER(6. . I have select SCD Behavior like below options.Step2: -------- Open Target SCD table and Change the SCD Behavior. employees) table to target table (dev.Step3: ------- Creating Mapping for Loading the data from Source table (hr. .scd). we need to map at direct target table .These three columns we are not receiving from Source . STARTING_DATE=SYSDATE .I have done mapping STATUS_FLAG=1 ( Default Active-1. Inactive-0). . ENDING_DATE = SYSDATE( But it will take default value from IKM SCD as 01-01-2400. Selecting LKM SQL to SQL Knowledge module in Physical Tab Selecting IKM Oracle Slowly Changing Dimension Knowledge Module . Running Interface using Run button in Top Menu .Selecting CKM SQL knowledge module for Data Quality validation at I$table. Target table is empty as of now there is not records in target SCD table. We can see the status as Green . . Program executed successfully. .110 records are inserted as STATUS_FLAG=1 as New Records or active records. UPDATE hr. I have update data in source table and again i am running my mapping. . COMMIT.employees SET salary=77777 WHERE employee_id=100. One record got inserted as salary got changed it will Add row on change behavior .Program finished successfully. STATUS-FLAG=1 is active for new records.We can see the modified record inserted as new records and old record updated STATUS_FLAG=0 inactive record. .
Copyright © 2024 DOKUMEN.SITE Inc.