solaris 10_oracle10g asm_create_alter_diskgroup相關命令

wisdomone1發表於2009-11-25
SQL> create diskgroup dg2 external redundancy disk '/dev/rdsk/c0d1s5';---建立磁碟組,如果不加name選項,系統會自動生成一個值,對應v$asm_disk的name

Diskgroup created.

SQL> alter diskgroup dg2 add disk '/dev/rdsk/c0d1s0' name dg2_new_disk;   ---向磁碟組新增磁碟(報這個錯可能這個磁碟已被使用)
alter diskgroup dg2 add disk '/dev/rdsk/c0d1s0' name dg2_new_disk
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15201: disk /dev/rdsk/c0d1s0 contains a valid RDBMS file


SQL> alter diskgroup dg2 add disk '/dev/rdsk/c0d1s6' name dg2_new_disk;---新增磁碟到磁碟組成功,注意name後跟有的v$asm_disk的name值,不是實際對應的format分割槽

Diskgroup altered.

SQL> select a.name,a.path from v$asm_disk a where a.group_number in(select b.group_number from v$asm_diskgroup b where b.name='DG2');
 ---檢視以上磁碟組的磁碟資訊(path就是磁碟對應的format分割槽資訊)
NAME
------------------------------
PATH
--------------------------------------------------------------------------------
DG2_0001
/dev/rdsk/c0d1s3

DG2_0000
/dev/rdsk/c0d1s5

DG2_NEW_DISK
/dev/rdsk/c0d1s6


SQL> alter diskgroup dg2 drop disk '/dev/rdsk/c0d1s6';    ---此處報錯是disk後跟v$asm_disk的name值,而非format分割槽
alter diskgroup dg2 drop disk '/dev/rdsk/c0d1s6'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15054: disk "/DEV/RDSK/C0D1S6" does not exist in diskgroup "DG2"


SQL> /
alter diskgroup dg2 drop disk '/dev/rdsk/c0d1s6'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15054: disk "/DEV/RDSK/C0D1S6" does not exist in diskgroup "DG2"


SQL> alter diskgroup dg2 drop disk '/dev/rdsk/c0d1s6' force;
alter diskgroup dg2 drop disk '/dev/rdsk/c0d1s6' force
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15054: disk "/DEV/RDSK/C0D1S6" does not exist in diskgroup "DG2"


SQL> alter diskgroup dg2 drop diskalter diskgroup dg2 drop disk '/dev/rdsk/c0d1s5';              
alter diskgroup dg2 drop diskalter diskgroup dg2 drop disk '/dev/rdsk/c0d1s5'
                         *
ERROR at line 1:
ORA-00905: missing keyword


SQL> alter diskgroup dg2 drop disk '/dev/rdsk/c0d1s5';
alter diskgroup dg2 drop disk '/dev/rdsk/c0d1s5'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15054: disk "/DEV/RDSK/C0D1S5" does not exist in diskgroup "DG2"


SQL> select a.name,a.path from v$asm_disk a where a.group_number in(select b.group_number from v$asm_diskgroup b where b.name='DG2');

NAME
------------------------------
PATH
--------------------------------------------------------------------------------
DG2_0001
/dev/rdsk/c0d1s3

DG2_0000
/dev/rdsk/c0d1s5

DG2_NEW_DISK
/dev/rdsk/c0d1s6


SQL> alter diskgroup dg2 drop disk dg2_new_disk;--成功刪除從磁碟組中去除一個磁碟

Diskgroup altered.

SQL> select a.name,a.path from v$asm_disk a where a.group_number in(select b.group_number from v$asm_diskgroup b where b.name='DG2');

NAME
------------------------------
PATH
--------------------------------------------------------------------------------
DG2_0001
/dev/rdsk/c0d1s3

DG2_0000
/dev/rdsk/c0d1s5


SQL> drop diskgroup dg2 including contents;---刪除磁碟組

Diskgroup dropped.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-620561/,如需轉載,請註明出處,否則將追究法律責任。

相關文章