part ii kmall dbs ha design and implementation english

21
Kmall.com Inc. Database System High Availability Design and Implementation Based on Oracle 11gR2 By Chip Sokear Grade 2011 class II Major: Computer Science Instructor: Sun SiLiang

Upload: sokear-chip

Post on 11-Apr-2017

163 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Part II Kmall DBS HA design and Implementation english

Kmall.com Inc. Database System High Availability Design and Implementation Based on Oracle 11gR2

By Chip SokearGrade 2011 class IIMajor: Computer ScienceInstructor: Sun SiLiang

Page 2: Part II Kmall DBS HA design and Implementation english

1 Kmall Database System Analysis and Design

2

33

Summary

Kmall Database System Implementation

High Availability Testing

4

Outline

Page 3: Part II Kmall DBS HA design and Implementation english

kmall.com

kmall.com Inc. Intro

Page 4: Part II Kmall DBS HA design and Implementation english

Kmall DBS Design

Page 5: Part II Kmall DBS HA design and Implementation english

OS: Oracle Solaris 10 (x86)

OS Selection

Page 6: Part II Kmall DBS HA design and Implementation english

Hardware: Oracle Sun Server X4-2L

X4-2L Key Features : • 2U enterprise-class server with flexible

storage options

• Intel Xeon processor E5-2600 v2

product family CPUs

• Sixteen DIMM slots

• Six PCIe 3.0 slots

• Four 10GBase-T ports

• Four Sun Flash Accelerator F80 PCIe

Cards

• Hot-swappable and redundant disks,

cooling fans, and power

Hardware Selection

Page 7: Part II Kmall DBS HA design and Implementation english

Primary DB Structure Design2 Nodes RAC

Page 8: Part II Kmall DBS HA design and Implementation english

Data Guard Design

Page 9: Part II Kmall DBS HA design and Implementation english

Service name

DB unique name

Preferred Instance Available Instance

Service goal

DB Role Description

kmall_app Kmalldb_prim kmalldb1,kmalldb2   SHORT Primary Application Server, OLTP

kmall_inner Kmalldb_prim Kmalldb2 Kmalldb1 SHORT Primary All departments inside the company

kmall_report Kmalldb_stby Kmalldb1   LONG Physical Standby

Report User Group

Service Design

Page 10: Part II Kmall DBS HA design and Implementation english

1 Kmall Database System Analysis and Design

2

33

Summary

Kmall Database System Implementation

High Availability Testing

4

Outline

Page 11: Part II Kmall DBS HA design and Implementation english

Node name Role OS CPU RAM Storage Interface1 (private)

Interface2 (pubic)

Node01 PrimaryOracle Solaris 10 1/13 (64bit)

2x2.66Ghz 2048MB 30GB e1000g1 e1000g2

Node02 PrimaryOracle Solaris 10 1/13 (6bit)

2x2.66Ghz 2048MB 30GB e1000g1 e1000g2

Node_stby01Standb

yOracle Solaris 10 1/13 (64bit)

2x2.66Ghz 2048MB 30GB e1000g1 e1000g2

Hard disk Controller Size Description

c1t0d0 SCSI 1:0 1GB OCR, Voting Disk

c1t1d0 SCSI 1:1 6GB Database File (DATA)

c1t2d0 SCSI 1:2 6GB Flash Recovery Area (FRA)

Node name Interface 1 Interface 2 Private IP Public IP

node01 E1000g0 E1000g1 2.0.0.11/24 191.168.56.11/24

node02 E1000g0 E1000g1 2.0.0.12/24 191.168.56.12/24

Nod

eS

hare

Sto

rage

Net

wor

kHardware Configuration

Page 12: Part II Kmall DBS HA design and Implementation english

#e100g0 - PUBLIC192.168.56.11 node01.kmall.com node01192.168.56.12 node02.kmall.com node02 #VIP192.168.56.101 node01-vip.kmall.com node01-vip192.168.56.102 node02-vip.kmall.com node02-vip

#e1000g1 - PRIVATE2.0.0.11 node01-priv.kmall.com node01-priv2.0.0.12 node02-priv.kmall.com node02-priv #scan-ip192.168.56.51 rac-scan.kmall.com rac-scan192.168.56.52 rac-scan.kmall.com rac-scan192.168.56.53 rac-scan.kmall.com rac-scan

OS Group : oinstall, dba, asmadmin,asmdba,asmoper

User Name

Initial Group

OSGroup

Description

grid oinstall asmadminasmdbaasmoper

Grid Infrastructure owner

oracle

oinstall dbaasmdba

RDBMS owner

Users & GroupsNetwork Configuration: /etc/hosts

Environment Prep

Hard Disk Partition Cylinders Size Blocks Description

c1t0d0 /dev/rdsk/c1t0d0s0 1-1018 1GB (1018/0/0) 2084864 OCR, Voting Disk

c1t1d0 /dev/rdsk/c1t1d0s0 1-3066 6GB (3066/0/0) 12558336 Database Files (DATA)

c1t2d0 /dev/rdsk/c1t2d0s0 1-3066 6GB (3066/0/0) 12558336 Flash Recovery Area (FRA)

Storage Configuration

Page 13: Part II Kmall DBS HA design and Implementation english

GI installation

Grid Infrastructure Installation

Page 14: Part II Kmall DBS HA design and Implementation english

RDBMS Installation

Create Kmalldb Database

RAC Installation

Page 15: Part II Kmall DBS HA design and Implementation english

Node DB role DB Name DB SID DB Unique NameNode01

Primary kmalldbKmalldb1

Kmalldb_primNode02 Kmalldb2Node_stby01 Standby kmalldb Kmalldb1 Kmalldb_stby

SQL> alter system set db_unique_name='kmalldb_prim' scope=spfile sid='*';

SQL> alter system set log_archive_config = 'DG_CONFIG=( kmalldb_prim, kmalldb_stby)' scope=both sid='*';

SQL> alter system set standby_file_management=AUTO scope=both sid='*';

SQL> alter system set log_archive_dest_2='SERVICE=kmalldb_stby VALID_

FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME= kmalldb_stby ' scope=spfile sid='*';

SQL> alter system set fal_server='kmalldb_prim' scope=spfile sid='*';

Kmall Data Guard configuration

Primary DB preparation

Data Guard Configuration

Page 16: Part II Kmall DBS HA design and Implementation english

$ srvctl add service -d kmalldb -s kmall_app -r kmalldb1,kmalldb2 -l primay -j SHORT$ srvctl add service -d kmalldb -s kmall_inner -r kmalldb2 -a kmalldb1 -l primay -j SHORT$ srvctl add service -d kmalldb -s kmall_report -r kmalldb1 -l physical_standby -j LONG

Add Service

Query Service

Service Configuration

Page 17: Part II Kmall DBS HA design and Implementation english

1 Kmall Database System Analysis and Design

2

33

Summary

Kmall Database System Implementation

High Availability Testing

4

Outline

Page 18: Part II Kmall DBS HA design and Implementation english

kmall_app = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.kmall.com)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = rac_stby-scan.kmall.com)(PORT = 1521)) (LOAD_BALANCE = yes) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = kmall_app.kmall.com) (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 100) (DELAY = 5)) ))

tnsname.ora

Sqlplus oe/oe@kmall_app

RAC TAF Testing

Page 19: Part II Kmall DBS HA design and Implementation english

Role Transition

• Data Guard Broker

DGMGRL> show configuration;DGMGRL> show database verbose kmalldb_prim ;DGMGRL> show database verbose 'kmalldb_stby’ ;DGMGRL> switchover to 'kmalldb_stby';

Page 20: Part II Kmall DBS HA design and Implementation english

RAC

ASM

DG

Summary

Page 21: Part II Kmall DBS HA design and Implementation english

Q&A