ASM之磁碟建立及管理
ASM之磁碟建立及管理
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1.檢視ASM配置磁碟搜尋資訊
SQL> show parameter instance_type
asm例項系統
NAME TYPE VALUE
------------------------------------ ---------------------- ----------
instance_type string asm
普通例項系統
NAME TYPE VALUE
------------------------------------ ----------- ---------
instance_type string RDBMS
SQL> show parameter asm_diskst
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2.使用oracleasm建立磁碟
[root@oradb ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdd1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@oradb ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd2
Marking disk "VOL2" as an ASM disk: [ OK ]
[root@oradb ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sde1
Marking disk "VOL3" as an ASM disk: [ OK ]
[root@oradb ~]# /etc/init.d/oracleasm createdisk VOL4 /dev/sde2
Marking disk "VOL4" as an ASM disk: [ OK ]
[root@oradb ~]# /etc/init.d/oracleasm listdisks VOL1 VOL2 VOL3 VOL4
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3.建立磁碟組語法
CREATE DISKGROUP diskgroup_name [ { HIGH | NORMAL | EXTERNAL } REDUNDANCY ] [ FAILGROUP failgroup_name ] DISK [ NAME disk_name ] [ SIZE size_clause ] [ FORCE | NOFORCE ] ...;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4.建立磁碟組
SQL> create diskgroup DG1 normal redundancy disk '/dev/oracleasm/disks/VOL1' name VOL1;
create diskgroup DG1 normal redundancy disk '/dev/oracleasm/disks/VOL1' name VOL1 * 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 DG1 normal redundancy 2 disk '/dev/oracleasm/disks/VOL1' name DG1_VOL1 ,'/dev/oracleasm/disks/VOL2' name DG1_VOL2;
SQL>
create diskgroup DG2 normal redundancy
failgroup FG1 disk '/dev/oracleasm/disks/VOL3' name DG2_FG1_VOL3
failgroup FG2 disk '/dev/oracleasm/disks/VOL4' name DG2_FG2_VOL4;
--使用標準冗餘建立磁碟組DG2
SQL> create diskgroup DG_ext external redundancy disk '/dev/oracleasm/disks/VOL10' name DG_ext_VOL10; --外部冗餘
SQL>
select group_number gno,name,state,type,total_mb,free_mb,
required_mirror_free_mb rmfmb,usable_file_mb ufmb
from v$asm_diskgroup;
--檢視建立的磁碟組
GNO NAME STATE
---------- ------------------------------------------------------------ ----------------------
TYPE TOTAL_MB FREE_MB RMFMB UFMB
------------ ---------- ---------- ---------- ----------
1 BACK MOUNTED
EXTERN 2047 26 0 26
2 DATA MOUNTED
EXTERN 2047 0 0 0
3 OCR MOUNTED
NORMAL 6141 5215 2047 1584
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5.磁碟組新增故障組和成員
--為非故障組新增成員
SQL> alter diskgroup DG1 add disk '/dev/oracleasm/disks/VOL5' name DG1_VOL5;
--為DG2新增一個故障組FG3及成員
SQL> alter diskgroup DG2 add failgroup FG3 disk '/dev/oracleasm/disks/VOL6' name DG2_FG3_VOL6;
--新增故障組及成員 --為DG2的個故障組各新增一個成員
SQL>
alter diskgroup DG2
add failgroup FG1 disk '/dev/oracleasm/disks/VOL7'
add failgroup FG2 disk '/dev/oracleasm/disks/VOL8'
add failgroup FG3 disk '/dev/oracleasm/disks/VOL9';
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6.刪除磁碟組中的磁碟,故障組中的成員,磁碟組
SQL> alter diskgroup DG1 drop disk DG1_VOL5; --刪除磁碟組DG1中的磁碟VOL5
SQL> alter diskgroup DG2 drop disk DG2_0003; --刪除故障組中的單個成員
SQL> alter diskgroup DG2 drop disks in failgroup FG3; --刪除故障組及所有成員,注意此時為drop disks 複數形式
SQL>
alter diskgroup DG1 drop disk DG1_VOL4
add failgroup FG3 disk '/dev/oracleasm/disks/VOL9' name DG1_VOL11;
--刪除磁碟組中的磁碟,同時新增故障組FG3
SQL> drop diskgroup DG1; --刪除磁碟組
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7.調整磁碟組的容量
----故障組FG3的容量將被調整到G,如果磁碟空間不足,則調整失敗
SQL> alter diskgroup DG2 resize disks in failgroup FG3 size 10G;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8.手動Rebalance
SQL> alter diskgroup DG2 rebalance power 3 wait;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9.磁碟組的載入與解除安裝及內部一致性檢查
SQL> alter diskgroup all dismount;
SQL> alter diskgroup DG2 mount;
SQL> alter diskgroup DG2 check all;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10.檢視磁碟組的partner
SQL> select name,state,type from v$asm_diskgroup where group_number=3; --檢視磁碟組DG3的資訊
SQL> select grp,disk,number_kfdpartner from x$kfdpartner where grp=3; --磁碟組DG3使用了個磁碟,且冗餘度為標準冗餘 3 0 2
--磁碟組的partner 為磁碟組,2 3 1 0
--磁碟組的partner 為磁碟組,2 3 1 2 3 2 0
--磁碟組的partner 為磁碟組,1 3 2 1
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1.檢視ASM配置磁碟搜尋資訊
SQL> show parameter instance_type
asm例項系統
NAME TYPE VALUE
------------------------------------ ---------------------- ----------
instance_type string asm
普通例項系統
NAME TYPE VALUE
------------------------------------ ----------- ---------
instance_type string RDBMS
SQL> show parameter asm_diskst
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2.使用oracleasm建立磁碟
[root@oradb ~]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdd1
Marking disk "VOL1" as an ASM disk: [ OK ]
[root@oradb ~]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd2
Marking disk "VOL2" as an ASM disk: [ OK ]
[root@oradb ~]# /etc/init.d/oracleasm createdisk VOL3 /dev/sde1
Marking disk "VOL3" as an ASM disk: [ OK ]
[root@oradb ~]# /etc/init.d/oracleasm createdisk VOL4 /dev/sde2
Marking disk "VOL4" as an ASM disk: [ OK ]
[root@oradb ~]# /etc/init.d/oracleasm listdisks VOL1 VOL2 VOL3 VOL4
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3.建立磁碟組語法
CREATE DISKGROUP diskgroup_name [ { HIGH | NORMAL | EXTERNAL } REDUNDANCY ] [ FAILGROUP failgroup_name ] DISK [ NAME disk_name ] [ SIZE size_clause ] [ FORCE | NOFORCE ] ...;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4.建立磁碟組
SQL> create diskgroup DG1 normal redundancy disk '/dev/oracleasm/disks/VOL1' name VOL1;
create diskgroup DG1 normal redundancy disk '/dev/oracleasm/disks/VOL1' name VOL1 * 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 DG1 normal redundancy 2 disk '/dev/oracleasm/disks/VOL1' name DG1_VOL1 ,'/dev/oracleasm/disks/VOL2' name DG1_VOL2;
SQL>
create diskgroup DG2 normal redundancy
failgroup FG1 disk '/dev/oracleasm/disks/VOL3' name DG2_FG1_VOL3
failgroup FG2 disk '/dev/oracleasm/disks/VOL4' name DG2_FG2_VOL4;
--使用標準冗餘建立磁碟組DG2
SQL> create diskgroup DG_ext external redundancy disk '/dev/oracleasm/disks/VOL10' name DG_ext_VOL10; --外部冗餘
SQL>
select group_number gno,name,state,type,total_mb,free_mb,
required_mirror_free_mb rmfmb,usable_file_mb ufmb
from v$asm_diskgroup;
--檢視建立的磁碟組
GNO NAME STATE
---------- ------------------------------------------------------------ ----------------------
TYPE TOTAL_MB FREE_MB RMFMB UFMB
------------ ---------- ---------- ---------- ----------
1 BACK MOUNTED
EXTERN 2047 26 0 26
2 DATA MOUNTED
EXTERN 2047 0 0 0
3 OCR MOUNTED
NORMAL 6141 5215 2047 1584
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5.磁碟組新增故障組和成員
--為非故障組新增成員
SQL> alter diskgroup DG1 add disk '/dev/oracleasm/disks/VOL5' name DG1_VOL5;
--為DG2新增一個故障組FG3及成員
SQL> alter diskgroup DG2 add failgroup FG3 disk '/dev/oracleasm/disks/VOL6' name DG2_FG3_VOL6;
--新增故障組及成員 --為DG2的個故障組各新增一個成員
SQL>
alter diskgroup DG2
add failgroup FG1 disk '/dev/oracleasm/disks/VOL7'
add failgroup FG2 disk '/dev/oracleasm/disks/VOL8'
add failgroup FG3 disk '/dev/oracleasm/disks/VOL9';
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6.刪除磁碟組中的磁碟,故障組中的成員,磁碟組
SQL> alter diskgroup DG1 drop disk DG1_VOL5; --刪除磁碟組DG1中的磁碟VOL5
SQL> alter diskgroup DG2 drop disk DG2_0003; --刪除故障組中的單個成員
SQL> alter diskgroup DG2 drop disks in failgroup FG3; --刪除故障組及所有成員,注意此時為drop disks 複數形式
SQL>
alter diskgroup DG1 drop disk DG1_VOL4
add failgroup FG3 disk '/dev/oracleasm/disks/VOL9' name DG1_VOL11;
--刪除磁碟組中的磁碟,同時新增故障組FG3
SQL> drop diskgroup DG1; --刪除磁碟組
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7.調整磁碟組的容量
----故障組FG3的容量將被調整到G,如果磁碟空間不足,則調整失敗
SQL> alter diskgroup DG2 resize disks in failgroup FG3 size 10G;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8.手動Rebalance
SQL> alter diskgroup DG2 rebalance power 3 wait;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9.磁碟組的載入與解除安裝及內部一致性檢查
SQL> alter diskgroup all dismount;
SQL> alter diskgroup DG2 mount;
SQL> alter diskgroup DG2 check all;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
10.檢視磁碟組的partner
SQL> select name,state,type from v$asm_diskgroup where group_number=3; --檢視磁碟組DG3的資訊
SQL> select grp,disk,number_kfdpartner from x$kfdpartner where grp=3; --磁碟組DG3使用了個磁碟,且冗餘度為標準冗餘 3 0 2
--磁碟組的partner 為磁碟組,2 3 1 0
--磁碟組的partner 為磁碟組,2 3 1 2 3 2 0
--磁碟組的partner 為磁碟組,1 3 2 1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29500582/viewspace-1356563/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ASM之建立ASM磁碟ASM
- ASM 磁碟組的建立及擴容ASM
- 【ASM】如何建立ASM磁碟ASM
- 如何建立ASM磁碟ASM
- ASM之建立ASM例項及ASM資料庫ASM資料庫
- asm磁碟管理篇ASM
- 建立ASM磁碟有兩種方式!ASM
- Oracle下建立ASM磁碟總結OracleASM
- oracle rac 無法建立asm磁碟OracleASM
- ASM之磁碟組中目錄檔案的管理ASM
- ASM 磁碟、目錄的管理ASM
- ASM之建立ASM例項ASM
- RAC之grid叢集安裝及ASM磁碟組配置ASM
- 有效管理 ASM 磁碟組空間ASM
- 使用CREATE DISKGROUP語句建立ASM磁碟組,提示找不到相應的ASM磁碟ASM
- 建立ASM例項及ASM資料庫ASM資料庫
- ASM學習筆記_磁碟的管理ASM筆記
- asm磁碟組建立錯誤,用中轉儲存,重建磁碟組ASM
- 全面學習和應用ORACLE ASM特性--(2)管理asm磁碟OracleASM
- ASM的管理----刪除和新增磁碟組ASM
- HDFS系列之DataNode磁碟管理解析及實踐!
- RAC建立ASM單個磁碟不能操作2TASM
- 建立ASM磁碟組報錯ORA-15063ASM
- ASM磁碟頭ASM
- ASM 增加磁碟ASM
- Oracle asm磁碟中新加磁碟OracleASM
- dbca建立oracle 11g rac發現不了asm磁碟OracleASM
- 【資料遷移】RMAN遷移資料庫到ASM(一)建立ASM磁碟組資料庫ASM
- ASM之建立ASM例項時的常見故障ASM
- asm 磁碟組 增刪磁碟組ASM
- 在ASM磁碟組之間移動檔案ASM
- Linux udev 動態管理Oracle ASM磁碟-實驗LinuxdevOracleASM
- ASM磁碟組限制ASM
- asm磁碟normal模式ASMORM模式
- ASM磁碟大小限制ASM
- asm 磁碟切換ASM
- 建立asm磁碟 報錯 oracleasm-write-label: Unable to clear deviceASMOracledev
- 全面學習和應用ORACLE ASM特性--(5)管理asm磁碟中的檔案OracleASM