本篇内容介绍了“怎么给Oracle ASM磁盘组扩容”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
一:查看磁盘组可用空间大小:
1.
[grid
@rac1 ~]$ sqlplus / as sysasm //进入ASM实例
SQL> select name,allocation_unit_size,free_mb,total_mb from v$asm_diskgroup;
NAME ALLOCATION_UNIT_SIZE FREE_MB TOTAL_MB
OCR 1048576 29796 30722
DATA 1048576 58142 60256
2.
[grid
@rac1 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 60256 58142 0 58142 0 N DATA/
MOUNTED NORMAL N 512 4096 1048576 30722 29796 10241 9777 0 Y OCR/
二:ASM磁盘组扩容(DATA扩容)
事先准备好/dev/asm-disk5
添加磁盘:
SQL> alter diskgroup DATA add disk ‘/dev/asm-disk5’;
Diskgroup altered.
查看大小:
SQL> select name,allocation_unit_size,free_mb,total_mb from v$asm_diskgroup;
NAME ALLOCATION_UNIT_SIZE FREE_MB TOTAL_MB
OCR 1048576 29796 30722
DATA 1048576 69052 71168
删除磁盘://需要磁盘在ASM中映射的名字
SQL> alter diskgroup DATA drop disk ‘/dev/asm-disk5’;
alter diskgroup DATA drop disk ‘/dev/asm-disk5’
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15054: disk “/DEV/ASM-DISK5” does not exist in diskgroup “DATA”
SQL> select name,path from v$asm_disk_stat;
NAME PATH
OCR_0000 /dev/asm-disk2
OCR_0002 /dev/asm-disk4
OCR_0001 /dev/asm-disk3
DATA_0000 /dev/asm-disk1
DATA_0001 /dev/asm-disk5
SQL> alter diskgroup data drop disk DATA_0001;
Diskgroup altered.
SQL> select name,allocation_unit_size,free_mb,total_mb from v$asm_diskgroup;
NAME ALLOCATION_UNIT_SIZE FREE_MB TOTAL_MB
OCR 1048576 29796 30722
DATA 1048576 58142 60256
由于ASM条带化特性,添加磁盘以及删除磁盘实际就是数据重新分布Rebalance的过程。
“怎么给Oracle ASM磁盘组扩容”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注云搜网网站,小编将为大家输出更多高质量的实用文章!