RAC数据库添加ASM磁盘组(1)

注:下列操作#开头的为root用户执行,$开头的为oracle用户执行

1、准备工作

新加入的磁盘 需要首先 进行分区操作, 首先通过fdisk -l命令查看需要处理的磁盘:

[root@jssdbn1 ~]#  fdisk -l

.........................

.........................

Disk /dev/sdf: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdf doesn't contain a valid partition table

Disk /dev/sdg: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdg doesn't contain a valid partition table

/dev/sdf 和/dev/sdg为新加入的两个磁盘,经以 上信息可以看到,新加入的sdf和sdg均未分区,下面就通过fdisk命令对这两个磁盘进行分区,操作如下(基本上,所需要输入了就是n,p,1,w几个字符):

[root@jssdbn1 ~]#  fdisk /dev/sdf

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel. Changes will remain in memory only,

until you decide to write them. After that, of course, the previous

content won't be recoverable.

The number of cylinders for this disk is set to 1044.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

   (e.g., DOS FDISK, OS/2 FDISK)

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help):  n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4):  1

First cylinder (1-1044, default 1): 

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): 

Using default value 1044

Command (m for help):  w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

sdg 也做相同的处理, 这里不再演示。另外提示一下,由于操作的磁盘 是共享的存储 设备 ,因此只需要在集群中的一个节点中操作即可 。

操作完成后,通过fdisk -l命令 再次 查看当前的分区:

[root@jssdbn1 ~]#  fdisk -l

Disk /dev/sda: 16.1 GB, 16106127360 bytes

255 heads, 63 sectors/track, 1958 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1          13      104391   83  Linux

/dev/sda2              14        1958    15623212+  8e  Linux LVM

......................

..........................

Disk /dev/sdf: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sdf1               1        1044     8385898+  83  Linux

Disk /dev/sdg: 8589 MB, 8589934592 bytes

255 heads, 63 sectors/track, 1044 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

/dev/sdg1               1        1044     8385898+  83  Linux

分区完成了,接下来我们需要配置oracle用户和oinstall组对裸设备的权限,操作过的朋友应当还有印象,没错,这里我们通过/etc/udev/rules.d/60-raw.rules配置文件来进行相关的设置,具体操作如下:

  • [root@jssdbn1 ~]# 
vi /etc/udev/rules.d/60-raw.rules 

设置内容如下:

ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"

ACTION=="add", KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw2 %N"

ACTION=="add", KERNEL=="sdd1",RUN+="/bin/raw /dev/raw/raw3 %N"

ACTION=="add", KERNEL=="sde1",RUN+="/bin/raw /dev/raw/raw4 %N"

ACTION=="add", KERNEL=="sdf1",RUN+="/bin/raw /dev/raw/raw5 %N"

ACTION=="add", KERNEL=="sdg1",RUN+="/bin/raw /dev/raw/raw6 %N"

KERNEL=="raw[1-6]", OWNER="oracle", GROUP="oinstall", MODE="0660"

然后重新启动udev,再查看设置是否已生效:

[root@jssdbn1 ~]#  start_udev 

Starting udev: [  OK  ]

[root@jssdbn1 ~]#  ls /dev/raw* -l

crw------- 1 root root 162, 0 Jan 15 07:35 /dev/rawctl

/dev/raw:

total 0

crw-rw---- 1 oracle oinstall 162, 1 Jan 15 07:52 raw1

crw-rw---- 1 oracle oinstall 162, 2 Jan 15 07:52 raw2

crw-rw---- 1 oracle oinstall 162, 3 Jan 15 07:52 raw3

crw-rw---- 1 oracle oinstall 162, 4 Jan 15 07:52 raw4

crw-rw---- 1 oracle oinstall 162, 5 Jan 15 07:51 raw5

crw-rw---- 1 oracle oinstall 162, 6 Jan 15 07:51 raw6

查看当前存在的ASM磁盘:

[root@jssdbn1 ~]#  /etc/init.d/oracleasm listdisks

VOL1

VOL2

创建两个新的磁盘,操作如下:

[root@jssdbn1 ~]#  /etc/init.d/oracleasm createdisk VOL3 /dev/sdf1

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

[root@jssdbn1 ~]#  /etc/init.d/oracleasm createdisk VOL4 /dev/sdg1

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

节点1操作完成后,转到节点2上查看:

[root@jssdbn2 ~]#  /etc/init.d/oracleasm scandisks

Scanning the system for Oracle ASMLib disks: [  OK  ]

[root@jssdbn2 ~]#  /etc/init.d/oracleasm listdisks

VOL1

VOL2

VOL3

VOL4

从上述信息 看到,节点2也 已经 正常同步节点1的操作结果。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7607759/viewspace-625450/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/7607759/viewspace-625450/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值