ITPub博客

首页 > Linux操作系统 > Linux操作系统 > asm 磁盘切换

asm 磁盘切换

原创 Linux操作系统 作者:babyyellow 时间:2012-04-28 17:36:41 0 删除 编辑
计划本周做 asm 磁盘的切换准备工作,上周已经做好了lun的划分工作,

sunha5_n 包括两个磁盘组, sunha5_f1, sunha5_f2  ,我们原定的分别跨在两个存储上,

前段时间,因为磁盘空间紧张,临时添加磁盘空间打破了这种格局,对维护带来一定的难度,需要调整回去,本次操作的目的在于此

删除  sunha5_n_0000 磁盘,添加一个新磁盘代替之。 

先是删除很轻松

01  1* select name, failgroup ,path from v$asm_disk where name is not null order by name
02SYS AS SYSDBA at +ASM > /
03 
04NAME                 FAILGROUP       PATH
05-------------------- --------------- --------------------------------------------------
06SUNHA5_N_0000        SUNHA5_F2       /dev/rdsk/c4t6006016010511E008C4BB66773C4DF11d0s6
07SUNHA5_N_0001        SUNHA5_F2       /dev/rdsk/c4t6006016023912800BA383E8BACBADF11d0s6
08SUNHA5_N_0002        SUNHA5_F2       /dev/rdsk/c4t6006016023912800B02840888FB1DF11d0s6
09SUNHA5_N_0003        SUNHA5_F2       /dev/rdsk/c4t60060160239128008E54346EACBADF11d0s6
10SUNHA5_N_0004        SUNHA5_F1       /dev/rdsk/c4t6006016010511E00128706D3AABADF11d0s6
11SUNHA5_N_0005        SUNHA5_F1       /dev/rdsk/c4t6006016010511E002D5FFF791CB9DF11d0s6
12SUNHA5_N_0006        SUNHA5_F1       /dev/rdsk/c4t6006016010511E007C165A71C0A5DF11d0s6
13SUNHA5_N_0007        SUNHA5_F1       /dev/rdsk/c4t6006016010511E00E4F60988C0A5DF11d0s6
14SUNHA5_N_0008        SUNHA5_F2       /dev/rdsk/c4t6006016023912800CBCB861C1FB9DF11d0s6
15SUNHA5_N_0009        SUNHA5_F1       /dev/rdsk/c4t6006016010511E008E4BB66773C4DF11d0s6


1SYS AS SYSDBA at +ASM > alter diskgroup sunha5_n   drop disk SUNHA5_N_0000 ;
2 
3Diskgroup altered.


添加新磁盘 
01SYS AS SYSDBA at +ASM > alter diskgroup sunha5_n  add  failgroup sunha5_f2 disk '/dev/rdsk/c4t6006016023912800AE557B32B813E011d0s6';
02alter diskgroup sunha5_n  add  failgroup sunha5_f2 disk '/dev/rdsk/c4t6006016023912800AE557B32B813E011d0s6'
03*
04ERROR at line 1:
05ORA-15032: not all alterations performed
06ORA-15010: name is already used by an existing ASM disk
07 
08 
09SYS AS SYSDBA at +ASM > edit
10Wrote file afiedt.buf
11"afiedt.buf" 2 DD£?110 ×?·?
12 
13alter diskgroup sunha5_n  add  failgroup sunha5_f2 disk '/dev/rdsk/c4t6006016023912800AF557B32B813E011d0s6'
14/
15~

系统报错,无法添加磁盘 ,问题出在哪里呢? 

这个错误时报 asm   磁盘的 名 被占用,为新加磁盘指定磁盘名,当时,无法确定是什么问题,于是决定先回滚
01SYS AS SYSDBA at +ASM > alter diskgroup sunha5_n undrop disks;
02 
03Diskgroup altered.
04 
05  1* select name,failgroup,path from v$asm_disk order by failgroup ,name
06SYS AS SYSDBA at +ASM > /
07 
08NAME                 FAILGROUP       PATH
09-------------------- --------------- --------------------------------------------------
10SUNHA5_N_0004        SUNHA5_F1       /dev/rdsk/c4t6006016010511E00128706D3AABADF11d0s6
11SUNHA5_N_0005        SUNHA5_F1       /dev/rdsk/c4t6006016010511E002D5FFF791CB9DF11d0s6
12SUNHA5_N_0006        SUNHA5_F1       /dev/rdsk/c4t6006016010511E007C165A71C0A5DF11d0s6
13SUNHA5_N_0007        SUNHA5_F1       /dev/rdsk/c4t6006016010511E00E4F60988C0A5DF11d0s6
14SUNHA5_N_0009        SUNHA5_F1       /dev/rdsk/c4t6006016010511E008E4BB66773C4DF11d0s6
15SUNHA5_N_0000        SUNHA5_F2       /dev/rdsk/c4t6006016010511E008C4BB66773C4DF11d0s6
16SUNHA5_N_0001        SUNHA5_F2       /dev/rdsk/c4t6006016023912800BA383E8BACBADF11d0s6
17SUNHA5_N_0002        SUNHA5_F2       /dev/rdsk/c4t6006016023912800B02840888FB1DF11d0s6
18SUNHA5_N_0003        SUNHA5_F2       /dev/rdsk/c4t60060160239128008E54346EACBADF11d0s6
19SUNHA5_N_0008        SUNHA5_F2       /dev/rdsk/c4t6006016023912800CBCB861C1FB9DF11d0s6
20 
21  磁盘又找回来了


进过确认,发现新增的磁盘是新开的lun 没有使用过,不存在什么问题,权限也够,问题应该是出在asm 上

1SYS AS SYSDBA at +ASM > select * from v$asm_operation;
2 
3GROUP_NUMBER OPERATION  STATE         POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES
4------------ ---------- -------- ---------- ---------- ---------- ---------- ---------- -----------
5           2 REBAL      RUN               1          1      23154      95589       1470          49

原来删除了之后,系统自动发动了rebalance 操作,先前发出的三处的命令,并没有真正的删除磁盘,需要先吧这个磁盘的数据,移动到其他盘上,才会真正的删除磁盘,而asm 分配新加磁盘的命令是指派的asm 磁盘名称总是从最小没有使用的磁盘名开始,
 导致  把 sunha5_n-0000  分给了新磁盘  而旧盘还没有从cache中清理掉,导致了冲突。

知道了原因就好办了,为了节省rebalance 的时间,我们采用了先加盘,然后再删除盘,  有个缺点会导致当前命令窗口阻塞。 
1SYS AS SYSDBA at +ASM >alter diskgroup  sunha5_n
2add failgroup sunha5_f2 disk '/dev/rdsk/c4t6006016023912800AE557B32B813E011d0s6'
3name 'SUNHA5_N_0010' reba
4lance wait
5/


另开一个窗口 删除磁盘sunha5_n_0000

01SYS AS SYSDBA at +ASM > col name for a20
02SYS AS SYSDBA at +ASM > col path for a50
03SYS AS SYSDBA at +ASM > col failgroup for a10
04SYS AS SYSDBA at +ASM > select name ,failgroup ,path from v$asm_disk where name is not null order by failgroup ,name;
05 
06NAME                 FAILGROUP  PATH
07-------------------- ---------- --------------------------------------------------
08SUNHA5_N_0004        SUNHA5_F1  /dev/rdsk/c4t6006016010511E00128706D3AABADF11d0s6
09SUNHA5_N_0005        SUNHA5_F1  /dev/rdsk/c4t6006016010511E002D5FFF791CB9DF11d0s6
10SUNHA5_N_0006        SUNHA5_F1  /dev/rdsk/c4t6006016010511E007C165A71C0A5DF11d0s6
11SUNHA5_N_0007        SUNHA5_F1  /dev/rdsk/c4t6006016010511E00E4F60988C0A5DF11d0s6
12SUNHA5_N_0009        SUNHA5_F1  /dev/rdsk/c4t6006016010511E008E4BB66773C4DF11d0s6
13SUNHA5_N_0000        SUNHA5_F2  /dev/rdsk/c4t6006016010511E008C4BB66773C4DF11d0s6
14SUNHA5_N_0001        SUNHA5_F2  /dev/rdsk/c4t6006016023912800BA383E8BACBADF11d0s6
15SUNHA5_N_0002        SUNHA5_F2  /dev/rdsk/c4t6006016023912800B02840888FB1DF11d0s6
16SUNHA5_N_0003        SUNHA5_F2  /dev/rdsk/c4t60060160239128008E54346EACBADF11d0s6
17SUNHA5_N_0008        SUNHA5_F2  /dev/rdsk/c4t6006016023912800CBCB861C1FB9DF11d0s6
18SUNHA5_N_0010        SUNHA5_F2  /dev/rdsk/c4t6006016023912800AE557B32B813E011d0s6
19新磁盘已经添加上去了
20 
21 
22SYS AS SYSDBA at +ASM > alter diskgroup sunha5_n drop disk SUNHA5_N_0000;
23 
24 
25Diskgroup altered.
26删掉旧盘
27SYS AS SYSDBA at +ASM > select * from v$asm_operation ;
28 
29GROUP_NUMBER OPERATION  STATE         POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES
30------------ ---------- -------- ---------- ---------- ---------- ---------- ---------- -----------
31           1 REBAL      RUN               1          1       4802     121171       1850          62
32 
33 
34SYS AS SYSDBA at +ASM > alter diskgroup sunha5_n rebalance power 5 ;
35 
36Diskgroup altered.
37并行rebalance 
38SYS AS SYSDBA at +ASM > select * from v$asm_operation ;
39 
40GROUP_NUMBER OPERATION  STATE         POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES
41------------ ---------- -------- ---------- ---------- ---------- ---------- ---------- -----------
42           1 REBAL      RUN               5          5         72      86286       1993         


运行过程中,我们的asm 磁盘组检查代码成功的检测到asm磁盘故障。 


NAME                   STATE        MOUNT_STAT       PATH                                                 TOTAL(GB)   USED%                                                         
--------------------   ----------   --------------   --------------------------------------------------   ---------   ----------                                                    
SUNHA5_N_0000          DROPPING     CACHED           /dev/rdsk/c4t6006016010511E008C4BB66773C4DF11d0s6        99.75   36.8                                                          
SUNHA5_N_0001          NORMAL       CACHED           /dev/rdsk/c4t6006016023912800BA383E8BACBADF11d0s6        99.75   80.49                                                         
SUNHA5_N_0002          NORMAL       CACHED           /dev/rdsk/c4t6006016023912800B02840888FB1DF11d0s6        99.75   80.49                                                         
SUNHA5_N_0003          NORMAL       CACHED           /dev/rdsk/c4t60060160239128008E54346EACBADF11d0s6        99.75   80.5                                                          
SUNHA5_N_0004          NORMAL       CACHED           /dev/rdsk/c4t6006016010511E00128706D3AABADF11d0s6        99.75   80.49                                                         
SUNHA5_N_0005          NORMAL       CACHED           /dev/rdsk/c4t6006016010511E002D5FFF791CB9DF11d0s6        99.75   80.49                                                         
SUNHA5_N_0006          NORMAL       CACHED           /dev/rdsk/c4t6006016010511E007C165A71C0A5DF11d0s6        99.75   80.49                                                         
SUNHA5_N_0007          NORMAL       CACHED           /dev/rdsk/c4t6006016010511E00E4F60988C0A5DF11d0s6        99.75   80.49                                                         
SUNHA5_N_0008          NORMAL       CACHED           /dev/rdsk/c4t6006016023912800CBCB861C1FB9DF11d0s6        99.75   80.49                                                         
SUNHA5_N_0009          NORMAL       CACHED           /dev/rdsk/c4t6006016010511E008E4BB66773C4DF11d0s6        99.75   80.49                                                         
SUNHA5_N_0010          NORMAL       CACHED           /dev/rdsk/c4t6006016023912800AE557B32B813E011d0s6        99.75   43.69          


最后终于完成了
01  1* select name ,failgroup ,path from v$asm_disk where name is not null order by failgroup,name
02SYS AS SYSDBA at +ASM > /
03 
04NAME                 FAILGROUP  PATH
05-------------------- ---------- --------------------------------------------------
06SUNHA5_N_0004        SUNHA5_F1  /dev/rdsk/c4t6006016010511E00128706D3AABADF11d0s6
07SUNHA5_N_0005        SUNHA5_F1  /dev/rdsk/c4t6006016010511E002D5FFF791CB9DF11d0s6
08SUNHA5_N_0006        SUNHA5_F1  /dev/rdsk/c4t6006016010511E007C165A71C0A5DF11d0s6
09SUNHA5_N_0007        SUNHA5_F1  /dev/rdsk/c4t6006016010511E00E4F60988C0A5DF11d0s6
10SUNHA5_N_0009        SUNHA5_F1  /dev/rdsk/c4t6006016010511E008E4BB66773C4DF11d0s6
11SUNHA5_N_0001        SUNHA5_F2  /dev/rdsk/c4t6006016023912800BA383E8BACBADF11d0s6
12SUNHA5_N_0002        SUNHA5_F2  /dev/rdsk/c4t6006016023912800B02840888FB1DF11d0s6
13SUNHA5_N_0003        SUNHA5_F2  /dev/rdsk/c4t60060160239128008E54346EACBADF11d0s6
14SUNHA5_N_0008        SUNHA5_F2  /dev/rdsk/c4t6006016023912800CBCB861C1FB9DF11d0s6
15SUNHA5_N_0010        SUNHA5_F2  /dev/rdsk/c4t6006016023912800AE557B32B813E011d0s6

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/133735/viewspace-722451/,如需转载,请注明出处,否则将追究法律责任。

上一篇: vim 学习利器
请登录后发表评论 登录
全部评论
oracle MySQL Postgresql 专职数据库dba。 系统架构师。 mysql 官方认知dba 。 15年专职dba 经验。

注册时间:2010-12-02

  • 博文量
    232
  • 访问量
    1419841