linux下新增ASM磁碟

StudyCow發表於2008-07-09

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部落格 ” ,連結:http://blog.itpub.net/7839206/viewspace-1007029/,如需轉載,請註明出處,否則將追究法律責任。

相關文章