0% found this document useful (0 votes)
25 views14 pages

SCD Type 2mock Test

scd

Uploaded by

LEE CHONG MIN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views14 pages

SCD Type 2mock Test

scd

Uploaded by

LEE CHONG MIN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Oracle Data Integrator (ODI) 12C Mock task

Vision Technology Consulting

Json Lee Chong Min


Slowly Changing dimension type 2 mock task

ETT mapping – load file to ETT table, table name ETT_ISS_INVESTOR

1. firstly, download the requested file and extract the file to begin utilizing it. The file
can be then moved to the ODI directory for easier access. The directory depends
on the physical schema created for the file technology in th ODI to determine where
you should place the file at. For example,
C:\Oracle\Middleware\Oracle_Home\odi\demo\file.

2. Next, create a model to store the file data store and reverse engineer the text file in
the odi. The technology and logical schema must follow accordingly to the one
created and specify the file technology as this step is to extract the information from
the text file.

Create a new datastore by right clicking on the model and choose the new
datastore. Enter the name, data store type and resource name. The resource name
can use the search utility to browse for the file required to reverse engineer
next, in the files tab is the settings and identifiers to provide more information about the file
format, headings and field separator for the ODI to reverse engineer the file. Therefore,
the file acquired is in a delimited file format which is separated by a pipe symbol while the
heading will be until the 2nd line.

After setting up the file settings, we can proceed to the attributes tab in the left to begin the
reverse engineer process. After initiating the process it will begin acquiring the fields and
records from the file accordingly. Therefore, the file reversed engineered will be the source
file for the mapping process.
3. next step, create a database table in the hr schema in the sql developer with the given
data dictionary attached for reference. The datastore is going to be the targeted table for
the mapping process to initiate.

After creating the table in the database go to the model and reverse engineer the table.
After reverse engineering the specific data table it will appear in the model section in the
left ready to be utilized

4. the forth step is to create a mapping to integrate the flat file into the relational table
by using the KM IKM append SQL to file. In the mapping area drag out the flat file
from the extracted text file and the relational target table created from the sql
developer and map it together

in the physical structure, the LKM must be in SQL to oracle (Built-in). Oracle while the final
target table will be IKM oracle insert Global.
Testing

to ensure the mapping process of the flat file to table works successfully. We can check
the table whether it is populated with new rows of record similarly in the flat file to comfirm
success.

We can see that there is a total of 149 rows of record in the targeted table after the
integration which is similar to the flat fil. Therefore, the mapping integration is successfull.
SCD mapping – load ETT records to final table using SCD type 2, table name
ISS_INVESTOR

1. create an identical data store table with similar fields and columns as the ETT records
with new columns that represent the new SCD type 2 table.

DWH_ID = Surrogate Key


CURRENT_FLAG = Current Record Flag
START_DATE = Starting Timestamp
END_DATE = Ending Timestamp

after creating the datastore table, the OLAP type must be changed into slowly changing
dimensions while also entering the name and datastore type

Once created, reverse engineer the table into the ODI oracle and set the SCD behaviour
to its specified function such as

Surrogate key DWH_ID


Natural key INVESTOR_ID
Current flag record CURRENT_FLAG
Starting timestamp START_DATE
Ending timestamp END_DATE
Add row on change Other fields
2. After completing the new columns for the SCD type 2 table. The mapping process can
begin to construct. First, drag the src table which is the ETT_ISS_INVESTOR table from
the first task and drag the second table ISS_INVESTOR with the new SCD rows as the
target table.

Next, in the target table ISS_INVESTOR. The new columns of the field should append with
their own designated value. Morever, the first surrogate key for DWH_ID in the value must
put a sequence value inside. Create sequence value by going to the left tab and create
one with the selection of native sequence. The native sequence name can be created as a
table in the database by typing this SQL query

= CREATE SEQUENCE SEQ_INVESTOR INCREMENT BY 1 MAXVALUE 999999


MINVALUE 1 CACHE 20;

then the native sequence name can be browsed with the manifying glass
furthermore, the current flag column can put the value 1 in to represent active and 0 to
represent not active. Other than that, the start date will put in the sysdate function to
retrieve the ODI current date and time set for the operating system and the end date is
similar too. Next, the filter component is set up to ensure only RECTYPE with 'L' is only
accepted in the targeted table. Lastly the hint will be change to target.

DWH_ID :MAPPING1.SEQ_SCD_INVESTOR_NEXTVAL
CURRENT_FLAG 1
START_DATE SYSDATE
END_DATE SYSDATE
Next, for the integration type of the final target table must be change to slowly changing
dimension to ensure the KM is working as intended. After that, the mapping process can
run.

TESTING

To test whether the SCD Type 2 is successfully we can check back on the operations tab
to ensure all the process is carried out succesfully
Moreover, another test is to check on the ISS_INVESTOR table in sql developer to ensure
the data data is populated correctly with the new SCD columns intact

Other than that, to ensure the SCD is working as expected. The data table record for
investor_id of '000000001570-3307' the INPUTTER and CENTRE field is changed
accordingly to test out the SCD capabilities.
INPUTTER = Azlee -> Azman
CENTRE = HQKL -> HCBK

after running the SCD mapping again the results obtained will be showned. The first
example is the changed INPUTTER azlee to azman which the new record is define as 1 in
the current flag as latest record with the end date with the longest.
Next will be the CENTRE colmn whereby the value of HQKL is switch to HCBK

You might also like