- :: dbguide.net · v$dataguard_status v$archive_dest v$archive_dest_status v$archive_gap...
TRANSCRIPT
<Insert Picture Here>
Enterprise Manager를 활용한 Active Data Guard
강송희
TSC본부 DB 기술팀
한국오라클
Agenda
• Active Data Guard 도입 배경
• 기존 DR 솔루션 대비 Active Data
Guard의 특장점
• Active Data Guard의 구성 및 동작 원리
• EM을 이용한 설치
• EM을 이용한 모니터링 및 관리
• 요약
<Insert Picture Here>
Active Data Guard 도입 배경
두 마리 토끼 (재난 대비 + 업무활용)
재난대비솔루션의 투자 가치?
• 투자한 만큼 활용 가능한가?
DR only Solution
(Remote Mirroring)
•활용도 0
–현재 Remote Mirroring 솔루션의 한계
–DR은 Standby로 inactive로대기
•불확실
– 재난 발생될 때 정상 동작이될지 의심스러움
– 테스트가 힘들다
Oracle
Data Guard
•활용도 0 –No!– DR서버를 Active하게 업무에활용 가능
•불확실–No!– Switchover, Failover 로정상동작 확인 가능
– 테스트가 쉽다.
DR Systems Gather Dust
<Insert Picture Here>
기존 DR 솔루션 대비 Active Data
Guard의 특장점
-Remote Mirroring
-Data Guard 특징
-Data Guard Advantages
-Active Data Guard Benefits
Remote Mirroring
Control
Files fil
Online
Logs
Archive
Logs
Flashback
Logs
Data
Files
SYSTEM
USER
TEMP
UNDO
Production DBMS Standby DBMS
Control
Files fil
Online
Logs
Archive
Logs
Flashback
Logs
Data
Files
SYSTEM
USER
TEMP
UNDO
Updates
Network I/Oupdates
InActive
장애 발생 시매뉴얼 하게 기동
Most of the storage vendors (Veritas, EMC,
Network Appliance, Hitachi, Legato, etc)
Data Guard vs Remote Mirror
Redo Transport ,Apply
Control
Files fil
Online
Logs
Archive
Logs
Flashback
Logs
Data
Files
SYSTEM
USER
TEMP
UNDO
Production DBMS Standby DBMS
Network I/O
Updates
Applydata validation
*www.oracle.com/technology/deploy/availability/htdocs/DataGuardRemoteMirroring.html
7X less
data
volume*
27X fewer
network
I/Os*
Control
Files fil
Standby
Redo Logs
Archive
Logs
Flashback
Logs
Data
Files
SYSTEMUSER
TEMP
UNDO
updates
Delayed Apply기능 지원(optional):
Redo data를 일정시간이 지난다음 반영하도록 설정가능 - Operational Error를 감지 후 standby site를이용해 복구가능: flash back기능으로 대체 가능
• 국지적인 재난도 피할 수 있을 만큼의충분한 거리를 두고 구성 가능
• Zero data loss mode로도 구현도가능
100 miles300+ miles
Data Guard: Synchronous Redo Shipping
Synchronous Disk
Mirroring
200 miles
Data Guard vs Remote Mirror
Zero Data Loss Over Long Distance & Delayed apply기능
Data Protection
Protection from data corruptions
– Data Guard: database간의의존성이 약한 Architecture로 disk
block을 직접 copy하는 것이 아니라전달된 Redo를 검증하면서 DR
site에 반영하므로 data
corruptions이 전달되지 않도록보호할 수 있다.
– Remote Mirroring & Stretch
Clusters : storage stack /
corrupted bits에서 발생한에러가 DR로 전달되어 영향을미친다
어떤 시스템이라도 장애가 발생할 가능성이 있고 이로 인한 data
corruptions 이 발생할 수 있다 : NIC, Memory, Volume Manager, File
System, OS, HBA, SAN Switch, Disk Controller, RAID, Storage
Array등등 – DR solution의 이중화된 데이터에는 이러한 data
corruptions이 반영되어서는 안 된다.
Data Guard Advantages
1. Network Efficiency
• Data Guard:Redo data만 전송
• Remote mirroring solutions: datafiles, archivelog files, redolog file들 모두복제
2. Better suited for WANs• Standard TCP/IP 이용- no protocol
converters needed
3. Better Data Protection
– logical and physical corruption들로 부터 보호가능
4. Functionality
– DBA가 이해하기 쉬운 DR
solution
:backup/recovery와 유사 Redo Apply/SQL Apply
5. Flexibility– storage vendor 종속적이지
않음
6. Maximum ROI– DR투자 효과 증대
reporting/query용으로 활용
Network Bandwidth Network I/Os
Data Guard
Remote Mirroring
7x 27x
Active Data Guard Benefits
• Primary DB의 부하 감소 및 성능 향상• Primary 의 Workload(Reporting, Backup)를 Standby DB로 분산
• DR + Up-to-Date Reporting • 3rd Party Solution 은 구현 불가
• 단방향 Replication 솔루션• 기존 Replicaton Solution 에 비해 부하가 매우 적고 관리가 단순
• 비용 절감• 하나 또는 복수개의 Physical Standby DB로 HA, Backup 수행(,
Reporting, Test 서버 구현
Without Active Data GuardAll Workloads Run on Production
0
500
1000
1500
2000
ProductionDatabase
Data GuardStandby
Read-write service
480 tps
Read-only service
640 tps
Primary server at
100% of capacity
read-only service
1,350 tps
+110%
Primary server at
60% of capacity
Active Data Guard 11gEasily Optimize Performance for All Workloads
0
500
1000
1500
2000
ProductionDatabase
Active DataGuard Standby
read-write service
1,680 tps
+250%
Active Data Guard Use Examples
• Education – 학교성적 보고서, 교칙, 과목소개 …
• Financial - transaction 조회, 시장가격, 거래내역 …
• Healthcare – 의료 정보 조회, 의사/간호사조회, 의료시설 조회 …
• Legal – 법률 보고서, 재판 내역, 배심원 평결내역 …
• Telecommunications – 사용 내역, 미사용 시간, 과금 요율 …
• Transportation – 배송사태 추적, 운송 요율 조회 …
• Web-business – 카탈로그 조회, 가격비교, 주문 현황 …
Bottom Line …
• 많은 업무에서 read-only 작업을 많이 수행함.
• Active Data Guard를 사용하면:
• Read-only성 작업을 physical standby에서 수행가능하고
• production database의 부하를 덜어 줄 수 있음.
백업속도 향상 With Oracle Active Data Guard
Offload fast incremental backups to standby
Real-time
Queries
Standby
Database
Production
Database
• standby database에서 RMAN의 block변경추적 기능을 이용하면incremental backups 20배 빠르게 수행가능
테스트 환경으로 활용 With Snapshot Standby
• Standby Database 를 Test나개발 환경으로 사용
• DR구축 비용을 줄일 수 있음
• DR환경에서 전반적 test가 가능
• Data loss가 없도록 유지• 그러나 Snapshot mode로 전환 후
에는 redo적용이 잠시 보류되어실시간 조회는 제한됨
• Storage snapshots과 유사하지만:
• 동시에 DR기능 유지하고
• 하나의 storage 복사본만 사용
Physical Standby Apply Redo
Snapshot Standby Perform Testing
Open
Database
Back out
Changes
Continuous Redo Shipping
<Insert Picture Here>
Active Data Guard 구성 및동작 원리
- Active Data Guard Deployment
- Data Guard Transport Services
- Data Guard Apply Services
- Data Protection Mode
Active Data Guard
Reader Farm
Active Data Guard Deployment ExampleScale-out Query Performance to Web-Scale*
Production
Database
updates
Standby
Databases
queries
queries
queries
queries
queries
DR included *Reporting, web content browsing
Online
Redo
Logs
Archived
Redo Logs
Production
Database
Transactions
LGWR
ARCH
Production
RFS
Standby
Redo
Logs
Archived
Redo Logs
SynchronousLNS
Standby
ARCH
Data Guard Transport Services
AsynchronousLNS RFS
RFS
Gap Resolution
Data Guard Apply Services
Standby
Redo Logs
Archived
Redo Logs
Standby
Physical(Redo Apply
MRP)
Logical(SQL Apply
LSP)
Apply
Redo
Data
From
Site A
Standby
DatabaseARCH
RFS
Flexible Data Protection Modes
Protection Mode Risk of Data Loss Redo Shipment
Maximum Protection Zero Data Loss
Double Failure Protection
Synchronous redo
shipping
Maximum Availability Zero Data Loss
Single Failure Protection
Synchronous redo
shipping
Maximum Performance Potential for
Minimal Data Loss
Asynchronous redo
shipping
Balance cost, availability, performance, and transaction protection
Maximum Protection Mode
• Highest level of data protection
• Configuration: LGWR SYNC, SRLs
• Enforces protection of every transaction
• If last standby is unavailable, processing stops at primary
• Good for financial systems where no data loss is acceptable
Protection Mode Risk of Data Loss Redo Shipment
Maximum Protection Zero Data Loss
Double Failure Protection
Synchronous redo
shipping to 2 sites
ALTER DATABASE SET STANDBY TO MAXIMIZE PROTECTION;
Maximum Availability Mode
• Enforces protection of every transaction
• Configuration: LGWR SYNC, SRLs
• If last standby is unavailable, processing continues at primary
• When the standby becomes available again, synchronization with the primary is automatic
Protection Mode Risk of Data Loss Redo Shipment
Maximum Availability Zero Data Loss
Single Failure Protection
Synchronous redo
shipping
ALTER DATABASE SET STANDBY TO MAXIMIZE AVAILABILITY;
Maximum Performance Mode
• Highest level of performance
• Configuration: LGWR ASYNC, or ARCH, SRLs
• Protects from failure of any single component
• Least impact on production system
• Useful for applications that can tolerate some data loss
Protection Mode Risk of Data Loss Redo Shipment
Maximum Performance Minimal data loss – usually 0
to few seconds
Asynchronous redo
shipping
ALTER DATABASE SET STANDBY TO MAXIMIZE PERFORMANCE;
<Insert Picture Here>
EM을 이용한
Data Guard Setup
Data Guard 구성
Data Guard 구성 절차
[Primary Site]
1. Archivelog mode
2. Password File 생성
3. Init 파일 수정
4. Net Service 등록
5. Primary DB Backup
6. Backup Copy 생성
[Standby Site]
1. O/S User 및 환경변수 설정
2. Backup Copy 전송
3. Oracle Software 설치
4. Standby Control File 생성
5. Standby Parameters 설정
6. Net Service Name 등록
7. Password 파일 생성
8. Standby DB Log Apply 운영
[Primary DB Init Parameter 예제]
*.DB_NAME=ora101r
*.DB_UNIQUE_NAME=ora101r
*.SERVICE_NAMES=ora101r
O10R1.INSTANCE_NAME=O10R1
O10R2.INSTANCE_NAME=O10R2
*.LOG_ARCHIVE_CONFIG='send,receive,DG_CONFIG=(ora101r,psb)'
*.LOG_ARCHIVE_DEST_1=’LOCATION=/nfs1/common/oradata/arch/ VALID_FOR=(online_logfiles,all_roles) DB_UNIQUE_NAME=ora101r mandatory reopen=30’
*.LOG_ARCHIVE_DEST_2='SERVICE=tns_psb VALID_FOR=(online_logfiles,primary_role) DB_UNIQUE_NAME=psb optional reopen=30'
*.LOG_ARCHIVE_FORMAT=rac_%t_%s_%r.arc
….
Manual 구성 방식 EM의 Wizard 방식
[Primary DB Net Service 예제]
tns_psb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1.kr.oracle.com)(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = psb))
)
tns_ora101r =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL = TCP)(HOST = node1.kr.oracle.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = node2.kr.oracle.com)(PORT = 1521))
)
[Stand DB Init Parameter 예제]
*.DB_NAME=ora101r
*.DB_UNIQUE_NAME=ora101r
*.SERVICE_NAMES=ora101r
O10R1.INSTANCE_NAME=O10R1
O10R2.INSTANCE_NAME=O10R2
*.LOG_ARCHIVE_CONFIG='send,receive,DG_CONFIG=(ora101r,psb)'
*.LOG_ARCHIVE_DEST_1=’LOCATION=/nfs1/common/oradata/arch/ VALID_FOR=(online_logfiles,all_roles) DB_UNIQUE_NAME=ora101r mandatory reopen=30’
*.LOG_ARCHIVE_DEST_2='SERVICE=tns_psb VALID_FOR=(online_logfiles,primary_role) DB_UNIQUE_NAME=psb optional reopen=30'
*.LOG_ARCHIVE_FORMAT=rac_%t_%s_%r.arc
….
[Stand DB Net Service 예제]
tns_psb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1.kr.oracle.com)(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = psb))
)
tns_ora101r =
(DESCRIPTION =
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL = TCP)(HOST = node1.kr.oracle.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = node2.kr.oracle.com)(PORT = 1521))
)
Configuration 자동설정
(Parameters & Net Service)
<Insert Picture Here>
EM을 이용한
Data Guard 모니터링 및 관리
Data Guard 모니터링EM의 Data Guard 성능 모니터링
[Data Guard Views]
DBA_LOGSTDBY_EVENTS
DBA_LOGSTDBY_LOG
DBA_LOGSTDBY_NOT_UNIQUE
DBA_LOGSTDBY_PARAMETERS
DBA_LOGSTDBY_PROGRESS
DBA_LOGSTDBY_UNSUPPORTED
V$LOGSTDBY
V$LOGSTDBY_STATS
V$DATAGUARD_STATUS
V$ARCHIVE_DEST
V$ARCHIVE_DEST_STATUS
V$ARCHIVE_GAP
V$ARCHIVED_LOG
V$DATABASE
V$DATABASE_INCARNATION
V$DATAFILE
V$DATAGUARD_CONFIG
V$DATAGUARD_STATUS
V$LOGFILE
V$LOG_HISTORY
…
Script를 이용한 모니터링
[Script 예제][
log_dest.sql]
select dest_id, dest_name, status, target,
error, remote_template
from v$archive_dest
where schedule='ACTIVE' ;
[log_wait.sql]
select process, status, thread#, sequence#,
block#, blocks
from v$managed_standby ;
[archive_gap.sql]
select * from v$archive_gap ;
[standby_archivelog.sql]
select thread#,sequence#,applied
from v$archived_log
order by first_change# ;
…
- GUI 모니터링
- Top-down 원인분석
Data Guard 관리EM의 Data Guard 관리 화면Manual 방식의 관리
- 관리작업 실수 예방
- 민첩하고 편리한 관리
<Insert Picture Here>
Demo :
Data Guard 구성 및 관리
요약
• Active Data Guard with EM Includes
• Wizard 방식의 손쉬운 Setup
• 직관적인 GUI 모니터링
• 관리의 민첩성과 신뢰성이 증가
• Active Data Guard Provides
• 저비용 고품질 HA 시스템(TCO 감소)
• Business 연속성을 보장(BCM)
• 운영 DB의 작업을 분산시켜 성능 향상