Professional Documents
Culture Documents
Agenda
1
2 3 4
Contd
Source System can be any application or data store that creates or stores data and acts as a data source to other systems. Will cover this topic in details later. Automation is critical without which the very purpose of ETL will be defeated. ETL is no good if processes need to be manually scheduled, executed or manually monitored. Extraction is first major step in physical implementation of ETL. Extraction initiates or triggers further downstream processes. Needless to say, once data is extracted it has to be hauled and transported to target, because the physical location of the source system might be different from the target warehouse. Data Cleansing is very essential as the data pulled from various source systems can have some unwanted data, unprintable characters, extra blank spaces, etc. This might cause some absurd result while loading the data into the Data warehouse.
Contd
Transformation is the series of tasks that prepares the data for loading into the warehouse. Once data is secured, you have worry about its format or structure. Because it will be not be in the format needed for the target. Example the grain level, data type, might be different. Data cannot be used as it is. Some rules and functions need to be applied to transform the data. One of the purposes of ETL is to consolidate the data in a central repository or to bring it at one logical or physical place. Data can be consolidated from similar systems, different subject areas, etc. ETL must support data integration for the data coming from multiple sources and data coming at different times. This has to be seamless operation. This will avoid overwriting existing data, creating duplicate data or even worst simply unable to load the data in the target.
Contd
Loading part of the process is critical to integration and consolidation. Loading process decides the modality of how the data is added in the warehouse or simply rejected. Methods like addition, Updating or deleting are executed at this step. What happens to the existing data? Should the old data be deleted because of new information? Or should the data be archived? Should the data be treated as additional data to the existing one? Data should be loaded with lots of care. Does that that means data loaded in the Warehouse is incorrect? What is the confidence level in the data? A data auditing process can only establish the confidence level. This auditing process normally happens after the loading of data.
CONTD
A generic pictorial representation of ETL Process :
SOURCE SYSTEMS
SAP RDBMS Oracle SQL Server DB2 Teradata FLAT FILES .TSV .TXT .CSV MS-ACCESS .MDB Temporary Storage
10
TARGET SYSTEMS
RDBMS Oracle Teradata SQL Server FLAT FILE
11
12
13
CONTD
14
15
Creation of DSN
Step1: Go to START RUN. Type odbcad32 and click OK. Step2: An ODBC Data Source Administrator will open in which, select system DSN and Click ADD button. Another window create a new data source will open.
16
Contd
Step3: Select SQL SERVER or Microsoft ODBC for Oracle from the list. Click OK. A small window will open
17
CONTD
Step4: Enter any name in Data Source Name text field. Enter your User Name for that data base. Enter the name of the server as such given in tns.ora file. Click ok
18
19
20
CONTD
Executing the Source Query in PL/SQL Developer
21
CONTD
Executing the Target Query in PL/SQL Developer
22
23
CONTD
Using MINUS
Select * From (SELECT VNDR_KEY, NVL2(STR_ADDR,ltrim(rtrim(STR_ADDR), NVL2(PO_BOX,'PO Box'||' '||ltrim(rtrim(PO_BOX)),ltrim(rtrim(STR_ADDR)))) FROM DW_R0001_T.VNDR V WHERE VNDR_KEY >= '0000100000' AND VNDR_KEY < '0000400000' AND DEL_F is NULL Order by VNDR_KEY) SRC_VALUE MINUS Select * From (SELECT VNDR_NUM, STR_ADDR FROM AMB_CARE_T.MSS_VENDOR_MAST_STG Order BY VNDR_NUM) TGT_VALUE
24
CONTD
Using Full Outer Join
Select SRC.VNDR_KEY AS SRC_VNDR_KEY, TGT.VNDR_NUM AS TGT_VNDR_NUM, SRC. STR_ADDR AS SRC_ STR_ADDR, TGT. STR_ADDR AS TGT_ STR_ADDR From (SELECT VNDR_KEY, NVL2(STR_ADDR,ltrim(rtrim(STR_ADDR), NVL2(PO_BOX,'PO Box'||' '||ltrim(rtrim(PO_BOX)),ltrim(rtrim(STR_ADDR)))) AS STR_ADDR FROM DW_R0001_T.VNDR V WHERE VNDR_KEY >= '0000100000' AND VNDR_KEY < '0000400000' AND DEL_F is NULL Order by VNDR_KEY) SRC FULL OUTER JOIN Select * From (SELECT VNDR_NUM, STR_ADDR FROM AMB_CARE_T.MSS_VENDOR_MAST_STG Order BY VNDR_NUM) TGT ON ltrim(rtrim(SRC.VNDR_KEY)) = TGT.VNDR_NUM OR (ltrim(rtrim(SRC.VNDR_KEY) ) IS NULL AND TGT.VNDR_NUM IS NULL) AND ltrim(rtrim(SRC. STR_ADDR) ) = TGT. STR_ADDR OR (ltrim(rtrim(SRC. STR_ADDR) ) IS NULL AND TGT. STR_ADDR IS NULL)
25 2009 Wipro Ltd - Confidential
CONTD
Case-2: Source: RDBMS\Flat file Target: SQL Server Other Tools: Edit Plus, Beyond Compare, VIM Editor
26
27
CONTD
Step2: A window named Import will open. In that select ODBC Data Sources from the drop down list of Files of Type combo box. Click ok
28
CONTD
Step3:Select Data Source window will open. Select Machine Data Source tab. Select the name of the data source, from which you want to import a table. Click Ok
29
CONTD
Step4: A login window will open. Enter your login credentials for that database. Click ok.
30
CONTD
Step5: A window name Import Objects will open. Select the table from the list. Click OK and the table will start getting imported into MS_ACCESS..
31
CONTD
Select the appropriate radio button based on whether the text file is delimited or fixed width
33
CONTD
Select proper radio button based on the type of delimitation of the flat file. For flat files having the column names as first record, select the check box-First Row Contains Field Names
34
CONTD
Select new table
35
CONTD
Click on individual columns and give the name and data type of the field in the designated text fields. Click Finish once you are done and the table will be imported
36
37
CONTD
Step2: Select ODBC Databases from the save as type combo box. A small window with a table name text field will open. You may keep the table name as it is or rename it by entering the desired table name in the text field. Click OK.
38
CONTD
39
CONTD
Step3: A Select Data Source window will open. Go to machine data source tab and select the sql server database DSN name from the available list, and click OK and the table will start getting transferred from MS ACCESS to Sql Server.
Step4: Login into Sql server and refresh the database to which you have exported a table. Now you will find the table in sql server.
40 2009 Wipro Ltd - Confidential
CONTD
Using Full Outer Join
Select SRC.VNDR_KEY AS SRC_VNDR_KEY, TGT.VNDR_NUM AS TGT_VNDR_NUM, SRC. STR_ADDR AS SRC_ STR_ADDR, TGT. STR_ADDR AS TGT_ STR_ADDR From (SELECT VNDR_KEY, NVL2(STR_ADDR,ltrim(rtrim(STR_ADDR)), NVL2(PO_BOX,'PO Box'||' '||ltrim(rtrim(PO_BOX)),ltrim(rtrim(STR_ADDR)))) AS STR_ADDR FROM DW_R0001_T.VNDR V WHERE VNDR_KEY >= '0000100000' AND VNDR_KEY < '0000400000' AND DEL_F is NULL Order by VNDR_KEY) SRC FULL OUTER JOIN Select * From (SELECT VNDR_NUM, STR_ADDR FROM AMB_CARE_T.MSS_VENDOR_MAST_STG Order BY VNDR_NUM) TGT ON ltrim(rtrim(SRC.VNDR_KEY)) = TGT.VNDR_NUM OR (ltrim(rtrim(SRC.VNDR_KEY)) IS NULL AND TGT.VNDR_NUM IS NULL) AND ltrim(rtrim(SRC. STR_ADDR)) = TGT. STR_ADDR OR (ltrim(rtrim(SRC. STR_ADDR)) IS NULL AND TGT. STR_ADDR IS NULL)
42 2009 Wipro Ltd - Confidential
CONTD
Case-3: Source: SAP Target: Oracle Other Tools: Edit Plus, Beyond Compare, VIM Editor
43
CONTD
Login Screen :
44
CONTD
Querying for the table you need to fetch data from:
45
CONTD
Finding the total number of records in the table:
46
CONTD
Choosing the fields to be displayed:
47
CONTD
By Default all the fields will be checked
48
CONTD
Uncheck the fields which are not required:
49
CONTD
Number of rows and columns to be fetched:
50
CONTD
Displaying the output:
51
CONTD
Selecting the records:
52
CONTD
Downloading or Exporting data from SAP:
53
CONTD
Selecting the format of the downloaded data:
Note: If the result set is more than 65535 records then the data can be saved as Unconverted format and it will get saved as a .txt file
54 2009 Wipro Ltd - Confidential
CONTD
Selecting the location for saving the downloaded data:
55
CONTD
Downloaded data displayed in spreadsheet format:
56
57
Q&A
QUESTIONS ??
58