ASM學習筆記_磁碟的管理

gdutllf2006發表於2010-05-17

ASM學習筆記_磁碟的管理

DISKGROUP的所有管理操作,都必須要求DISKGROUP的狀態為Mount

1 Create Diskgroup
create diskgroup data external redundancy disk '/dev/raw/raw1','/dev/raw/raw2';

2 ADD Disk
ALTER DISKGROUP DATA add disk '/dev/raw/raw3' rebalance power 3 wait;

3 Drop DiskGroup

When you drop a disk group, ASM dismounts the disk group and removes the disk group name from the ASM_DISKGROUPS initialization parameter if a server parameter file is being used.
Drop的過程是: 先Dismount,再移除資訊

Drop 之前, diskgroup必須是Mount狀態

drop diskgroup test [excluding |including contents];


例子:
連檔案一起刪除.default is exluding
SQL> drop diskgroup test including contents;

Diskgroup dropped.

SQL> select a.name, b.name, a.state from v$ASM_diskgroup a , v$asm_disk b where a.group_number = b.group_number;

NAME                           NAME                           STATE
------------------------------ ------------------------------ ----------
TEST                           VOL1                           MOUNTED

為什麼刪除後狀態還是Mount?


4 DROP Disk
ALTER DISKGROUP DATA drop disk XXX  rebalance power 3 wait;

5 REBALANCE
ALTER DISKGROUP DATA REBALANCE POWER 5 WAIT;

6 Monunt and Dismount
Alter Diskgroup data mount
Alter Diskgroup data dismount

Dismount某個DiskGroup的時候,這個DiskGroup Can't contain open file.

RAC環境下ASM 的兩個例項之間關係怎麼樣的?
刪除與狀態的改變無關

在Node1:
alter diskgroup test dismount;

SQL> select a.name, b.name, a.state from v$ASM_diskgroup a , v$asm_disk b where a.group_number = b.group_number;

NAME                           NAME                           STATE
------------------------------ ------------------------------ -----------
TEST                                                          DISMOUNTED

在Node2:
SQL> select a.name diskgroup, b.name disk, a.state from v$ASM_diskgroup a , v$asm_disk b where a.group_number = b.group_number;

NAME                           NAME                           STATE
------------------------------ ------------------------------ -----------
TEST                           VOL4                           MOUNTED

不受影響.

是不是可以這樣理解: 當在某個節點Dismount disk時,只是表明不能透過這個節點來訪問disk,但另一個節點仍是可訪問磁碟的.


7 UNDROP  在Drop完成之前撤消刪除
ALTER DISKGROUP dgroup1 UNDROP DISKS;

8 RESIZE 改變大小:
ALTER DISKGROUP dgroup1 RESIZE DISKS IN FAILGROUP failgrp1 SIZE 100G;


9 Checking Internal Consistency of Disk Group Metadata 檢查並修復磁碟組後設資料
ALTER DISKGROUP dgroup1 CHECK ALL;

10 VIEW

V$ASM_DISKGROUP(在ASM instance and RDBMS instance 都有, RDBMS中只顯示ASM DiskGroup mounted by the local ASM Instance)
This view performs disk discovery every time it is queried.

V$ASM_DISK(在ASM instance and RDBMS instance 都有, RDBMS中只顯示ASM Disk mounted by the local ASM Instance)
This view performs disk discovery every time it is queried.

select a.name, b.name, a.state from v$asm_diskgroup a, v$asm_disk b where a.group_number = b.group_number

select name,total_mb, free_mb, state from v$asm_disk;


V$ASM_DISKGROUP_STAT 不做Disk Discovery
V$ASM_DISK_STAT 不做Disk Discovery

V$ASM_FILE

V$ASM_TEMPLATE

V$ASM_ALIAS

V$ASM_OPERATION

V$ASM_CLIENT


11 問題

ASM的所有管理操作到底是什麼意思呢?
add,drop, resize, mount, dismount, rebalance

在RAC環境下,在某一個節點新增/刪除會對整個資料庫的執行有影響不?

 

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

相關文章