Part II Kmall DBS HA design and Implementation english
1. 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
2. 1 Kmall Database System Analysis and Design
2
3
3
Summary
Kmall Database System Implementation
High Availability Testing
4
Outline
6. 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
9. 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
10. 1 Kmall Database System Analysis and Design
2
3
3
Summary
Kmall Database System Implementation
High Availability Testing
4
Outline
11. Node name Role OS CPU RAM Storage
Interface1
(private)
Interface2
(pubic)
Node01 Primary
Oracle Solaris
10 1/13 (64bit)
2x2.66Ghz 2048MB 30GB e1000g1 e1000g2
Node02 Primary
Oracle Solaris
10 1/13 (6bit)
2x2.66Ghz 2048MB 30GB e1000g1 e1000g2
Node_stby01 Standby
Oracle 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
NodeShareStorageNetwork
Hardware
Configuration
12. #e100g0 - PUBLIC
192.168.56.11 node01.kmall.com node01
192.168.56.12 node02.kmall.com node02
#VIP
192.168.56.101 node01-vip.kmall.com node01-vip
192.168.56.102 node02-vip.kmall.com node02-vip
#e1000g1 - PRIVATE
2.0.0.11 node01-priv.kmall.com node01-priv
2.0.0.12 node02-priv.kmall.com node02-priv
#scan-ip
192.168.56.51 rac-scan.kmall.com rac-scan
192.168.56.52 rac-scan.kmall.com rac-scan
192.168.56.53 rac-scan.kmall.com rac-scan
OS Group : oinstall, dba,
asmadmin,asmdba,asmoper
User
Name
Initial
Group
OS
Group
Description
grid oinstall asmadmin
asmdba
asmoper
Grid Infrastructure
owner
oracle oinstall dba
asmdba
RDBMS owner
Users & Groups
Network 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
15. Node DB role DB Name DB SID DB Unique Name
Node01
Primary kmalldb
Kmalldb1
Kmalldb_prim
Node02 Kmalldb2
Node_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
16. $ 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
SQL> SELECT NAME,NETWORK_NAME, CREATION_DATE, GOAL, DTP,
AQ_HA_NOTIFICATION FROM V$SERVICES;
NAME NETWORK_NAME CREATION GOAL D
-------------------- --------------- --------- ------------ -
kmall_report kmall_report 21-NOV-14 NONE N
kmall_inner kmall_inner 21-NOV-14 NONE N
kmall_app kmall_app 21-NOV-14 NONE N
kmalldbXDB kmalldbXDB 17-NOV-14 NONE N
kmalldb_prim.kmall.com kmalldb_prim.kmall.com 19-NOV-14 NONE N
SYS$BACKGROUND 20-NOV-09 NONE
SYS$USERS 20-NOV-09 NONE N
6 rows selected.
Add Service
Query Service
Service
Configuration
17. 1 Kmall Database System Analysis and Design
2
3
3
Summary
Kmall Database System Implementation
High Availability Testing
4
Outline
19. 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';