系统环境:
操作系统:RedHat EL5
Cluster: Oracle GI(Grid Infrastructure)
Oracle: Oracle 11.2.0.1.0
如图所示:RAC 系统架构
Oracle RAC是一个DataBase可以通过多个Instance访问,每个节点都有一个Instance,所有的Instance对共享的存储都有读写的权限,在共享存储上可以存放Datafile、controlfile、redolog、spfile、archive log等文件。
RAC的共享存储一般可以采用OCFS和ASM方式,Oracle推荐首选ASM存储方式。
二、配置RAC共享存储(all nodes)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
1 、首先在linux下要安装ASM驱动软件
[root @node1 ~]# uname -a
Linux node1 2.6 . 18 - 194 .el5 # 1 SMP Tue Mar 16 21 : 52 : 43 EDT 2010 i686 i686 i386 GNU/Linux
[root @node1 asm]# ls -l
total 236
-rwxr--r-- 1 500 500 130018 May 9 2012 oracleasm- 2.6 . 18 - 194 .el5- 2.0 . 5 - 1 .el5.i686.rpm
-rwxr--r-- 1 500 500 13929 Apr 11 2010 oracleasmlib- 2.0 . 4 - 1 .el5.i386.rpm
-rwxr--r-- 1 500 500 85382 Apr 11 2010 oracleasm-support- 2.1 . 3 - 1 .el5.i386.rpm
安装软件注意要和系统的内核相匹配,并且 32 位的内核要选择i386/i686, 64 位要选择 64 位的软件包
[root @node1 asm]# rpm -ivh *
warning: oracleasm- 2.6 . 18 - 194 .el5- 2.0 . 5 - 1 .el5.i686.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [ 100 %]
1 :oracleasm-support ########################################### [ 33 %]
2 :oracleasm- 2.6 . 18 - 194 .el########################################### [ 67 %]
3 :oracleasmlib ########################################### [ 100 %]
2 、建立共享磁盘分区
[root @node1 asm]# fdisk -l
Disk /dev/sdb: 22.7 GB, 22769827840 bytes
255 heads, 63 sectors/track, 2768 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 125 1004031 83 Linux
/dev/sdb2 126 2768 21229897 + 5 Extended
/dev/sdb5 126 250 1004031 83 Linux
/dev/sdb6 251 375 1004031 83 Linux
/dev/sdb7 376 874 4008186 83 Linux
/dev/sdb8 875 1373 4008186 83 Linux
/dev/sdb9 1374 1872 4008186 83 Linux
/dev/sdb10 1873 2371 4008186 83 Linux
/dev/sdb11 2372 2496 1004031 83 Linux
/dev/sdb12 2497 2621 1004031 83 Linux
/dev/sdb13 2622 2768 1180746 83 Linux
ASM DISK 可以通过Linux分区或raw设备建立!
3 、建立ASM DISK
[root @node1 soft]# service oracleasm configure
Configuring the Oracle ASM library driver. This will configure the on-boot properties of the Oracle ASM library driver. The following questions will determine whether the driver is loaded on boot and what permissions it will have. The current values will be shown in brackets ( '[]' ). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort. Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done Initializing the Oracle ASMLib driver: [ OK ] Scanning the system for Oracle ASMLib disks: [ OK ]
[root @node1 soft]#
建立oracle asm 磁盘: [root @node1 soft]# service oracleasm
Usage: /etc/init.d/oracleasm {start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status} [root @node1 soft]# service oracleasm createdisk OCR_VOTE1 /dev/sdb1
Marking disk "OCR_VOTE1" as an ASM disk: [ OK ]
[root @node1 soft]# service oracleasm createdisk OCR_VOTE2 /dev/sdb5
Marking disk "OCR_VOTE2" as an ASM disk: [ OK ]
[root @node1 soft]# service oracleasm createdisk OCR_VOTE3 /dev/sdb6
Marking disk "OCR_VOTE3" as an ASM disk: [ OK ]
11G RAC将ocr和vote disk存放在ASM diskgroup管理,如果建立normal redundancy需要 3 块盘
[root @node1 soft]# service oracleasm createdisk ASM_DATA1 /dev/sdb7
Marking disk "ASM_DATA1" as an ASM disk: [ OK ]
[root @node1 soft]# service oracleasm createdisk ASM_DATA2 /dev/sdb8
Marking disk "ASM_DATA2" as an ASM disk: [ OK ]
ASM_DATA1,ASM_DATA2 用于建立存储database的diskgroup [root @node1 soft]# service oracleasm createdisk ASM_RCY1 /dev/sdb9
Marking disk "ASM_RCY1" as an ASM disk: [ OK ]
[root @node1 soft]# service oracleasm createdisk ASM_RCY2 /dev/sdb10
Marking disk "ASM_RCY2" as an ASM disk: [ OK ]
ASM_RCY1,ASM_RCY2用于创建存储recovery area的diskgroup [root @node1 soft]# service oracleasm listdisks
ASM_DATA1 ASM_DATA2 ASM_RCY1 ASM_RCY2 OCR_VOTE1 OCR_VOTE2 OCR_VOTE3 在其他节点: [root @node2 asm]# service oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [ OK ]
[root @node2 asm]# service oracleasm listdisks
ASM_DATA1 ASM_DATA2 ASM_RCY1 ASM_RCY2 OCR_VOTE1 OCR_VOTE2 OCR_VOTE3 |
@至此,在RAC下的共享存储配置完成!
本文转自 客居天涯 51CTO博客,原文链接:http://blog.51cto.com/tiany/1423004,如需转载请自行联系原作者