TechNet_박명은_01.ppt

Download Report

Transcript TechNet_박명은_01.ppt

대용량 데이터베이스를 지원하기
위한 SQL Server 2000 기능
박명은([email protected])
SQL Product Specialist
Microsoft Korea
Agenda



VLDB Trends & Support Technology
SQL Server 2000 Technologies
 RDBMS 자체 내에서의 VLDB Support
 인덱스 생성 및 관리
 신규데이터 대량 로드
 백업과 복구
 장애 복구
 튜닝
 부분 데이터 처리
SQL Server 64bit
대용량 데이터베이스
Trends
드라이브의 능력은 매 12-18개월 내에
두 배 이상 성능이 확장되는 추세
10 TB
드라이브의 비용은 점점 하락
5 TB
2TB
1 TB
데이터베이스의 사이즈는 매년 두
배 이상 증가
VLDB Support Technology
RDBMS 자체 엔진내에서의 VLDB 기능 지원
인덱스 생성 및 관리
신규 데이터 대량 로드
백업과 복구
장애 복구
튜닝
부분 데이터 처리
Agenda



VLDB Trends & Support Technology
SQL Server 2000 Technologies
 RDBMS 자체 내에서의 VLDB Support
 인덱스 생성 및 관리
 신규데이터 대량 로드
 백업과 복구
 장애 복구
 튜닝
 부분 데이터 처리
SQL Server 64bit
확장된 SQL Server 2000 엔진
Top n Sort

아래 Form과 같은 쿼리를 처리하기 위해 효과적인 엔진
 SELECT TOP 5 * FROM ORDERS ORDER BY
ORDER_ID DESC
SQL Server 7.0
Full Sort
SQL Server 2000
Top n
Engine
확장된 SQL Server 2000 엔진
Large Memory Support
= Mapped
= Unmapped
< 3GB
> 3 GB





가상주소공간은 3GB까지 제한됨
AWE는 PAE를 통해 36bit 물리적 주소 공간을 사용할수 있게 해줌(64GB)
페이지는 가상공간과 물리적 공간을 사이를 mapped/unmapped 함
맵은 복사하는것보다 비용이 더 적게들어 효율적임
“AWE enabled” 변수를 활성화함
확장된 SQL Server 2000 엔진
Merry –Go-Round 스캔
Without Merry-go-round scans:
User 1: 25% Scanned
User 1: 50% Scanned
User 2: 25% Scanned
With Merry-go-round scans:
User 1: 25% Scanned
User 2: Starts Scanning
User 1: Scan Complete
User 2: 75% Scanned
User 2: Remaining 25% Scanned
Can result in disk
thrashing during large
table scans!
확장된 SQL Server 2000 엔진
확장된 병렬처리
CPU1
CPU2
8K 8K 8K 8K 8K 8K 8K 8K
8K 8K 8K 8K 8K 8K 8K 8K
8K 8K 8K 8K 8K 8K 8K 8K
SDES
SDES
Parallel Page
Supplier CritSec
Readahead I/O

아키텍쳐는 한번에 16 pages 처리함
8K 8K 8K 8K 8K 8K 8K 8K
확장된 SQL Server 2000 엔진
확장된 병렬처리



쿼리 병렬처리의 효과
 좀더 효과적인 플랜가능
 비트맵 필터링
 멀티-쓰레드 접근
 정렬 시간 절감
 쿼리 수행 비용절감
 데드락 감지 향상
insert/update/delete 병렬처리
DBCC 병렬작업
Agenda



VLDB Trends & Support Technology
SQL Server 2000 Technologies
 RDBMS 자체 내에서의 VLDB Support
 인덱스 생성 및 관리
 신규데이터 대량 로드
 백업과 복구
 장애 복구
 튜닝
 부분 데이터 처리
SQL Server 64bit
온라인 인덱스 작업 수행




온라인 인덱스 작업수행
 Create
 Rebuild
 Reorganize (including BLOBs)
 Drop
 제약조건 생성 및 삭제 (primary key,
unique)
완벽한 병렬 처리
온라인 상에서 작업가능
온라인 상에서 인덱스 작업시 수정(Update)
작업이 다소 느려질수 있음
인덱스 관리 Tips :
Reorg & Create





DBCC ShowContig 실행
Scan Density(logical extent density) 와
Avg Page Density(Avg free bytes/page) 확인.
30-50% under이면 Reorg가 필요
Index Defrag 실행 - 데이터가 제대로 정렬되어
있지 않으면
DBCC Reindex 실행 – 클러스터 인덱스와 넌
클러스터 인덱스를 재 빌드 할때
삭제와 함께 인덱스 생성 – index defrag가 효과가
없어서 클러스터 인덱스를 재생성 할때
인덱스 생성시 메모리가 많으면 많을수록 빠름
그외 인덱싱 특징



내림차순 index 지원
CREATE INDEX I1 on T1
(C1 ASCENDING, C2 DESCENDING)
계산된 컬럼에 인덱스를 생성할수 있음
CREATE TABLE t1 (a int, b int, c AS a/b)
GO
CREATE UNIQUE CLUSTERED INDEX Idx1
ON t1.c
GO
단일 질의에 대해서 멀티 인덱스를 사용할수 있음
Agenda



VLDB Trends & Support Technology
SQL Server 2000 Technologies
 RDBMS 자체 내에서의 VLDB Support
 인덱스 생성 및 관리
 신규데이터 대량 로드
 백업과 복구
 장애 복구
 튜닝
 부분 데이터 처리
SQL Server 64bit
데이터 로드 방안



BCP
DTS
Bulk Insert
VLDB를 위한 데이터 로딩 전략
Insert는 인덱스가 없거나 작은 사이즈의
인덱스가 있을 경우 훨씬 빠름
(100,000 rows/sec) 그러나 추가 데이터가 로드
되는 대용량 시스템에는 적용 안됨
 단일 NC와 함께 Bulk Insert 시 linear하게 로드
 클러스터 인덱스와 함께 Bulk insert 시
fragmentation때문에 linear하게 로드 되지 않음
 병렬 Bulk Insert 훨씬 빠름
단, 정렬된 데이터와 파티션 된 로드 파일들 로드
시는 linear 하게 로드 되지 않음
 여러 개의 Bulk Insert 수행 시 충돌 없음
(테이블당 하나) (e.g. horizontal partitioning)
 Bulk
Bulk Load 성능

CPUs 수에 따라서 linearly하게 속도 증가
각 CPU당 거의 100% 향상
BULK INSERT Throughput
500 MHz Xeon™ Typical
30
25
MB/sec

20
15
10
5
0
1
2
3
4
5
Number of Streams
6
Agenda



VLDB Trends & Support Technology
SQL Server 2000 Technologies
 RDBMS 자체 내에서의 VLDB Support
 인덱스 생성 및 관리
 신규데이터 대량 로드
 백업과 복구
 장애 복구
 튜닝
 부분 데이터 처리
SQL Server 64bit
백업 및 복구 모델
From
To 
Full
Full
Bulk_Logged
Simple


Bulk_Logged
Simple
No change
Database backup
after change
No Change
Database backup
after change
Last log backup
Last log backup
just prior to change just prior to change
FULL BULK_LOGGED doesn’t break automated backup
procedures
Transitions to and from SIMPLE require more care but are
uncommon
백업 및 복구 모델



Full
대용량 data warehouses
 데이터 손실 없음
는 Simple 모델이 적합
 모든 Point-in-time 복구
Simple
 간단한 백업/복구 전략
 간단한 로그 관리
 로그백업이 없음
 데이터 손실이 큼
 point-in-time 복구를 할 수 없음
Bulk_Logged
 대량 로그시 속도가 좋음
 대량 로그시 최소의 로그 영역
Agenda



VLDB Trends & Support Technology
SQL Server 2000 Technologies
 RDBMS 자체 내에서의 VLDB Support
 인덱스 생성 및 관리
 신규데이터 대량 로드
 백업과 복구
 장애 복구
 튜닝
 부분 데이터 처리
SQL Server 64bit
장애조치 클러스터링
SQL Server 2000 클러스터의 모든 노드간의 장애 조치 및 장애 복구 기능과 SQL Server 2000
설치 프로그램을 통해 클러스터에서 노드를 추가하거나 제거하는 기능, 다른 클러스터 노드
인스턴스에는 영향을 주지 않고 임의의 노드에 클러스터 인스턴스를 다시 설치하거나 재작성하는 기능제공합니다.
Client PCs
Server B
Server A
Server A
SQL Server
Cluster
managemen
t
Heartbeat
Server B
Exchange Server
Client PCs
Server A
Disk cabinet A
Server A
SQL Server
Server B
Cluster
managemen
t
Heartbeat
Disk cabinet B
Disk cabinet A
설치시 직접 클러스터 환경 설치가 가능하며,
Active/Passive 또는 Active/Active장애조치를 할 수
있으며, 4-Node까지 클러스터 지원합니다.
Disk cabinet B
Server B
Exchange Server
SQL Server
로그전달 – Standby Server
주기적으로 로그정보 전달, 장애 발생시 Standby Server에서 지속적인 서비스
Monitor
Standby
(Destination server)
Primary
(Source server)
Transaction Log
Backup
Restore
Network
Users
Client workstations
복제 모델
Central Publisher/Distributor
Publisher/
Distributor
Subscribers
Central Subscriber/Multiple Publishers
Publisher/
Distributor
Publisher/
Distributor
Publisher/
Distributor
Multiple Publishers/Multiple Subscribers
Subscriber
Publisher/
Distributor
Publisher/
Distributor/
Subscriber
Publisher/
Distributor/
Subscriber
Publisher/
Distributor/
Subscriber
데이터베이스 복제
Publisher
 Maintains source
databases
 Makes data available
for replication
Distributor
 Receives and
stores changes
 Forwards changes
to subscribers
(Publication and distribution servers
can be combined on one server)
Subscriber
 Receives data changes
 Holds copy of data
가용성: 복제 ( Replication )
요구되는 트랜잭션의 성격에 따라 다양한 방법 선택 가능.
Merge Replication
인터넷을 통해서도 가능함.
Snapshot Replication
Snapshot Replication with
Immediate or Queued
Updating Subscriptions
Higher Autonomy
Higher Latency
Transactional Replication
Transactional Replication with
Immediate or Queued
Updating Subscriptions
Distributed Transactions

Snapshot Replication
Periodic bulk transfer of new
Lower Autonomy 
snapshots of data
Lower Latency

Transactional Replication


Replication of incremental changes
Merge Replication

Autonomous changes to replicated
data are later merged
Agenda



VLDB Trends & Support Technology
SQL Server 2000 Technologies
 RDBMS 자체 내에서의 VLDB Support
 인덱스 생성 및 관리
 신규데이터 대량 로드
 백업과 복구
 장애 복구
 튜닝
 부분 데이터 처리
SQL Server 64bit
인덱스 튜닝 관리자
Indexed Views
Large Table
Indexed View
CREATE VIEW ExampleView (PriKey, SumColx, CountColx)
AS
SELECT PriKey, SUM(Colx), COUNT_BIG(Colx)
FROM MyTable
GROUP BY PriKey
Performance Impact
Indexed Views
250
200
Time
(Sec)
150
100
50
0
1
2
3
4
Query Number
Original Query Times
With Indexed Views
5
Agenda



VLDB Trends & Support Technology
SQL Server 2000 Technologies
 RDBMS 자체 내에서의 VLDB Support
 인덱스 생성 및 관리
 신규데이터 대량 로드
 백업과 복구
 장애 복구
 튜닝
 부분 데이터 처리
SQL Server 64bit
파일 및 파일그룹 파티션
Data
Partitions
Index
Partitions


Month = 12
Month n = …
Month = 3
Month = 2
Month = 1


File Group Q1
Separate Files
File M1, M2, M3
Placement of data on
individual files or file
groups
Granularity improves
loading / purging / backup
& restore
Separation improves I/O
throughput (parallelism)
and reduces contention
Clean implementation
prevents databases from
sharing same files
파티션 뷰
파티션 뷰 는 하나 이상의 테이블들을 파트셔닝
컬럼을 가지고 UNION ALL 한 업데이트닝 가능한
뷰임
Example:
CREATE TABLE Customers_AH (
CustomerID nchar (5) NOT NULL CHECK (CustomerID < 'I'),
PRIMARY KEY CLUSTERED (CustomerID)
)
CREATE TABLE Customers_IP (
CustomerID nchar (5) NOT NULL CHECK (CustomerID BETWEEN
'I' AND 'Q'),
PRIMARY KEY CLUSTERED (CustomerID)
)
CREATE TABLE Customers_QZ (
CustomerID nchar (5) NOT NULL CHECK (CustomerID > 'Q'),
PRIMARY KEY CLUSTERED (CustomerID)
)
CREATE VIEW
SELECT *
SELECT *
SELECT *
CUSTOMER AS
FROM CUSTOMER_AH
FROM CUSTOMER_IP
FROM CUSTOMER_QZ
UNION ALL
UNION ALL
분산 파티션 뷰
IIS
IIS
Svr1
IIS
IIS
Svr2
IIS
IIS
Svr3
IIS
IIS
Svr4
IIS
IIS
Svr5
IIS
Svr6
SQL Server
CREATE VIEW Customers AS
SELECT <local>. Customers1 UNION ALL
SELECT <Svr2>.Customers2 UNION ALL
SELECT <Svr3>.Customers3 UNION ALL
SELECT <Svr4>.Customers4 UNION ALL
SELECT <Svr5>.Customers5 UNION ALL
SELECT <Svr6>.Customers6
IIS
CREATE VIEW Customers AS
SELECT <Svr1>.Customers1 UNION ALL
SELECT <Svr2>.Customers2 UNION ALL
SELECT <Svr3>.Customers3 UNION ALL
SELECT <Svr4>.Customers4 UNION ALL
SELECT <local>.Customers5 UNION ALL
SELECT <Svr6>.Customers6
SQL Server 최대 용량 사양
개체
SQL Server 2000
text, ntext 또는 image 열 각각의 바이트 수
2GB-2
각 행의 바이트 수
8,060
기본 테이블 당 열 수
1,024
데이터베이스 크기
1,048,516TB3
SQL Server 인스턴스 당 데이터베이스 수
32,767
데이터베이스 당 파일 그룹 수
256
데이터베이스 당 파일 수
32,767
파일 크기(데이터)
32TB
파일 크기(로그)
32TB
각 테이블의 행 수
사용 가능한 저장소로 제한됨
각 SELECT 문의 테이블 수
256
테이블 당 UNIQUE 인덱스 또는 제약 조건
수
249(클러스터되지 않음)
1(클러스터됨)
Agenda



VLDB Trends & Support Technology
SQL Server 2000 Technologies
 RDBMS 자체 내에서의 VLDB Support
 인덱스 생성 및 관리
 신규데이터 대량 로드
 백업과 복구
 장애 복구
 튜닝
 부분 데이터 처리
SQL Server 64bit
64-비트 컴퓨팅
32-비트 메모리 장벽을 깸


32-비트 운영 체제에서, 사용자 프로세스는 선형의 4GB
가상 메모리 영역으로 제한되어 있습니다 .(232 = 4 GB)

더 많은 메모리를 어드레싱하기 위해서, 32-비트
Windows는 Address Windowing Extensions
(AWE) 를 사용해서 물리적 메모리의 더 많은
메모리에 매핑합니다.

가상 메모리와 물리적 메모리간의 변환을 위해
추가적인 노력이 필요하며 이것은 성능에 영향을
미칩니다.
64-비트 시스템은 이러한 4 GB 메모리
4 GB
제약을 제거했습니다.
AWE Window
Source: Solomon & Russinovich,
“Inside Microsoft Windows 2000,” 3rd ed., ©2000
Server
application
address space
24 GB
AWE Memory
Physical
Memory
SQL Server 64 bit란 ?

SQL Server 2000 Enterprise Edition (64-bit)

Itanium 기반 서버와 Windows Server 2003 64 비트 제품에서의
실행을 위해 최적화된 SQL Server 2000 제품

SQL Server 2000 (64-bit)은 거의 무한정의 메모리 어드레스 처리
기능(Addressability)과 같은 보다 개선된 플랫폼 리소스를 활용하며,
고도의 I/O 집약적인 작업을 위한 높은 데이터베이스 성능을 제공함.

새로운 데이터베이스 기능은 엔터프라이즈 어플리케이션을 구축하는
개발자들과 DBA들을 위한 단일 기술 플랫폼을 제공하는 SQL Server
2000 32-bit 버전과 일치하는 풍부한 서비스와 다양한 기능들을 제공함.
Hardware Support
Itanium 2-based Systems

HP






Unisys



2-way rx2600, 12 GB RAM
4-way rx5670, 48 GB RAM
8-way (Q403)
16-way (Q403)
64-way SuperDome (Q303)
16-way ES7000 Aries 130
32-way (2 x 16-way) ES7000 Orion 130
NEC

32-way Express5800/1320Xc
Scalability Leadership
New
#1
Result!
800,000
700,000
650,000
707,102
600,000
550,000
2
Windows Server 2003
500,000
450,000
Windows 2000 Server
400,000
350,000
tpmC
300,000
250,000
200,000
150,000
100,000
50,000
0
1P
2P
4P
8P
16P
32P
Top Non-clustered Scalability and Price Performance
Source: www.tpc.org. Results as of 5-19-03.
64P
대용량 해외사례

25+ Terabyte 이거나 대용량 트랜잭션 실제 운영 사이트
 실제 운영되고 있는 사이트
 7+TB Telco Billing reporting system 15TB까지 증가
 3TB GIS 매핑 시스템 10-20TB 증가
 13TB 채무처리 금융 어플리케이션
 현재 50 TBs 정도의 대용량 사이트 구축중

High Volume mission Critical applications 운영사이트
 Trading 어플리케이션 60000+ Database
transactions / sec 초과
 Credit card 관리 시스템 3000 authentications/sec
처리
 은행 어플리케이션 processing money transfers of
greater than 40m trx / day while reporting is active
대용량 국내 사례

1TB Over
 삼성생명 영업지원 시스템 ( 2.7TB )
 엘트웰 DW/OLAP 시스템 ( 1TB )
 제일제당 SAP BW 시스템 ( 1.2TB , 구축
2.5TB )

500GB - 1TB
 옥션 경매시스템
 롯데카드 시스템 등..
Summary
RDBMS 자체 엔진내에서의 VLDB 기능 지원
인덱스 생성관리
신규 데이터 대량 로드
백업과 복구
장애 복구
튜닝
부분 데이터 처리
참조할 사이트






Microsoft SQL Server Korea Site
http://www.microsoft.com/korea/sql
Microsoft SQL Server 2000 by Example:
http://www.solidqualitylearning.com/Books.htm
SQL Server Magazine: http://www.sqlmag.com
Professional Association of SQL Server:
http://www.sqlpass.org
Solid Quality Learning:
http://www.solidqualitylearning.com
Microsoft SQL Server site:
http://www.microsoft.com/sql
참조할 사이트



SQL Server UK User Group:
www.sqlserverfaq.com
Newsgroups:
news://msnews.microsoft.com:
 Microsoft.public.sqlserver.programming
 Microsoft.public.sqlserver.tools
 Microsoft.public.sqlserver.server
 Microsoft.public.es.sqlserver
Swynk: http://www.swynk.com
감사합니다.
Easy!