Oracle 11gR2构建RAC之(2)--配置共享存储
系统环境:
操作系统: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、首先在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下的共享存储配置完成!