Technical Solution Consulting
한국오라클 유한회사
Enterprise 환경에서의 혁신적인 데이터 관리 기법
2Copyright© 2008, Oracle. All rights reserved.
Introduction
Advanced Compression
Partitioning
Flashback Technology
Agenda
3Copyright© 2008, Oracle. All rights reserved.
<Insert Picture Here>
Introduction
4Copyright© 2008, Oracle. All rights reserved.
Are you having to
store vast quantities
of data?
Introduction
5Copyright© 2008, Oracle. All rights reserved.
0 1 1 5 10
Months Years
Active
Less
ActiveLow
Volume
High
Volume
Activity D
ata
Volu
me
Introduction
6Copyright© 2008, Oracle. All rights reserved.
ActiveLess Active
Historical Archive
Data Lifecycle
This Month This Year Previous Years
Introduction
7Copyright© 2008, Oracle. All rights reserved.
관리 및 운영 성능 저하- SQL 성능 저하
- 기초 데이터 운영 성능 저하
- 데이터 가용성 저하
Introduction
운영 비용 증가- 주기적인 디스크 증설
- 서버 관리비용 증가
- Downtime 비용 증가
8Copyright© 2008, Oracle. All rights reserved.
<Insert Picture Here>
Advanced Compression
9Copyright© 2008, Oracle. All rights reserved.
Backups
Redo Logs
Standby
Introducing Advanced Compression
오라클 11g Advanced compression
- Structured data compression
- Unstructured data compression
- Compression for backup data
- Network transport compression
압축에 따른 운영자원 및 비용 절감- Storage System
- Network Bandwidth
- Memory Usage
compression
10Copyright© 2008, Oracle. All rights reserved.
Advanced CompressionStructured Data Compression
OLTP & DW에 대해 오라클 11g에서 강력한 Table 압축 기능 제공- DML 작업에 대한 완벽한 압축기능제공
- 압축된 테이블에 대한 컬럼 추가 또는 삭제 가능
경이적인테이블 데이터 압축- 보편적으로 2배 또는 3배의 데이터 압축 효과
- Block Level의 데이터 압축
혁신적인 SQL 성능 향상- 새로운 압축 알고리즘 적용으로 DML 작업 시 급격한 성능저하 방지
- 압축을 통한, 보다 적은 I/O 및 메모리 사용으로 읽기 성능 증가
- Long running SQL의 경우 2배 이상의 성능향상 가능
Partition 별 데이터 압축 가능
압축에따른 Application 수정 불필요
11Copyright© 2008, Oracle. All rights reserved.
Advanced CompressionBlock-level batch compression
Patent pending 알고리즘 적용- 압축효율성 증대 및 SQL 수행성능 보장
개별적인 DML 수행 시 발생하는빈번한데이터 압축 현상 제거
데이터변화가 많은 OLTP에 적합한 Block-level 데이터 압축 기능- 타사의 경우 심볼테이블, Static Dictionary 테이블 등의 사용으로 부가적인
성능저하 발생
12Copyright© 2008, Oracle. All rights reserved.
Advanced CompressionUnstructured Data Compression – SecureFiles
SecureFiles
- 오라클 11g New Feature
- 기존 LOB의 성능 및 관리상 효용성을높이기 위한 오라클 신기능
- Unstructured 데이터에 대한 높은 운영 성능 보장 및 최적의 데이터 저장기능 제공
- 일반문서파일, 이미지 및 동영상 등의 멀티미디어파일 저장 가능
- LOB 데이터를 SecureFile로 손쉽게 전환 가능
- LOB 운영방식과 동일하게 운영 가능
SecureFiles Compresssion
- 평균적으로 2배 또는 3배의 데이터 압축 가능
- Industry Standard 압축 알고리즘 사용
- 성능 및 여유공간에 따라 2가지 수준(Medium, High)의 압축 기능 제공
- SeucreFiles 데이터에 대해 자동으로 압축상태 인지 및 Skip
13Copyright© 2008, Oracle. All rights reserved.
Advanced CompressionUnstructured Data Compression – SecureFiles De-duplication
SecureFiles De-duplication
- 동일한 데이터에 대해 하나의 물리적 Image로 저장
- 경이적인 쓰기 및 복사 성능 향상
- 높은 공간 절약 방안 제시
- 일반 Securefiles 테이블 및 Partition, Sub-partition 데이터에 적용 가능
- 다양한 문서 저장, Email 및 Archival application에 유용
Secure hash
14Copyright© 2008, Oracle. All rights reserved.
Advanced CompressionBackup & Network data compression
Data Pump compression
- DB로부터 데이터 Export 시 데이터압축 동시 수행
- 압축된 데이터를 그대로 DB에 Import 가능
RMAN backup compression
- 기존보다 40% 빠른 Backup 성능 제공
- Recovery시 Decompression 불필요
Data Guard network compression
- Standby DB로의 데이터 전송 시 Network 부하 절감
- 압축된 데이터 전송에 따른 전송 속도 향상
- Network 문제 발생 후 Gap 복구에 따른 자동 Re-Sync 성능 향상
15Copyright© 2008, Oracle. All rights reserved.
Storage Utilization
MB
0
500
1000
1500
2000
2500
No Compression Compression
More than 70% Storage Savings
Advanced CompressionStorage Utilization
16Copyright© 2008, Oracle. All rights reserved.
Table Scan Performance
Time
(seconds)
0
0.1
0.2
0.3
0.4
No Compression Compression
Compression is 2.5x Faster
Advanced CompressionTable Scan Performance
17Copyright© 2008, Oracle. All rights reserved.
0
0.01
0.02
0.03
No Compression Compression
Index Range Scan Performance
Time
(seconds)
No Performance Impact on Index Scans
Advanced CompressionIndex Range Scan Performance
18Copyright© 2008, Oracle. All rights reserved.
DML Performance
Time
(seconds)
0
5
10
15
20
25
30
35
No Compression Compression
Compression has less than 3%
overhead
Advanced CompressionDML Performance
19Copyright© 2008, Oracle. All rights reserved.
Advanced CompressionSummary
다양한 형태의 데이터에 대해 최적의 압축솔루션 제공- Structured, Unstructured, Backup, Network
2배 또는 3배 정도의 디스크 사용량 절감 가능- 운영 DB 뿐 아니라 Test, DR, Backup DB등도 연관되어 디스크 사용량 절감
Application 변경 없이 SQL 수행성능 향상 가능
Memory 및 Network 효율설 증대
다양한 Application workload 경감 가능- Transaction Processing
- Data Warehousing
- Contents Management
20Copyright© 2008, Oracle. All rights reserved.
<Insert Picture Here>
Partitioning
21Copyright© 2008, Oracle. All rights reserved.
Introducing Partitioning
Large Table Partition Composite Partition
Table 및 Index에 대한 논리적 분할
다양한종류의 Partition 기법 제공
운영 Application 수정 불필요
SQL 성능향상 및 데이터 가용성 극대화
Oracle8, Oracle8i, Oracle9i, Oracle10g, Oracle11g E.E Option
22Copyright© 2008, Oracle. All rights reserved.
Partitioning Manageability & Availability
Partition 별 관리 및 Backup 가능
Partition 별 Move, Split, Rename, Drop, Add, Exchange 가능
Partition 별 가용성 증대에 따른 Down Time 및 유지보수시간 절감
Order table
Jan02
Local IndexOther data is not affected
Feb02 Mar02 Apr02 Feb03
Drop Add
23Copyright© 2008, Oracle. All rights reserved.
PartitioningPerformance - Partition Pruning
CBO 분석을 통해 필요한 Partition만을 접근한 후 Data 추출
불필요한 Partition 접근 차단으로 System 자원절감 및 응답속도 향상
Only 2 partitions are accessed
sales table
Jan02 Feb02 Mar02 Apr02 Dec02
SELECT sum(sales_amount) FROM salesWHERE sales_date
BETWEEN ‘01-Feb-2002’AND ‘31-MAR-2002’;
24Copyright© 2008, Oracle. All rights reserved.
PartitioningPerformance - Partition wise Join
해당 조건 내 Table Partition들 사이에서만 Join이 발생
소량 Data만의 Join으로 System 자원 절감 및 응답속도향상
결과Master
결과detail
Parallel
Execution
Servers
Server Server Server Server
Hash
partitioning
on Customer_id
25Copyright© 2008, Oracle. All rights reserved.
Partitioning기본적인 3가지 Partition 제공
... 1,200812,20072,20071,2007 3,2007
Range Partition ( 연,월,주…)
... hash-8hash-7hash-2hash-1 hash-3
Hash
(‘OR’, ‘WA’)
...northeastmidwest southeast
Partition by list ( 부서,지역…)
(‘IL’, ‘IN’, ‘OH’, ‘MI’)
(‘NY’, ‘NJ’, ‘MA’, ‘CT’) (‘GA’, ‘FL’, ‘NC’, ‘SC’)
northwest...
26Copyright© 2008, Oracle. All rights reserved.
Partitioning Range Partitioning
날짜 기준 Partition
Historical Data Table에 적합한 Partition
용이한 Maintenance 기법 제공 및 Maintenance 시간 단축
데이터가용성 우수
CREATE TABLE sales ( … )PARTITION BY RANGE (order_date) (
PARTITION Q1 VALUES LESS THAN (’01-Apr-2007’)TABLESPACE T1,PARTITION Q2 VALUES LESS THAN (’01-Jul-2007’)TABLESPACE T2,PARTITION Q3 VALUES LESS THAN (’01-Oct-2007’)TABLESPACE T3,PARTITION Q4 VALUES LESS THAN (’01-Jan-2008’)TABLESPACE T4)
ENABLE ROW MOVEMENT;
27Copyright© 2008, Oracle. All rights reserved.
PartitioningHash Partitioning
Partition Key의 Hash 값에 의한 Partition ( 균등한데이터 분할 )
Select 시 조건과 무관하게 병렬 Degree 제공 (질의 성능 향상)
데이터분포도를알 수 없는 Table에 적합
Historical Data를 다루는데는 부적합
특정 Data가 어느 Hash Partition에 있는지판단 불가
CREATE TABLE orders ( … )PARTITION BY HASH (order_id)PARTITIONS 4STORE IN (TS1, TS2, TS3, TS4);
CREATE TABLE orders ( … )PARTITION BY HASH (order_id)(PARTITION P1 TABLESPACE T1,PARTITION P2 TABLESPACE T2,PARTITION P3 TABLESPACE T3,PARTITION P4 TABLESPACE T4);
28Copyright© 2008, Oracle. All rights reserved.
PartitioningList Partitioning
특정 Partition에 저장 될 Data에 대한 명시적 제어 가능
정렬화및 관련성이적은 Data에 대한 효율적인 Group화 가능
Distinct 값이 작고, Distinct 값별로 분포도가 비슷한자료에 적합
Multi-Column Partition Key 제공 불가
CREATE TABLE sales_by_product_line ( … )PARTITION BY LIST (state) (
PARTITION northwest VALUES IN(’OR’, ’WA’)TABLESPACE T1,PARTITION southwest VALUES IN (’AZ’, ’UT’, ’NM’)TABLESPACE T2,PARTITION northeast VALUES IN (’NY’, ’VT’, ’NJ’)TABLESPACE T1,PARTITION southeast VALUES IN (’FL’, ’GA’)TABLESPACE T2);
29Copyright© 2008, Oracle. All rights reserved.
PartitioningComposite Partitioning
두개의 Partition을 복합적으로혼용해 운영가능- Range-Range, Range-Hash, Range-List
- List-Range(11g), List-Hash(11g), List-List(11g)
Partition 및 Sub-Partition 단위의관리 작업 수행 가능
CREATE TABLE sales ( month_id NUMBER,product_id NUMBER,sales NUMBER )
PARTITION BY RANGE (month_id)SUBPARTITION BY HASH (product_id) SUBPARTITIONS 8STORE IN (T1,T2,T3,T4,T5,T6,T7,T8)
( PARTITION sales91 VALUES LESS THAN(199201),PARTITION sales92 VALUES LESS THAN(199301), ...PARTITION sales98 VALUES LESS THAN(MAXVALUE));
30Copyright© 2008, Oracle. All rights reserved.
PartitioningInterval Partitioning (11g)
Range Partitioning의 확장된 개념
Partition 생성시 정의하는 Interval에 의해 Partition 자동 추가
DBA의 Partition 관리부하 경감
CREATE TABLE sales ( … )PARTITION BY RANGE (order_date) INTERVAL (NUMTOMYINTERVAL(1,’MONTH’)
(PARTITION P1 VALUES LESS THAN (’01-Apr-2007’)TABLESPACE T1,PARTITION P2 VALUES LESS THAN (’01-Jul-2007’)TABLESPACE T2,PARTITION P3 VALUES LESS THAN (’01-Oct-2007’)TABLESPACE T3,PARTITION P4 VALUES LESS THAN (’01-Jan-2008’)TABLESPACE T4);
31Copyright© 2008, Oracle. All rights reserved.
PartitioningREF Partitioning (11g)
Foreign Key 관계를 통한 자식 Table Partition
부모 Table과 동일한형태로 자식 Table Partition 가능
성능향상및 Partition 관리의 편의성 증대
CREATE TABLE orders ( (order_id NUMBER NOT NULL,order_date DATE, ……..… )CONSTRAINT ORDER_PK PRIMARY KEY (order_id)PARTITION BY RANGE (order_date)
(PARTITION P1 VALUES LESS THAN (’01-Apr-2007’)TABLESPACE T1,PARTITION P2 VALUES LESS THAN (’01-Jul-2007’)TABLESPACE T2,PARTITION P3 VALUES LESS THAN (’01-Oct-2007’)TABLESPACE T3,PARTITION P4 VALUES LESS THAN (’01-Jan-2008’)TABLESPACE T4);
CREATE TABLE orders_line ( (order_id NUMBER,line_item_id NUMBER, ……..… )CONSTRAINT ORDER_FK FOREIGN KEY(order_id) REFERENCES ORDERS(order_id)PARTITION BY REFERENCE (order_date);
32Copyright© 2008, Oracle. All rights reserved.
PartitioningVirtual Column-Based Partitioning (11g)
존재하지않는 Column을 기준으로 Table Partition
Run-Time Level에서 Return 되는 값을 Partition Key로 지정
CREATE TABLE SALES(
sales_id NUMBER,cust_id NUMBER,sales_amt NUMBER,sale_category VARCHAR2(6)GENERATED ALWAYS AS(CASE
WHEN sales_amt <= 10000THEN 'LOW'
WHEN sales_amt > 10000AND sales_amt <= 100000THEN CASE
WHEN cust_id < 101 THEN 'LOW'WHEN cust_id BETWEEN 101 AND 200 THEN 'MEDIUM'ELSE 'MEDIUM'
END::
) VIRTUAL)PARTITION BY LIST (sale_category)(
PARTITION P_LOW VALUES ('LOW'),PARTITION P_MEDIUM VALUES ('MEDIUM'),PARTITION P_HIGH VALUES ('HIGH'),
)
33Copyright© 2008, Oracle. All rights reserved.
Index PartitioningLocal Partitioned Index
Q1
(orderdate)
Q2
(orderdate)
Q3
(orderdate)
Q4
(orderdate)
Partition된 Table과 동일한방법,범위로 Partition된 Index
DW 및 DSS 운영환경에 적합
Index & Table Partition 별 가용성 증대 및 관리 용이
Prefixed Local & Non-Prefixed Local Index 존재
34Copyright© 2008, Oracle. All rights reserved.
Index PartitioningGlobal Partitioned Index
Partition된 Table과 다른 범위로 Partition된 Index
OLTP 운영환경에 적합Hash-partitioned global index > Global index & Unique local index > Non-Unique local index
Table의 특정 Partition에 DDL이 수행된 경우 Index Rebuild 필요
Q1
(orderdate)
Q2
(orderdate)
Q3
(orderdate)
Q4
(orderdate)
35Copyright© 2008, Oracle. All rights reserved.
Oracle PartitioningOver Ten Years of Development
Interval Partitioning
Partition Advisor
More composite choices
REF Partitioning
Virtual Column Partitioning
Oracle
Database 11g
Fast drop table“Multi-dimensional”
pruning
1M partitions per tableOracle10g R2
Local Index
maintenance
Global hash indexesOracle10g
Fast partition splitComposite range-list
partitioningOracle9i R2
Global index
maintenance
List partitioningOracle9i
Merge operationPartition-wise joins
“Dynamic” pruning
Hash and composite
range-hash partitioningOracle8i
Basic maintenance
operations: add,
drop, exchange
“Static” partition
pruning
Range partitioning
Global range indexes
Oracle8
ManageabilityPerformanceCore functionality
36Copyright© 2008, Oracle. All rights reserved.
PartitioningSummary
다양한 형태의 데이터 분할 방법 제공- Range, Hash, List, Composite 및 REF, Virtual Partitioning
분할에따른 데이터관리비용 절감 및 관리업무경감- 손쉬운 Partition 삭제 및 추가 가능
데이터 가용성 증가- Partition 별 Backup 및 Recovery 가능
Application 수정 없이 SQL 수행성능 향상- CBO에 의한 자동 Partition 검색 및 데이터 추출
37Copyright© 2008, Oracle. All rights reserved.
Adv Compression & Partitioning
2009년
2006년
2007년
2008년
2009년
2006년
2007년
2008년
2009년
Partitioning Compression
2006년
2007년
2008년
compression
compression
compression
Big Table
38Copyright© 2008, Oracle. All rights reserved.
<Insert Picture Here>
Flashback Technology
Flashback TechnologyOracle Flashback
Flashback Query (9i)
- Undo를 이용, 과거특정시점의 정보조회
Flashback Database (10g)
- 특정과거시간으로의 Database 복귀
Flashback Drop (10g)
- Recycle bin을 이용, Drop된 Table 복구
Flashback Table (10g)
- Undo를 이용, 과거특정시간대로의 Table 복구
Flashback Transaction (11g)
- 특정 Transaction과 연관된모든 Transaction에 대한 조회 및 철회
Flashback Data Archive (11g, Total Recall)
- Transaction 변경사항에대한영구적보관및 이용
08:25
11:42
18:29
Flashback TechnologyTotal Recall (Flashback Data Archive)
간단한명령어를 통한 Table 단위 Capture 활성화
압축기능을 통한 Historical Data의 효율적 저장
저장된 Data에 대한 실수 또는 악의적인 Data 변조 방지
Flashback Query 기능을 통한 과거 Data의 손쉬운 조회 및 Audit
사용자실수 및 장애에 따른 신속한 Data 복구
현재 D-3 D-12
Capture
41Copyright© 2008, Oracle. All rights reserved.
Flashback TechnologyTotal Recall (Flashback Data Archive)
Undo 데이터 기반
자동으로 History 데이터 저장
저장될 때까지 Undo 데이터 유지
Asynchronous 방식의 데이터 저장- 새로운 ‘fbda’ Background Process 사용
- Default 저장 주기 5분
- Buffer Cache 접근으로 저장 성능 향상
42Copyright© 2008, Oracle. All rights reserved.
Q & A