程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> linux下Oracle11gRAC搭建(四)

linux下Oracle11gRAC搭建(四)

編輯:Oracle教程

linux下Oracle11g RAC搭建(四)

三、配置共享存儲

配置ASM管理准備

1)OCRDISK :存儲CRS資源配置信息

2)VOTEDISK:仲裁盤,記錄節點狀態

3)DataDisk:存放datafile、controlfile、redologfile、spfile等

4)RecoveryArea:存放flashbackdatabase log、archivelog、rmanbackup等

安裝asm軟件包

分別在node1和node2安裝

node1下:

[root@node1 ~]# cd /soft

[root@node1 soft]# ls

asm linux_11gR2_database_1of2.zip linux_11gR2_database_2of2.zip linux_11gR2_grid.zip

[root@node1 asm]# cd asm

[root@node1 asm]# ls

oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm

oracleasmlib-2.0.4-1.el5.i386.rpm

oracleasm-support-2.1.3-1.el5.i386.rpm

注意和內核版本的匹配

說明:

1、查看到asm軟件包版本2.6.18-194.el5,系統內核版本2.6.18-194.el5,兩者匹配,可以繼續安裝;

2、i386代表32位。

[root@node1 asm]# uname-a 或uname -r

//檢查系統內核版本是否和asm版本相同

Linux node1 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686i386 GNU/Linux

\

 

node1下安裝軟件包

[root@node1 asm]# rpm -ivh *

//安裝3個軟件包,i-install,v-安裝過程,h-顯示安裝信息,*-全部軟件包

\

 

[root@node1 asm]# rpm -qa |grep asm //查看安裝完成的信息
 

\

 

node2下安裝軟件包

node2下:

[root@node1 /]# scp/soft/asm/* node2:/home/oracle/

//把asm下的軟件包從node1拷貝到node2下面

[root@node1 soft]# scp -r asm node2:/home/oracle/
 

\

 

[root@node2 ~]#cd/home/oracle

[root@node2 oracle]# ls

oracleasm-2.6.18-194.el5-2.0.5-1.el5.i686.rpm

oracleasmlib-2.0.4-1.el5.i386.rpm

oracleasm-support-2.1.3-1.el5.i386.rpm

[root@node2 asm]# rpm -ivh *

\

 

1)在共享陣列上建立分區

在node1分區,完成後在node2查看

OCR+VOTE盤:3個1G

DATABASE 盤:2個5G

RECOVERY盤:2個4G

3個1G的為OCR_VOTE1盤 其中兩個為鏡像

2個5G的為ASM_DATA1盤 其中一個為鏡像

2個4G的為ASM_RCY1盤 其中一個為鏡像

[root@node1 ~]# fdisk -l

//查看磁盤信息

Disk /dev/sda: 21.4 GB, 21474836480bytes

255 heads, 63 sectors/track, 2610cylinders

Units = cylinders of 16065 * 512 =8225280 bytes

Device Boot Start End Blocks Id System

/dev/sda1 * 1 13 104391 83 Linux

/dev/sda2 14 2610 20860402+ 8e Linux LVM

Disk /dev/sdc: 22.7 GB, 22769827840bytes

255 heads, 63 sectors/track, 2768cylinders

Units = cylinders of 16065 * 512 =8225280 bytes

Disk /dev/sdc doesn't contain avalid partition table

#fdisk/dev/sdc //對sdc分區

OCR+VOTE

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p //先創建第一個主分區

Partition number (1-4): 1

First cylinder (1-2610, default 1): 1

Last cylinder or +size or +sizeM or+sizeK (1-2610, default 2610): +1024M

//表示主分區的大小為1024M,OCR盤分1G

OCR+VOTE

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p //創建第二個主分區

Partition number (1-4): 2

First cylinder (126-2610, default1):

Last cylinder or +size or +sizeM or+sizeK (126-2610, default 2610): +1024M

OCR+VOTE

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p //創建第三個主分區

Partition number (1-4): 3

First cylinder (251-2610, default 251):

Last cylinder or +size or +sizeM or+sizeK (251-2610, default 2610): +1024M

創建擴展分區

Command (m for help): n

Command action

e extended

p primary partition (1-4)

e //在創建一個擴展分區,大小為剩下的全部容量

Partition number (1-4): 4

First cylinder (376-2610, default 376):

Using default value 126

Last cylinder or +size or +sizeM or+sizeK (376-2610, default 2610):

Using default value 2610

databasearea

Command (m for help): n

Command action

l logical (5 or over) //再創建邏輯分區

p primary partition (1-4)

l

First cylinder (376-3916, default 376):

Using default value 376

Last cylinder or +size or +sizeM or+sizeK (376-3916, default 3916): +5G

databasearea

Command (m for help): n

Command action

l logical (5 or over) //再創建邏輯分區

p primary partition (1-4)

l

First cylinder (985-3916, default 985):

Using default value 985

Last cylinder or +size or +sizeM or+sizeK (985-3916, default 3916): +5G

recoveryarea

Command (m for help): n

Command action

l logical (5 or over) //再創建邏輯分區

p primary partition (1-4)

l

First cylinder (1594-3916, default 1594):

Using default value 1594

Last cylinder or +size or +sizeM or+sizeK (1594-3916, default 3916): +4G

recoveryarea

Command (m for help): n

Command action

l logical (5 or over) //再創建邏輯分區

p primary partition (1-4)

l

First cylinder (2081-3916, default 2081):

Using default value 2081

Last cylinder or +size or +sizeM or+sizeK (2081-3916, default 3916): +4G

剩余一些空間,單獨分了一個區

Command (m for help): n

Command action

l logical (5 or over) //再創建邏輯分區

p primary partition (1-4)

l

First cylinder (2568-3916, default 2568):

Using default value 2568

Last cylinder or +size or +sizeM or+sizeK (2568-3916, default 3916):

Command (m for help): p //查看分區結果
 

\

 

Command (m for help): w //保存退出

[root@node1 ~]# fdisk -l //分區結果

2)創建asm盤

配置asm 磁盤(node1、node2)

node1上

[root@node1 soft]# serviceoracleasm configure

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of theOracle ASM library

driver. Thefollowing 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 ]

node2上

[root@node2 asm]# serviceoracleasm configure

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of theOracle ASM library

driver. Thefollowing 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 ]

建立asm 磁盤(node1)

在node1上

[root@node1 soft]# serviceoracleasm

Usage: /etc/init.d/oracleasm{start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scandisks|status}

[root@node1 soft]# serviceoracleasm createdisk OCR_VOTE1 /dev/sdc1

//磁盤名用大寫

Marking disk "OCR_VOTE1" as an ASM disk:[ OK ]

[root@node1 soft]# serviceoracleasm createdisk OCR_VOTE2 /dev/sdc2

Marking disk "OCR_VOTE2" as an ASM disk:[ OK ]

[root@node1 soft]# serviceoracleasm createdisk OCR_VOTE3 /dev/sdc3

Marking disk "OCR_VOTE3" as an ASM disk:[ OK ]

[root@node1 soft]# serviceoracleasm createdisk ASM_DATA1 /dev/sdc5

Marking disk "ASM_DATA1" as an ASM disk:[ OK ]

[root@node1 soft]# serviceoracleasm createdisk ASM_DATA2 /dev/sdc6

Marking disk "ASM_DATA2" as an ASM disk:[ OK ]

[root@node1 soft]# serviceoracleasm createdisk ASM_RCY1 /dev/sdc7

Marking disk "ASM_RCY1" as an ASM disk:[ OK ]

[root@node1 soft]# serviceoracleasm createdisk ASM_RCY2 /dev/sdc8

Marking disk "ASM_RCY2" as an ASM disk:[ OK ]

[root@node1 soft]# serviceoracleasm listdisks //查看asm創建結果

ASM_DATA1

ASM_DATA2

ASM_RCY1

ASM_RCY2

OCR_VOTE1

OCR_VOTE2

OCR_VOTE3

驗證ASM磁盤信息(node2)

在node2節點掃描出磁盤,查看共享磁盤信息

[root@node2 asm]# serviceoracleasm scandisks //掃描共享磁盤asm

Scanning the system for Oracle ASMLib disks: [ OK ]

[root@node2 asm]# serviceoracleasm listdisks //查看共享盤信息

ASM_DATA1

ASM_DATA2

ASM_RCY1

ASM_RCY2

OCR_VOTE1

OCR_VOTE2

OCR_VOTE3

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved