Upload
polish-sql-server-user-group
View
688
Download
2
Embed Size (px)
DESCRIPTION
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.
Citation preview
SQLDAY 2011 – Czwarta Doroczna Konferencja Polskiej Grupy Użytkowników SQL Server | Wrocław 18 Czerwca 2011, Ośrodek Szkolenia Państwowej Inspekcji Pracy
SPONSORZY I PARTNERZY
ŁUKASZ GRALA
Prowadzi blogi: http://powerpivot.info.pl http://sqlresearch.com Kontakt: [email protected]
SQLDAY 2011 – Czwarta Doroczna Konferencja Polskiej Grupy Użytkowników SQL Server | Wrocław 18 Czerwca 2011, Ośrodek Szkolenia Państwowej Inspekcji Pracy
Hurtownia danych (ang. Data Warehouse) – rodzaj bazy danych, która jest zorganizowana i zoptymalizowana pod kątem pewnego wycinka rzeczywistości
OLTP Hurtownie
danych OLAP
Struktury operacyjne
Struktury hurtowni danych
Dane operacyjne
Dane ujednolicone
Wybrane dane
Kostki/ struktury użytkownika
N/A
Q1
Q2
Q3
Measures Dimension
Sal
es T
errit
ory
Q4
Pacific
Europe
North America
N/A
Q1
Q2
Q3
Measures Dimension
Sal
es T
errit
ory
Q4
Pacific
Europe
North America
N/A
Q1
Q2
Q3
Measures Dimension
Sal
es T
errit
ory
Q4
Pacific
Europe
North America
N/A
Q1
Q2
Q3
Measures Dimension
Sal
es T
errit
ory
Q4
Pacific
Europe
North America
N/A
Q1
Q2
Q3
Measures Dimension
Sal
es T
errit
ory
Q4
Pacific
Europe
North America
5,005,000
Wymiar
Rejon Produkt Miesiąc Ilość Wartość
Wielkopolska Gitara Styczeń 50 25.200,00
Śląsk Gitara Styczeń 45 24.800,00
Wielkopolska Gitara Luty 12 7.580,00
Śląsk Skrzypce Styczeń 20 20.500,00
Mazowieckie Gitara Styczeń 100 50.555,00
Dolnyśląsk Skrzypce Styczeń 10 10.000,00
ID_Rejon ID_Prod Miesiąc Ilość Wartość
10 220 1 50 25.200,00
8 220 1 45 24.800,00
10 320 2 12 7.580,00
8 150 1 20 20.500,00
5 220 1 100 50.555,00
1 150 1 10 10.000,00
ID Produkt Grupa
120 Gitara Gibson Instrumenty
220 Gitara Instrumenty
320 Gitara flamenco Instrumenty
501 Struny nylonowe Akcesoria
530 Struny nylonowe Akcesoria
550 Pianino – Bach Nuty
ID Produkt Grupa Cena
120 Gitara Gibson Instrumenty 1.500,00
220 Gitara klasyczna Instrumenty 580,00
320 Gitara flamenco Instrumenty 1.100,00
501 Struny nylonowe Akcesoria 48,00
530 Struny nylonowe Akcesoria 22,00
550 Pianino – Bach Nuty 34,00
CZAS
ROK
MIESIĄC
KWARTAŁ
DZIEŃ
KLIENCI
GRUPA
CENTRALA
ODDZIAŁ
MIEJSCE
KRAJ
REGION
MIASTO
PRODUKT
GRUPA
PODGRUPA
PRODUKT
Schemat gwiazdy (ang. Star schema)
Schemat płatka śniegu (ang. Snowflake schema)
Schemat konstelacji faktów (ang. Fact Constellation schema)
Mechanizm ETL (ang Extracttion-Transformation-Load)
Data Sources
Staging Area
Manual
Cleansing
Data Marts
Data Warehouse
Client
Access
Client
Access
1: Clients need access to data 2: Clients may access data sources directly 3: Data sources can be mirrored/replicated to reduce contention 4: The data warehouse manages data for analyzing and reporting 5: Data warehouse is periodically populated from data sources 6: Staging areas may simplify the data warehouse population 7: Manual cleansing may be required to cleanse dirty data 8: Clients use various tools to query the data warehouse 9: Delivering BI enables a process of continuous business improvement
Śledzenie i zapisywanie zachodzących zmian danych w wymiarach hurtowni danych
LastName update to
Valdez-Smythe
SalesTerritoryKey update to 10
SalesTerritoryKey update to
10
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
ID Kod Imie Nazwisko Województwo Wersja
001 A001-X1 Jan Nowak Wielkopolskie 0
001 A001-X1 Jan Nowak Wielkopolskie 1
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
ID Kod Imie Nazwisko Województwo_Oryg. Woj_Aktualne
001 A001-X1 Jan Nowak Wielkopolskie Dolnośląskie
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
ID Kod Imie
Nazwisko Wojew_Akt Woj_Hist Data_Start Data_End Aktualne
001 AX1 Jan Nowak Wielkopolskie Dolnośląskie 2010-12-12 2011-06-15 N
1. Select the target dimension table
2. Configure the relationship between the source data and the dimension table
Step 1
1. Select the participating columns and their change type:
− Fixed (Type 0)
− Changing (Type 1)
− Historical (Type 2)
Step 2
1. Configure the behavior if Fixed attributes change
2. Configure whether Changing attributes should update the current record or all matching records
Step 3
1. Configure how Historical attributes identify current and expired records:
− Single Boolean column, or
− Start and End date columns
Step 4
Łukasz Grala – [email protected]
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
Step 5
Łukasz Grala – [email protected]
• Based on your configuration, the wizard completes the downstream data flow
Wizard Output
Łukasz Grala – [email protected]
SQLDAY 2011 – Czwarta Doroczna Konferencja Polskiej Grupy Użytkowników SQL Server | Wrocław 18 Czerwca 2011, Ośrodek Szkolenia Państwowej Inspekcji Pracy
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
SPONSORZY I PARTNERZY