首页 > Linux操作系统 > Linux操作系统 > linux下添加ASM磁盘
1、 1. 在磁盘上建立分区
[root@rac1 disks]# fdisk /dev/sde
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/sde: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 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-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-261, default 261):
Using default value 261
Command (m for help): p
Disk /dev/sde: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 261 2096451 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
2、使用oracleasm标识磁盘
[root@rac1 disks]# /etc/init.d/oracleasm createdisk VOL2 /dev/sde1
Marking disk "/dev/sde1" as an ASM disk: [ OK ]
[root@rac1 disks]# oracleasm querdisk VOL2
-bash: oracleasm: command not found
3、验证标识结果
[root@rac1 disks]# /etc/init.d/oracleasm querydisk VOL2
Disk "VOL2" is a valid ASM disk on device [8, 65]
[root@rac1 disks]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [ OK ]
3、在Oracle中添加磁盘到DATA磁盘组
[root@rac1 disks]# su - oracle
[oracle@rac1 ~]$ sqlplus /nolog
[oracle@rac1 ~]$ export ORACLE_SID=+ASM1
[oracle@rac1 ~]$ sqlplus /nolog
SQL*Plus: Release 11.1.0.6.0 - Production on Wed Jul 9 12:11:44 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL> connect / as sysdba;
Connected.
SQL> select path from v$asm_disk;
PATH
--------------------------------------------------------------------------------
/dev/oracleasm/disks/VOL2
/dev/oracleasm/disks/VOL1
SQL> alter diskgroup data add disk '/dev/oracleasm/disks/VOL2' name data02;
Diskgroup altered.
SQL> select group_number,disk_number ,path from v$asm_disk;
GROUP_NUMBER DISK_NUMBER PATH
------------ ----------- ------------------------------
1 0 /dev/oracleasm/disks/VOL1
1 1 /dev/oracleasm/disks/VOL2
SQL>
[@more@]
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7839206/viewspace-1007029/ ,如需转载,请注明出处,否则将追究法律责任。