Designing data warehouses must be designed dimensions. In such a way as to effectively use them later posed analytical realizing business objectives and what is more properly supplied with current data. How does it do? How to design dimensions in order to analyze the changes. Does the use of normalization – 6 normal form will help solve this problem, may be better used for this purpose Slowly Changing Dimension familiar with the publication of Ralph Kimball? If so, what type of SCD would be the best for our business needs? All of these topics during the session will bring an experienced consultant and trainer, SQL Server MVP – Łukasz Grala.
1. SQLDAY 2011 – Czwarta Doroczna Konferencja Polskiej Grupy Użytkowników SQL Server
| Wrocław 18 Czerwca 2011, Ośrodek Szkolenia Państwowej Inspekcji Pracy
4. SQLDAY 2011 – Czwarta Doroczna Konferencja Polskiej Grupy Użytkowników SQL Server
| Wrocław 18 Czerwca 2011, Ośrodek Szkolenia Państwowej Inspekcji Pracy
5. Hurtownia danych (ang. Data Warehouse) – rodzaj bazy danych,
która jest zorganizowana i zoptymalizowana pod kątem pewnego
wycinka rzeczywistości
6. Hurtownie
OLTP OLAP
danych
Struktury Struktury Kostki/ struktury
operacyjne hurtowni danych użytkownika
Dane Dane Wybrane
operacyjne ujednolicone dane
7. 5,005,000
Q1
Q2
N/A
Q3 Pacific
ry
to
r ri
Europe
Te
s
le
Q4 North America
Sa
Measures Dimension
9. Rejon Produkt Miesiąc Ilość Wartość
Wielkopolska Gitara Styczeń 50 25.200,00
ŚląskID_Rejon Gitara
ID_Prod Miesiąc
Styczeń Ilość
45 Wartość
24.800,00
Wielkopolska Gitara 220 Luty
10 1 12 50 25.200,00
7.580,00
Śląsk 8 220
Skrzypce Styczeń 1 20 45 24.800,00
20.500,00
10
Mazowieckie Gitara 320 Styczeń 2 100 12 7.580,00
50.555,00
Dolnyśląsk 8 150
Skrzypce Styczeń 1 10 20 20.500,00
10.000,00
5 220 1 100 50.555,00
1 150 1 10 10.000,00
10. ID Produkt Grupa
120 Gitara Gibson Instrumenty
220 ID Produkt
Gitara Grupa
Instrumenty Cena
320 120 Gitara Gibson Instrumenty
Gitara flamenco Instrumenty 1.500,00
501 220 Gitara klasyczna Instrumenty
Struny nylonowe Akcesoria 580,00
530 320 Gitara flamenco Instrumenty
Struny nylonowe Akcesoria 1.100,00
550 501 Struny nylonowe
Pianino – Bach Nuty Akcesoria 48,00
530 Struny nylonowe Akcesoria 22,00
550 Pianino – Bach Nuty 34,00
11. CZAS KLIENCI MIEJSCE PRODUKT
ROK GRUPA KRAJ GRUPA
MIESIĄC CENTRALA REGION PODGRUPA
KWARTAŁ ODDZIAŁ MIASTO PRODUKT
DZIEŃ
16. 6: Delivering enables data
5: ManualuseBI canismayabeto query the data warehouse
4: Stagingmayvariousdata process populated from population
1: Clients needaccess simplify thedata to cleanse dirty dataimprovement
9:
8:
7: warehouse beto sources of continuous business
3: The sourcesaccessperiodicallydatafor analyzing andsources
2: Datadata warehousemirrored/replicated to reduce contention
areas may tools required warehouse data reporting
cleansing manages directly
Data Sources Data Warehouse
Data Marts
Staging Area
Client
Access
Manual Client
Cleansing Access
22. ID_Handlowca Kod_Hand Imie Nazwisko Województwo
001 A001-X1 Jan Nowak Wielkopolskie
ID_Handlowca Kod_Hand Imie Nazwisko Województwo
001 A001-X1 Jan Nowak Dolnośląskie
23. ID Kod Imie Nazwisko Województwo Wersja
001 A001-X1 Jan Nowak Wielkopolskie 0
001 A001-X1 Jan Nowak Wielkopolskie 1
24. ID Kod Imie Nazwisko Województwo Data_Start Data_End
001 A001-X1 Jan Nowak Wielkopolskie 2010-12-12 2011-06-15
001 A001-X1 Jan Nowak Wielkopolskie 2010-12-12 NULL
25. ID Kod Imie Nazwisko Województwo_Oryg. Woj_Aktualne
001 A001-X1 Jan Nowak Wielkopolskie Dolnośląskie
26. ID_Handlowca Kod_Hand Imie Nazwisko Województwo
001 A001-X1 Jan Nowak Dolnośląskie
ID_Handlowca Kod_Hand Imie Nazwisko Województwo
001 A001-X1 Jan Nowak Wielkopolskie
27. ID Kod Imi Nazwisko Wojew_Akt Woj_Hist Data_Start Data_End Aktualne
e
001 AX1 Jan Nowak Wielkopolskie Dolnośląskie 2010-12-12 2011-06-15 N
28. Step 1
1. Select the target
dimension table
2. Configure the
relationship between the
source data and the
dimension table
29. Step 2
1. Select the
participating columns
and their change
type:
− Fixed (Type 0)
− Changing (Type 1)
− Historical (Type 2)
30. Step 3
1. Configure the
behavior if Fixed
attributes change
2. Configure whether
Changing attributes
should update the
current record or all
matching records
31. Step 4
1. Configure how
Historical attributes
identify current and
expired records:
− Single Boolean
column, or
− Start and End date
columns
ŁukaszGrala–lukasz@grala.biz
32. Step 5
1. If inferred members
are stored in the
dimension table,
define how they are
identified:
− When all columns
with a change type
are null, or
− By a single Boolean
column
ŁukaszGrala–lukasz@grala.biz
33. Wizard Output
• Based on your
configuration, the
wizard completes the
downstream data flow
ŁukaszGrala–lukasz@grala.biz
34.
35.
36.
37. Lubię to!
SQLDAY 2011 – Czwarta Doroczna Konferencja Polskiej Grupy Użytkowników SQL Server
| Wrocław 18 Czerwca 2011, Ośrodek Szkolenia Państwowej Inspekcji Pracy
38. SQLDAY 2011 – Czwarta Doroczna Konferencja Polskiej Grupy Użytkowników SQL Server
| Wrocław 18 Czerwca 2011, Ośrodek Szkolenia Państwowej Inspekcji Pracy