學習ASM技術(三)--diskgroup管理
1、刪除disk
SQL> select group_number, name from v$asm_diskgroup;
GROUP_NUMBER NAME
---------------------------- ------------------
1 ASM_DISKGROUP
SQL> select path, name from v$asm_disk where group_number=1;
PATH NAME
------------------------------ ------------------------------
/dev/raw/raw5 ASM_DISKGROUP_0004
/dev/raw/raw4 ASM_DISKGROUP_0003
/dev/raw/raw3 ASM_DISKGROUP_0002
/dev/raw/raw2 ASM_DISKGROUP_0001
/dev/raw/raw1 ASM_DISKGROUP_0000
SQL>alter diskgroup ASM_DISKGROUP drop disk asm_diskgroup_0004;
SQL>alter diskgroup ASM_DISKGROUP drop disk asm_diskgroup_0003;
2、建立新的diskgroup
SQL> select name, path, mode_status, state from v$asm_disk;
NAME PATH MODE_ST STATE
------------------------------ ------------------------------ ------- --------
/dev/raw/raw6 ONLINE NORMAL
/dev/raw/raw5 ONLINE NORMAL
/dev/raw/raw4 ONLINE NORMAL
ASM_DISKGROUP_0002 /dev/raw/raw3 ONLINE NORMAL
ASM_DISKGROUP_0001 /dev/raw/raw2 ONLINE NORMAL
ASM_DISKGROUP_0000 /dev/raw/raw1 ONLINE NORMAL
SQL>create diskgroup dg1 external redundancy disk '/dev/raw/raw4';
SQL> select name, state, type, total_mb, free_mb from v$asm_diskgroup;
NAME STATE TYPE TOTAL_MB FREE_MB
------------------------------ ----------- ------ ---------- ----------
ASM_DISKGROUP MOUNTED NORMAL 15072 14919
DG1 MOUNTED EXTERN 5024 4974
SQL>drop diskgroup dg1;
SQL> create diskgroup dg1 normal redundancy
2 failgroup f1 disk '/dev/raw/raw4'
3 failgroup f2 disk '/dev/raw/raw5';
在建立diskgroup有三個選項:external, normal和high redunancy,具體在使用中,如果使用中高階儲存裝置,通常磁碟映象在硬體級別就完成了,所以在建立diskgroup採用external,normal則至少需要兩個磁碟,high則是三個磁碟,通常用於低端儲存裝置。
3、新增disk到現有的diskgroup
SQL>alter diskgroup ASM_DISKGROUP add disk
'/dev/raw/raw6' name ASM_DISKGROUP_0003;
刪除failure group 下的所有disk
SQL>alter diskgroup dg1 drop disks in failgroup f2;
檢查disk狀態,f2下的磁碟處於hung狀態
SQL> select group_number,disk_number,name,failgroup,state from v$asm_disk;
4、重新設定disk大小
alter diskgroup asm_diskgroup resize disk ASM_DISKGROUP_0001 size 800m;
5、將diskgroup進行dismount和mount
SQL> select name, state from v$asm_diskgroup;
NAME STATE
------------------------------------- ---------------
ASM_DISKGROUP MOUNTED
DG1 MOUNTED
SQL>alter diskgroup dg1 dismount;
SQL> alter diskgroup asm_diskgroup dismount;
SQL> select name, state from v$asm_diskgroup;
NAME STATE
------------------------------------- ---------------
ASM_DISKGROUP DISMOUNTED
DG1 DISMOUNTED
SQL> alter diskgroup dg1 mount;
SQL>alter diskgroup asm_diskgroup mount;
SQL> select name, state from v$asm_diskgroup;
NAME STATE
------------------------------------- ---------------
ASM_DISKGROUP MOUNTED
DG1 MOUNTEDx`
6、冗餘性考慮
我們在建立diskgroup沒有指定failure group, failure group 自動在自己盤重建。但我們要注意指定failure group 時,每個failure group中的盤數量和大小要一致,避免空間浪費。
在ASM的diskgroup中,第一個被分配的file extents,作為primary extent,其他作為second extents,在10g中,預設都是先讀primary extents,但在11g,我們可以設定prefered read 特性,主要解決了RAC的兩個節點中,節點1優先讀取primary extent,節點2優先讀取second extents,提高I/O效能
7、disk partnership
在normal和high redundancy diskgroup中,磁碟故障切換備用盤的資訊可查詢x$kfdpartner.
SQL> select name, disk_number
from v$asm_disk
where GROUP_NUMBER=2
order by 2;
NAME DISK_NUMBER
----------------------------------- -------------------------
ASM_DISKGROUP_0000 0
ASM_DISKGROUP_0001 1
ASM_DISKGROUP_0002 2
SQL> select disk, NUMBER_KFDPARTNER from x$kfdpartner;
DISK NUMBER_KFDPARTNER
----------------- -----------------------------------
0 1
0 2
1 0
1 2
2 0
2 1
可以看到磁碟1的parner是磁碟2和磁碟3.
SQL> select group_number, name from v$asm_diskgroup;
GROUP_NUMBER NAME
---------------------------- ------------------
1 ASM_DISKGROUP
SQL> select path, name from v$asm_disk where group_number=1;
PATH NAME
------------------------------ ------------------------------
/dev/raw/raw5 ASM_DISKGROUP_0004
/dev/raw/raw4 ASM_DISKGROUP_0003
/dev/raw/raw3 ASM_DISKGROUP_0002
/dev/raw/raw2 ASM_DISKGROUP_0001
/dev/raw/raw1 ASM_DISKGROUP_0000
SQL>alter diskgroup ASM_DISKGROUP drop disk asm_diskgroup_0004;
SQL>alter diskgroup ASM_DISKGROUP drop disk asm_diskgroup_0003;
2、建立新的diskgroup
SQL> select name, path, mode_status, state from v$asm_disk;
NAME PATH MODE_ST STATE
------------------------------ ------------------------------ ------- --------
/dev/raw/raw6 ONLINE NORMAL
/dev/raw/raw5 ONLINE NORMAL
/dev/raw/raw4 ONLINE NORMAL
ASM_DISKGROUP_0002 /dev/raw/raw3 ONLINE NORMAL
ASM_DISKGROUP_0001 /dev/raw/raw2 ONLINE NORMAL
ASM_DISKGROUP_0000 /dev/raw/raw1 ONLINE NORMAL
SQL>create diskgroup dg1 external redundancy disk '/dev/raw/raw4';
SQL> select name, state, type, total_mb, free_mb from v$asm_diskgroup;
NAME STATE TYPE TOTAL_MB FREE_MB
------------------------------ ----------- ------ ---------- ----------
ASM_DISKGROUP MOUNTED NORMAL 15072 14919
DG1 MOUNTED EXTERN 5024 4974
SQL>drop diskgroup dg1;
SQL> create diskgroup dg1 normal redundancy
2 failgroup f1 disk '/dev/raw/raw4'
3 failgroup f2 disk '/dev/raw/raw5';
在建立diskgroup有三個選項:external, normal和high redunancy,具體在使用中,如果使用中高階儲存裝置,通常磁碟映象在硬體級別就完成了,所以在建立diskgroup採用external,normal則至少需要兩個磁碟,high則是三個磁碟,通常用於低端儲存裝置。
3、新增disk到現有的diskgroup
SQL>alter diskgroup ASM_DISKGROUP add disk
'/dev/raw/raw6' name ASM_DISKGROUP_0003;
刪除failure group 下的所有disk
SQL>alter diskgroup dg1 drop disks in failgroup f2;
檢查disk狀態,f2下的磁碟處於hung狀態
SQL> select group_number,disk_number,name,failgroup,state from v$asm_disk;
4、重新設定disk大小
alter diskgroup asm_diskgroup resize disk ASM_DISKGROUP_0001 size 800m;
5、將diskgroup進行dismount和mount
SQL> select name, state from v$asm_diskgroup;
NAME STATE
------------------------------------- ---------------
ASM_DISKGROUP MOUNTED
DG1 MOUNTED
SQL>alter diskgroup dg1 dismount;
SQL> alter diskgroup asm_diskgroup dismount;
SQL> select name, state from v$asm_diskgroup;
NAME STATE
------------------------------------- ---------------
ASM_DISKGROUP DISMOUNTED
DG1 DISMOUNTED
SQL> alter diskgroup dg1 mount;
SQL>alter diskgroup asm_diskgroup mount;
SQL> select name, state from v$asm_diskgroup;
NAME STATE
------------------------------------- ---------------
ASM_DISKGROUP MOUNTED
DG1 MOUNTEDx`
6、冗餘性考慮
我們在建立diskgroup沒有指定failure group, failure group 自動在自己盤重建。但我們要注意指定failure group 時,每個failure group中的盤數量和大小要一致,避免空間浪費。
在ASM的diskgroup中,第一個被分配的file extents,作為primary extent,其他作為second extents,在10g中,預設都是先讀primary extents,但在11g,我們可以設定prefered read 特性,主要解決了RAC的兩個節點中,節點1優先讀取primary extent,節點2優先讀取second extents,提高I/O效能
7、disk partnership
在normal和high redundancy diskgroup中,磁碟故障切換備用盤的資訊可查詢x$kfdpartner.
SQL> select name, disk_number
from v$asm_disk
where GROUP_NUMBER=2
order by 2;
NAME DISK_NUMBER
----------------------------------- -------------------------
ASM_DISKGROUP_0000 0
ASM_DISKGROUP_0001 1
ASM_DISKGROUP_0002 2
SQL> select disk, NUMBER_KFDPARTNER from x$kfdpartner;
DISK NUMBER_KFDPARTNER
----------------- -----------------------------------
0 1
0 2
1 0
1 2
2 0
2 1
可以看到磁碟1的parner是磁碟2和磁碟3.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/354732/viewspace-627700/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 學習ASM技術(二)--diskgroup管理ASM
- 學習ASM技術(八)--ASM操作原理ASM
- 學習ASM技術(八)--ASM操作原理. 續ASM
- 【ASM學習】ASM 管理ASM
- ASM管理 - 如何重新命名diskgroupASM
- 學習ASM技術(完結篇)--常用ASM命令ASM
- 學習ASM技術(七)--ASM檔案轉化ASM
- 學習ASM技術(六)-- ASMCMD命令列ASM命令列
- 學習ASM技術(一)--環境搭建ASM
- 學習ASM技術(五)--檔名和TemplateASM
- 學習ASM技術(四)--條帶化原理和rebalanceASM
- Asm diskgroup 的修復ASM
- script of check repair ASM DISKGROUPAIASM
- 給ASM例項增加diskgroupASM
- ASM學習筆記_磁碟的管理ASM筆記
- Using FTP Transferring Non-ASM Datafiles to ASM diskgroupFTPASM
- 【ASM學習】ASM文件ASM
- 全面學習和應用ORACLE ASM特性--(2)管理asm磁碟OracleASM
- docker技術學習Docker
- 如何學習技術?
- oracle asm diskgroup add datafile error problemOracleASMError
- 新建或修改ASM diskgroup 的問題ASM
- ASM 學習ASM
- 《深入react技術棧》學習筆記(三)漫談ReactReact筆記
- How to move ASM database files from one diskgroup to anotherASMDatabase
- votedisk在ASM diskgroup上的存放規律ASM
- 如何學習新技術
- docker技術沙龍學習Docker
- 技術學習網站學習網站
- 攝影技術學習
- 【Web技術學習】PHP學習筆記WebPHP筆記
- 檢查asm磁碟組狀態的檢視v$asm_diskgroupASM
- 技術團隊管理筆記(三)-用人筆記
- 探祕技術專案管理(三)(轉)專案管理
- Linux 磁碟對應 ASM diskgroup 中的磁碟LinuxASM
- 在ASM Diskgroup間移動資料檔案ASM
- 向ASM diskgroup中新增磁碟的例行檢查ASM
- ASM Diskgroup Can Not Be Shown When Creating Database With DBCAASMDatabase