Download Slide_DM_02_DW_Olap

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Pertemuan-2
Pengantar
Data
Warehouse
dan OLAP
Agenda
•
•
•
•
•
Pengertian data warehouse
Model data multidimensi
Operasioperasi dalam OLAP
Arsitektur data warehouse
Kegunaan data warehouse
Apa itu Data Warehousing?
• Data warehouse adalah koleksi dari data yang
subjectoriented, terintegrasi, timevariant, dan
nonvolatile, dalam mendukung proses pembuatan
keputusan.
• Sering diintegrasikan dengan berbagai sistem
aplikasi untuk mendukung pemrosesan informasi
dan analisis data dengan menyediakan platform
untuk historical data.
• Data warehousing: proses konstruksi dan
penggunaan data warehouse.
Data warehouse subject oriented
• Data warehouse diorganisasikan di seputar subjek
subjek utama seperti customer, produk, sales.
• Fokus pada pemodelan dan analisis data untuk
pembuatan keputusan, bukan pada operasi harian
atau pemrosesan transaksi.
• Menyediakan sebuah tinjauan sederhana dan ringkas
seputar subjek tertentu dengan tidak
mengikutsertakan data yang tidak berguna dalam
proses pembuatan keputusan.
Data warehouse subject oriented
• Subjek
• Aplikasi
Data warehouse terintegrasi
• Dikonstruksi dengan mengintegrasikan banyak
sumber data yang heterogen.
– relational database, flat file, online transaction
record
• Teknik data cleaning dan data integration
digunakan
– Untuk menjamin konsistensi dalam konvensi
konvensi penamaan, struktur pengkodean, ukuran
ukuran atribut dll diantara sumber data yang
berbeda.
• Contoh: Hotel price: currency, tax, breakfast
covered, dll.
– Data dikonversi ketika dipindahkan ke warehouse.
Data warehouse terintegrasi
Data warehouse terintegrasi
Data perlu distandarkan :
Sales
Inventori
Transaksi Penjualan
Format
Key:
Text
Key:
Integer
Key:
Yes/No
Description
Nama pelanggan:
U.P.N.
Nama pelanggan:
UPN
Unit
Tinggi:
centimeter
Tinggi:
Meter
Nama pelanggan:
Universitas Pembangunan
Nasional
Tinggi:
Inch
Encoding
Sex:
Yes = Laki-laki
No = Perempuan
Sex:
L = laki-laki
P = Perempuan
Sex:
1 = Laki-laki
0 = Perempuan
Data Warehouse—Time Variant
• Data disimpan untuk menyediakan
informasi dari perspektif historical, contoh
510 tahun yang lalu.
• Struktur kunci dalam data warehouse
– Mengandung sebuah elemen waktu, baik secara
ekspisit atau secara implisit.
– Tetapi kunci dari data operasional bisa
mengandung elemen waktu atau tidak.
Data Warehouse — NonVolatile
• Data warehouse adalah penyimpanan data yang
terpisah secara fisik yang ditransformasikan dari
lingkungan operasional.
• Data warehouse tidak memerlukan pemrosesan
transaksi, recovery dan mekanisme kontrol
konkurensi.
• Biasanya hanya memerlukan dua operasi dalam
pengaksesan data, yaitu initial loading of data dan
access of data.
Data Warehouse — NonVolatile
OLAP (online analitical processing)
• OLAP adalah operasi basis data untuk
mendapatkan data dalam bentuk kesimpulan
dengan menggunakan agregasi sebagai
mekanisme utama.
• Ada 3 tipe:
– Relational OLAP (ROLAP):
– Multidimensional OLAP (MOLAP)
– Hybrid OLAP (HOLAP) membagi data antara tabel
relasional dan tempat penyimpanan khusus.
Data Warehouse vs. Operational DBMS
• OLTP (online transaction processing)
– Major task of traditional relational DBMS
– Daytoday operations: purchasing, inventory, banking,
manufacturing, payroll, registration, accounting, etc.
• OLAP (online analytical processing)
– Major task of data warehouse system
– Data analysis and decision making
• Distinct features (OLTP vs. OLAP):
– User and system orientation: customer vs. market
– Data contents: current, detailed vs. historical, consolidated
– Database design: ER + application vs. star + subject
– View: current, local vs. evolutionary, integrated
– Access patterns: update vs. readonly but complex queries
OLTP vs. OLAP
OLTP
OLAP
users
clerk, IT professional
knowledge worker
function
day to day operations
decision support
DB design
applicationoriented
subjectoriented
data
historical,
summarized, multidimensional
integrated, consolidated
adhoc
lots of scans
# records accessed
current, uptodate
detailed, flat relational
isolated
repetitive
read/write
index/hash on prim. key
short, simple transaction
tens
#users
thousands
hundreds
DB size
100MBGB
100GBTB
usage
access
unit of work
complex query
millions
Dari tabel dan spreadsheet
ke Kubus Data
•
Data warehouse didasarkan pada model data multidimensional,
dimana data dipandang dalam bentuk kubus data
•
Kubus data, seperti sales, memungkinkan data dipandang dan
dimodelkan dalam banyak dimensi
– Tabel dimensi, seperti item (item_name, brand, type), or time(day, week,
month, quarter, year)
– Tabel fakta mengandung measures (seperti dollars_sold) dan merupakan
kunci untuk setiap tabeltabel dimensi terkait.
•
nD base cube dinamakan base cuboid. 0D cuboid merupakan
cuboid pada level paling tinggi, yang menampung ringkasan data dalan
level paling tinggi, dinamakan apex cuboid. Lattice dari cuboidcuboid
membentuk sebuah data cube.
Cube: A Lattice of
Cuboids
all
time
time,item
0D(apex) cuboid
item
time,location
location supplier
item,location
time,supplier
time,item,location
location,supplier
item,supplier
time,location,supplier
time,item,supplier
1D cuboids
2D cuboids
3D cuboids
item,location,supplier
4D(base) cuboid
time, item, location, supplier
Pemodelan Konseptual Data Warehouse
• Star schema: Sebuah tabel fakta di tengahtengah
dihubungkan dengan sekumpulan tabeltabel dimensi.
• Snowflake schema: perbaikan dari skema star ketika
hirarki dimensional dinormalisasi ke dalam sekumpulan
tabeltabel dimensi yang lebih kecil
• Fact constellations: Beberapa tabel fakta dihubungkan ke
tabeltabel dimensi yang sama, dipandang sebagai
kumpulan dari skema star, sehingga dinamakan skema
galaksi atau fact constellation.
Contoh Skema Star
time
item
time_key
day
day_of_the_week
month
quarter
year
Sales Fact Table
time_key
item_key
branch_key
branch
branch_key
branch_name
branch_type
location_key
units_sold
dollars_sold
avg_sales
Measures
item_key
item_name
brand
type
supplier_type
location
location_key
street
city
province_or_street
country
Contoh skema Snowflake
time
time_key
day
day_of_the_week
month
quarter
year
item
Sales Fact Table
time_key
item_key
branch_key
branch
branch_key
branch_name
branch_type
location_key
units_sold
dollars_sold
avg_sales
Measures
item_key
item_name
brand
type
supplier_key
supplier
supplier_key
supplier_type
location
location_key
street
city_key
city
city_key
city
province_or_stree
country
Contoh Fact Constellation
time
time_key
day
day_of_the_week
month
quarter
year
item
Sales Fact Table
time_key
item_key
item_key
item_name
brand
type
supplier_type
location_key
branch_key
branch_name
branch_type
units_sold
dollars_sold
avg_sales
Measures
time_key
item_key
shipper_key
from_location
branch_key
branch
Shipping Fact Table
location
location_key
street
city
province_or_street
country
to_location
dollars_cost
units_shipped
shipper
shipper_key
shipper_name
location_key
shipper_type
Hirarki Konsep: Dimensi (Lokasi)
all
all
Europe
region
country
city
office
Germany ...
Frankfurt
...
...
Spain
North_America
Canada
Vancouver ...
L. Chan
...
...
Mexico
Toronto
M. Wind
Tampilan datawarehouse dan
hirarki
Specification of hierarchies
• Schema hierarchy
day < {month < quarter;
week} < year
• Set_grouping hierarchy
{1..10} < inexpensive
Data Multidimensional
• Sales volume sebagai fungsi dari product,
month, dan region
Dimension: Product, Location, Time
Hierarchical summarization paths
on
gi
Re
Industry Region
Year
Category Country Quarter
Product
Product
City
Office
Month
Month
Day
Week
Contoh Kubus Data
t
uc
od
Pr
TV
PC
VCR
sum
1Qtr
2Qtr
Date
3Qtr
4Qtr
Total annual sales
sum of TV in U.S.A.
U.S.A
Canada
Mexico
sum
Country
Cuboid yang terkait dengan
kubus
all
product
product,date
date
0D(apex) cuboid
country
product,country
1D cuboids
date, country
2D cuboids
product, date, country
3D(base) cuboid
Browsing kubus data
• Visualization
• OLAP capabilities
• Interactive manipulation
Operasioperasi OLAP
•
Roll up (drillup): summarize data
– by climbing up hierarchy or by dimension reduction
•
Drill down (roll down): reverse of rollup
– from higher level summary to lower level summary or detailed
data, or introducing new dimensions
•
Slice and dice:
– project and select
•
Pivot (rotate):
– reorient the cube, visualization, 3D to series of 2D planes.
Operasioperasi OLAP
Contoh Tabel Pivoting
Rasa
Sirup
Biasa
Rendah
Kalori
Total
Strawberry Mangga
Nanas
Total
3.500.000 1.750.000
500.000 5.750.000
2.300.000 1.500.000
5.800.000 3.250.000
250.000 4.050.000
750.000 9.800.000
Sirup
Biasa
Biasa
Biasa
Rendah Kalori
Rendah Kalori
Rendah Kalori
Rasa
Strawberry
Mangga
Nanas
Strawberry
Mangga
Nanas
Pendapatan
3.500.000
1.750.000
500.000
2.300.000
1.500.000
250.000
Hierarki Dimensi untuk
Roll-up/Drill-down
Nama Hari
Tahun
Wilayah
Triwulan
Negara
Bulan
Provinsi
Kota
Tanggal
Kecamatan
(a) Hierarki Waktu
(b) Hierarki Lokasi
Rancangan Data Warehouse: Business
Analysis Framework
• Four views regarding the design of a data warehouse
– Topdown view
• memungkinkan pemilihan informasi yang relevan yang diperlukan
untuk data warehouse
– Data source view
• memperlihatkan informasi yang diambil, disimpan, dan
dikelola oleh sistem operasional
– Data warehouse view
• terdiri dari tabel fakta dan tabel dimensi
– Business query view
• melihat perspektif data di gudang dari sudut pandang pengguna
akhir
Proses Perancangan Data Warehouse
• Topdown, bottomup approaches or a combination of both
– Topdown: Starts with overall design and planning (mature)
– Bottomup: Starts with experiments and prototypes (rapid)
• From software engineering point of view
– Waterfall: structured and systematic analysis at each step before
proceeding to the next
– Spiral: rapid generation of increasingly functional systems, short
turn around time, quick turn around
• Typical data warehouse design process
– Choose a business process to model, e.g., orders, invoices, etc.
– Choose the grain (atomic level of data) of the business process
– Choose the dimensions that will apply to each fact table record
– Choose the measure that will populate each fact table record
MultiTiered Architecture
Metadata
other
source
s
Operational
DBs
Extract
Transform
Load
Refresh
Monitor
&
Integrator
Data
Warehouse
OLAP Server
Serve
Analysis
Query
Reports
Data mining
Data Marts
Data Sources
Data Storage
OLAP Engine FrontEnd Tools
Data Warehouse BackEnd Tools and
Utilities
• Data extraction:
– get data from multiple, heterogeneous, and external sources
• Data cleaning:
– detect errors in the data and rectify them when possible
• Data transformation:
– convert data from legacy or host format to warehouse format
• Load:
– sort, summarize, consolidate, compute views, check integrity,
and build indicies and partitions
• Refresh
– propagate the updates from the data sources to the warehouse
Three Data Warehouse
Models
• Enterprise warehouse
– collects all of the information about subjects spanning the entire
organization
• Data Mart
– a subset of corporatewide data that is of value to a specific
groups of users. Its scope is confined to specific, selected
groups, such as marketing data mart
• Independent vs. dependent (directly from warehouse) data mart
• Virtual warehouse
– A set of views over operational databases
– Only some of the possible summary views may be materialized
Data Warehouse Development: A
Recommended Approach
MultiTier Data
Warehouse
Distributed
Data Marts
Data
Mart
Data
Mart
Model refinement
Enterprise
Data
Warehouse
Model refinement
Define a highlevel corporate data model
OLAP Server Architectures
• Relational OLAP (ROLAP)
– Use relational or extendedrelational DBMS to store and manage
warehouse data and OLAP middle ware to support missing pieces
– Include optimization of DBMS backend, implementation of
aggregation navigation logic, and additional tools and services
– greater scalability
• Multidimensional OLAP (MOLAP)
– Arraybased multidimensional storage engine (sparse matrix
techniques)
– fast indexing to precomputed summarized data
• Hybrid OLAP (HOLAP)
– User flexibility, e.g., low level: relational, highlevel: array
• Specialized SQL servers
– specialized support for SQL queries over star/snowflake schemas
Data Warehouse Usage
• Three kinds of data warehouse applications
– Information processing
• supports querying, basic statistical analysis, and reporting
using crosstabs, tables, charts and graphs
– Analytical processing
• multidimensional analysis of data warehouse data
• supports basic OLAP operations, slicedice, drilling,
pivoting
– Data mining
• knowledge discovery from hidden patterns
• supports associations, constructing analytical models,
performing classification and prediction, and presenting the
mining results using visualization tools.
• Differences among the three tasks
From OnLine Analytical Processing
to On Line Analytical Mining (OLAM)
• Why online analytical mining?
– High quality of data in data warehouses
• DW contains integrated, consistent, cleaned data
– Available information processing structure surrounding data
warehouses
• ODBC, OLEDB, Web accessing, service facilities, reporting
and OLAP tools
– OLAPbased exploratory data analysis
• mining with drilling, dicing, pivoting, etc.
– Online selection of data mining functions
• integration and swapping of multiple mining functions,
algorithms, and tasks.
• Architecture of OLAM
An OLAM Architecture
Mining query
Mining result
Layer4
User Interface
User GUI API
OLAP
Engine
OLAM
Engine
Layer3
OLAP/OLAM
Data Cube API
Layer2
MDDB
Filtering&Integration
Databases
Database API
Meta
Data
Filtering
Data
Data integration Warehouse
Data cleaning
MDDB
Layer1
Data
Repository
Referensi
• Data Mining: Concepts and Techniques by Jiawei
Han and Micheline Kamber, 2001
• Introduction to Data Mining by Tan, Steinbach,
Kumar, 2004