如何添加磁盘到ASM的磁盘组

1. 在磁盘上建立分区
[root@node1 ~]# 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.

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

Command (m for help): p

Disk /dev/sdf: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130):
Using default value 130

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@node1 ~]# fdisk /dev/sdf

Command (m for help): p

Disk /dev/sdf: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1               1         130     1044193+  83  Linux

Command (m for help): q

2、使用oracleasm标识磁盘
[root@node1 ~]# /etc/init.d/oracleasm deletedisk VOL6
Removing ASM disk "VOL6": [  OK  ]
[root@node1 ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdf1
Marking disk "VOL3" as an ASM disk: [  OK  ]
[root@node1 ~]# ls -la /dev/oracleasm/disks
total 0
drwxr-xr-x 1 root   root     0 Mar 19 13:04 .
drwxr-xr-x 2 root   root     0 Mar 19 12:56 ..
brw-rw---- 1 oracle dba  8, 81 Mar 19 13:04 VOL3

3、验证标识结果
[root@node1 ~]# /etc/init.d/oracleasm querydisk VOL3
Disk "VOL3" is a valid ASM disk
[root@node1 ~]# /etc/init.d/oracleasm listdisks
VOL3
[root@node1 ~]#
4.在其他节点上验证结果
[root@node2 ~]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [  OK  ]
[root@node2 ~]# /etc/init.d/oracleasm listdisks
VOL3
5.在Oracle中添加磁盘到DATA磁盘组

[oracle@node1 ~]$ export ORACLE_SID=+ASM1

[oracle@node1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Mar 19 13:13:00 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> select path from v$asm_disk; 

PATH
--------------------------------------------------------------------------------
/dev/raw/raw2
ORCL:VOL3
/dev/raw/raw1
/dev/raw/raw4
/dev/raw/raw3

SQL> alter diskgroup RAC_DISK add disk 'ORCL:VOL3' name test_asm;

Diskgroup altered.

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值