如何理解ASM裡FAILGROUP的概念
FAILGROUP在asm裡是一個非常重要的概念,oracle在doc上又交待的似乎不夠清楚。
下面這篇文章是小V的總結,大家也可以參考:
http://www.itpub.net/viewthread.php?tid=1348104&extra=&highlight=failgroup&page=1
[@more@]SQL> select group_number,name,type from v$asm_diskgroup;
GROUP_NUMBER NAME TYPE
------------ ---------- ------------
1 DG1 NORMAL
2 DG2 EXTERN
SQL> select group_number,disk_number,total_mb,free_mb,name,failgroup from v$asm_disk order by group_number,disk_number,failgroup;
GROUP_NUMBER DISK_NUMBER TOTAL_MB FREE_MB NAME FAILGROUP
------------ ----------- ---------- ---------- ---------- ----------
1 0 1024 560 DG1_0000 DG1_0001
1 1 1024 558 DG1_0001 DG1_0001
1 2 2048 1120 DG1_0002 DG1_0002
2 0 1024 42 DG2_0000 DG2_0000
SQL>
--======================
SQL> select file_name,bytes from dba_data_FILES;
FILE_NAME BYTES
--------------------------------------------- ----------
+DG1/asmdb/datafile/test/system01.dbf 314572800
+DG1/asmdb/datafile/undotbs1.263.741435561 209715200
+DG1/asmdb/datafile/sysaux.264.741435571 125829120
+DG1/asmdb/datafile/users.266.741435583 5242880
+DG1/asmdb/datafile/test.dbf 10485760
SQL>
--===============================
以表空間users對應的檔案+DG1/asmdb/datafile/users.266.741435583為
例子來看asm file在disk上的data分佈以及failgroup的作用和意義
--===============================
SQL> select group_kffxp,xnum_kffxp,lxn_kffxp,disk_kffxp,failgroup
2 from x$kffxp x,v$asm_disk d
3 where number_kffxp=266 and group_kffxp=1
4 and d.disk_number=x.disk_kffxp
5 and d.group_number=x.group_kffxp
6 ;
GROUP_KFFXP XNUM_KFFXP LXN_KFFXP DISK_KFFXP FAILGROUP
----------- ---------- ---------- ---------- ----------
1 0 1 2 DG1_0002
1 3 0 2 DG1_0002
1 4 1 2 DG1_0002
1 2 0 2 DG1_0002
1 5 1 2 DG1_0002
1 1 1 2 DG1_0002
1 1 0 1 DG1_0001
1 3 1 1 DG1_0001
1 4 0 1 DG1_0001
1 2 1 0 DG1_0001
1 0 0 0 DG1_0001
1 5 0 0 DG1_0001
已選擇12行。
SQL>
--=======================================
x$kffxp全部欄位可以參考
x$kffxp裡面的欄位XNUM_KFFXP是組成asm file的au(allocate unit)的編號
LXN_KFFXP表示asm file對應的data copy的編號,0表示primary,1表示mirror
DISK_KFFXP表示disk number
從上面的查詢我們可以清楚的看到au是在2個FAILGROUP:DG1_0001和DG1_0002上各自
分配了6個,其實每個asm file的file header佔用1個au,這樣由於diskgroup dg1是
normal方式,因此其實metadata使用了2m的空間,剩下10m正好對應的是檔案
+DG1/asmdb/datafile/users.266.741435583 的大小,檔案本身是5m,由於做了mirror,所以
是10m,但是這10m是平均分佈在2個FAILGROUP裡,不管這個FAILGROUP裡包含了多少塊disk,只要
1個FAILGROUP是好用的,那麼db就可以正常使用,所以其實FAILGROUP是au和disk之間的邏輯概念
--=======================================
SQL> create diskgroup dg3 external redundancy failgroup fg1 disk 'g:asmdiskdisk5' name disk5;
create diskgroup dg3 external redundancy failgroup fg1 disk 'g:asmdiskdisk5' name disk5
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15067: command or option incompatible with diskgroup redundancy
SQL> create diskgroup dg3 external redundancy disk 'g:asmdiskdisk5' name disk5;
Diskgroup created.
SQL> create diskgroup dg4 normal redundancy failgroup fg1 disk 'g:asmdiskdisk6' name disk6;
create diskgroup dg4 normal redundancy failgroup fg1 disk 'g:asmdiskdisk6' name disk6
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15072: command requires at least 2 failure groups, discovered only 1
SQL> create diskgroup dg4 normal redundancy failgroup fg1 disk 'g:asmdiskdisk6' name disk6 failgroup fg2 disk 'g:asmdiskdisk7' name disk7;
Diskgroup created.
SQL> select group_number,failgroup from v$asm_disk;
GROUP_NUMBER FAILGROUP
------------ ----------
0
1 DG1_0002
1 DG1_0001
2 DG2_0000
1 DG1_0001
3 DISK5
4 FG1
4 FG2
8 rows selected.
SQL>
SQL> alter diskgroup dg3 add failgroup disk5 disk 'G:asmdiskDISK8' name disk8;
alter diskgroup dg3 add failgroup disk5 disk 'G:asmdiskDISK8' name disk8
*
ERROR at line 1:
ORA-15067: command or option incompatible with diskgroup redundancy
SQL> alter diskgroup dg3 add disk 'G:asmdiskDISK8' name disk8;
Diskgroup altered.
SQL>
SQL> select group_number,failgroup from v$asm_disk order by group_number;
GROUP_NUMBER FAILGROUP
------------ ----------
1 DG1_0002
1 DG1_0001
1 DG1_0001
2 DG2_0000
3 DISK8
3 DISK5
4 FG1
4 FG2
8 rows selected.
SQL>
--==========================
SQL> create tablespace test1 datafile '+dg3/test1.dbf' size 5m;
表空間已建立。
SQL>
--==========================
ASMCMD> pwd
+dg3
ASMCMD> ls
ASMDB/
test1.dbf
ASMCMD> ls -l test1.dbf
Type Redund Striped Time Sys Name
N test1.dbf => +DG3/ASMDB/DATAFILE/TEST1.256.742432737
ASMCMD>
--==================================
SQL> select group_kffxp,xnum_kffxp,lxn_kffxp,disk_kffxp,failgroup
2 from x$kffxp x,v$asm_disk d
3 where number_kffxp=256 and group_kffxp=3
4 and d.disk_number=x.disk_kffxp
5 and d.group_number=x.group_kffxp
6 ;
GROUP_KFFXP XNUM_KFFXP LXN_KFFXP DISK_KFFXP FAILGROUP
----------- ---------- ---------- ---------- ----------
3 0 0 0 DISK5
3 2 0 0 DISK5
3 4 0 0 DISK5
3 3 0 1 DISK8
3 5 0 1 DISK8
3 1 0 1 DISK8
6 rows selected.
SQL>
--===================================
oracle要求
A normal redundancy disk group must contain at least two failure groups.
A high redundancy disk group must contain at least three failure groups.
external redundancy在語法上不支援或者說不提供failgroup,但是事實上oracle內部
還是給每一個disk分配了1個failgroup,只不過external redundancy這種方式的diskgroup
裡不管有多少塊disk,也不管有多少個failgroup(最終當然是1個disk oracle給對應了一個
failgroup),只要一個failgroup包含的disk出現問題,最終使用該diskgroup的db都會出現問題,
因為該failgroup裡包含的disk上的data沒有任何mirror。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/19602/viewspace-1045623/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 關於ASM的failgroup概念的探索方法ASMAI
- ASM的FAILGROUPASMAI
- Oracle ASM 的redundancy與failgroupOracleASMAI
- ASM可以更改冗餘度&增加failgroup嗎?ASMAI
- solaris 10_oracle asm_diskgroup_failgroup_相關OracleASMAI
- ASM之ASM相關概念ASM
- Quorum FailGroupAI
- ASM部分概念的總結ASM
- 理解ASM的ExtentASM
- ORACLE概念的理解!Oracle
- linux下asm裡如何找到asm disk和os device的對應關係LinuxASMdev
- TypeScript 裡的 module 概念TypeScript
- 概念理解
- ASM 常用概念解釋ASM
- 轉:ASM理解ASM
- 理解maven的核心概念Maven
- ASM相關概念(筆記)ASM筆記
- 理解RESTful概念REST
- ASM之快速理解ASM
- webpack (1)——核心概念的理解Web
- 深入理解CRM的概念
- ASM Failure Group的一點理解ASMAI
- 有關ASM和ASMM的理解ASM
- 利用RMAN將非ASM檔案移動到ASM裡 - [ASM]ASM
- 理解 Ruby 裡的 blockBloC
- 01 elasticsearch 概念理解Elasticsearch
- Linux 概念架構的理解Linux架構
- SAP Gateway Service Builder 裡 Project 的概念GatewayUIProject
- 【ASM】如何建立ASM磁碟ASM
- RPC核心概念理解RPC
- Spring AOP概念理解Spring
- [譯] 理解 Apache Airflow 的關鍵概念ApacheAI
- 深入瞭解Oracle ASM(一):基礎概念OracleASM
- FAILGROUP和REDUNDANCY之間的關係關係!AI
- 不能為 EXTERNAL REDUNDANCY的磁碟組新增failgroup diskAI
- js裡的物件基本理解(原型)JS物件原型
- exths 裡的 Ext.getEl()的理解
- 通俗理解一些概念