asm磁碟管理篇
linux上asm新增磁碟方法
劃分磁碟
[root@localhost init.d]# fdisk /dev/sdd
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1): 130
Last cylinder or +size or +sizeM or +sizeK (130-261, default 261):
Using default value 261
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (1-261, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-129, default 129):
Using default value 129
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost init.d]# fdisk -l
skiping................
Disk /dev/sdd: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 130 261 1060290 83 Linux
/dev/sdd2 1 129 1036161 83 Linux
Partition table entries are not in disk order
[root@localhost init.d]#
建立為asm磁碟
[root@localhost init.d]# ./oracleasm createdisk VOL5 /dev/sdd1
Marking disk "VOL5" as an ASM disk: [ OK ]
[root@localhost init.d]# ./oracleasm createdisk VOL6 /dev/sdd2
Marking disk "VOL6" as an ASM disk: [ OK ]
建立磁碟組
[root@localhost init.d]# su - oracle
[oracle@localhost ~]$ export ORACLE_SID=+ASM
[oracle@localhost ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 30 10:31:42 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> create diskgroup disk_group_3 normal redundancy
2 failgroup VOL6 disk 'ORCL:VOL6' name VOL6
3 failgroup VOL5 disk 'ORCL:VOL5' name vol5;
Diskgroup created.
SQL> drop diskgroup disk_group_3 including contents; 刪除磁碟組
Diskgroup dropped.
SQL>
--把asm劃分磁碟加到已經存在的磁碟組裡,
SQL> l
1* alter diskgroup disk_group_1 add disk 'ORCL:VOL5'
SQL> /
Diskgroup altered.
刪除新增的磁碟
SQL> l
1 select group_number,disk_number,name,label,path from v$asm_disk
2*
SQL> /
GROUP_NUMBER DISK_NUMBER NAME LABEL PATH
------------ ----------- ----- ----- ----------
0 0 VOL6 ORCL:VOL6
1 0 VOL1 VOL1 ORCL:VOL1
1 1 VOL2 VOL2 ORCL:VOL2
2 0 VOL3 VOL3 ORCL:VOL3
2 1 VOL4 VOL4 ORCL:VOL4
1 2 VOL5 VOL5 ORCL:VOL5
SQL> alter diskgroup disk_group_1 drop disk VOL5;
Diskgroup altered.
select group_number,disk_number,bytes_written/1024/1024 from v$asm_disk_stat
1 0 79.74072265625
1 1 77.85791015625
2 0 41.99072265625
2 1 41.99072265625
1 2 3.8515625
其中disk2中的vol5可以縮小到4MB;
也可以寫一個resize,如果太小,會報錯如下
SQL> alter diskgroup disk_group_1 resize disk VOL5 size 3M;
alter diskgroup disk_group_1 resize disk VOL5 size 3M
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15037: disk 'ORCL:VOL5' is smaller than mimimum of 4 MBs
SQL> c /3/4
1* alter diskgroup disk_group_1 resize disk VOL5 size 4M
SQL> /
Diskgroup altered.
其中第二組都是41MB,因此可以一次設定為50MB;
SQL> alter diskgroup disk_group_2 resize all size 50M;
Diskgroup altered.
come from:http://blog.chinaunix.net/u/16743/showart_1981462.html
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-680400/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ASM 管理篇ASM
- ASM之磁碟建立及管理ASM
- ASM 磁碟、目錄的管理ASM
- 有效管理 ASM 磁碟組空間ASM
- ASM學習筆記_磁碟的管理ASM筆記
- 全面學習和應用ORACLE ASM特性--(2)管理asm磁碟OracleASM
- ASM的管理----刪除和新增磁碟組ASM
- 【ASM】如何建立ASM磁碟ASM
- ASM之建立ASM磁碟ASM
- ASM磁碟頭ASM
- ASM 增加磁碟ASM
- Oracle asm磁碟中新加磁碟OracleASM
- asm 磁碟組 增刪磁碟組ASM
- Linux udev 動態管理Oracle ASM磁碟-實驗LinuxdevOracleASM
- ASM之磁碟組中目錄檔案的管理ASM
- ASM磁碟組限制ASM
- asm磁碟normal模式ASMORM模式
- ASM磁碟大小限制ASM
- 如何建立ASM磁碟ASM
- asm 磁碟切換ASM
- 全面學習和應用ORACLE ASM特性--(5)管理asm磁碟中的檔案OracleASM
- 【ASM】Oracle asm磁碟被格式化,如何掛載該磁碟組ASMOracle
- 遷移ASM磁碟組ASM
- 配置ASM磁碟-轉載ASM
- ASM磁碟頭比較ASM
- asm新增刪除磁碟ASM
- ASM下更換磁碟ASM
- asm 磁碟更換記ASM
- Unix/Linux 系統自動化管理: 磁碟管理篇Linux
- 【ASM】ASM磁碟頭被重寫,如何修復ASM
- 【ASM】Oracle asm刪除磁碟組注意事項ASMOracle
- ASM磁碟組更換磁碟的操作方法ASM
- Linux 磁碟對應 ASM diskgroup 中的磁碟LinuxASM
- 在ASM磁碟組中刪除一個磁碟ASM
- 新增磁碟多連路磁碟併為ASM磁碟組擴容ASM
- asm新增和刪除磁碟ASM
- 揭祕ASM磁碟頭資訊ASM
- ASM 磁碟頭資訊備份ASM