Oracle 11gR2構(gòu)建RAC之(2)--配置共享存儲(chǔ)
十載的荔城網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。網(wǎng)絡(luò)營(yíng)銷推廣的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整荔城建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。創(chuàng)新互聯(lián)公司從事“荔城網(wǎng)站設(shè)計(jì)”,“荔城網(wǎng)站推廣”以來(lái),每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
系統(tǒng)環(huán)境:
操作系統(tǒng):RedHat EL5
Cluster: Oracle GI(Grid Infrastructure)
Oracle: Oracle 11.2.0.1.0
如圖所示:RAC 系統(tǒng)架構(gòu)
Oracle RAC是一個(gè)DataBase可以通過(guò)多個(gè)Instance訪問(wèn),每個(gè)節(jié)點(diǎn)都有一個(gè)Instance,所有的Instance對(duì)共享的存儲(chǔ)都有讀寫的權(quán)限,在共享存儲(chǔ)上可以存放Datafile、controlfile、redolog、spfile、archive log等文件。
RAC的共享存儲(chǔ)一般可以采用OCFS和ASM方式,Oracle推薦首選ASM存儲(chǔ)方式。
二、配置RAC共享存儲(chǔ)(all nodes)
1、首先在linux下要安裝ASM驅(qū)動(dòng)軟件 [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 安裝軟件注意要和系統(tǒng)的內(nèi)核相匹配,并且32位的內(nèi)核要選擇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、建立共享磁盤分區(qū) [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 可以通過(guò)Linux分區(qū)或raw設(shè)備建立! 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 ('[]'). Hittingwithout 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 用于建立存儲(chǔ)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用于創(chuàng)建存儲(chǔ)recovery area的diskgroup [root@node1 soft]# service oracleasm listdisks ASM_DATA1 ASM_DATA2 ASM_RCY1 ASM_RCY2 OCR_VOTE1 OCR_VOTE2 OCR_VOTE3 在其他節(jié)點(diǎn): [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下的共享存儲(chǔ)配置完成!