管理不到位,坑会有很多
归档空间满了,哦?这我熟
看看是否有dg
sho parameter log
没有的话就清理
delete noprompt archivelog until time 'sysdate-3';
但是客户要求不能清理(难道有ogg?)
当然先确认一下
查告警日志的确有归档失败异常
那就看一下归档设置
archive log list;
一看是 +DATA ,就知道管理不到位了,通常应该是+archdg
清理
不让清理就拷贝后删除
将部分归档日志先拷贝出来,释放一部分空间,解决燃眉之急(后面还有好几个燃眉的地方)
用grid执行asmcmd
asmcmd里的 cp 命令可以直接将磁盘组上的归档文件复制到磁盘上
复制了十几个比较早的,但是这些归档文件大小较小,基本都是30多M
不对劲
检查归档历史
-
set pages 100
-
BREAK ON report
-
COMPUTE sum label 'total' avg label 'avg' max label 'max' min label 'min' OF G ON report
-
select * from (select to_char(COMPLETION_TIME,'yyyy-mm-dd ') dt,round(sum(BLOCKS *BLOCK_SIZE)/1024/1024/1024) G,count(0) cnt from
-
v$archived_log where dest_id=1 group by to_char(COMPLETION_TIME,'yyyy-mm-dd ')) order by 1;
比较规律,不是常见的突增大量归档
再检查asm磁盘组使用率
-
col name for a15
-
select name,trunc((total_mb-free_mb)/1024) used_g,trunc(total_mb/1024) total_g, trunc(free_mb/1024) free_g,round(1-free_mb/total_mb,2) used_percent from v$asm_diskgroup order by used_percent desc ;
发现+data磁盘组剩余182G,怎么会不够?
再看每个磁盘free_mb ,有几个128G的,然后有个500G的组成了+data
-
set lin 200
-
col path for a30
-
col name for a20
-
select GROUP_NUMBER,DISK_NUMBER, MODE_STATUS,HEADER_STATUS, MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;
DATA_0002 剩余空间为0了,应该是冗余度保护策略导致不允许插入新数据。
改造
存储划分一个新的500G磁盘,添加到+data,然后将4个128G的创建为+arch
-
确认采用oracleasm管理的磁盘
-
oracleasm status
-
-
cd /dev/oracleasm/disks/
-
ls -l
-
-
col name for a15
-
col library for a30
-
col path for a34
-
set lin 120 pages 100
-
select name, library, path from v$asm_disk;
-
--library 应该是 ASM Library Generic Linux
-
-
/etc/init.d/oracleasm listdisks
-
/etc/init.d/oracleasm scandisks
-
-
/etc/init.d/oracleasm querydisk /dev/sdg1
-
/etc/init.d/oracleasm querydisk VOL1
-
-
/etc/init.d/oracleasm createdisk VOL2 /dev/sdb2
-
/etc/init.d/oracleasm deletedisk VOL1
-
-
fdisk /dev/sddlmaf
lsblk
oracleasm createdisk ASM_DATA6 /dev/sddlmaf1
添加删除磁盘,炫技一下
-
--添加同时删除
-
alter diskgroup data add disk '/dev/oracleasm/disks/ASM_DATA6' drop disk 'DATA_0000','DATA_0001','DATA_0002','DATA_0003' REBALANCE POWER 11;
等了40分钟,有3个128G的始终无法删除 v$asm_operation也空了,为啥?
排查
asm的告警日志有些古怪
ocrcheck
crsctl query css votedisk
这些文件居然放到了+data里!
所以不让删除
由于DATA_0000、DATA_0001
、DATA_0002一直处于DROPPING状态,先撤回删除操作
alter diskgroup +data undrop disks ;
等了20分钟
考虑到风险较大,全备数据库
又等了20分钟
搬家
将ocr vote文件,从+data移动到+ocr_vote里
-
手工备份ocr
-
ocrconfig -manualbackup
-
-
先添加一个新磁盘组(本来该在的地方)
-
ocrconfig -add +OCR_VOTE
-
-
确认无误
-
ocrcheck
-
-
再删除旧的(从+data里删掉)
-
ocrconfig -delete +data
-
-
移动vote
-
crsctl query css votedisk
-
-
确认vote在哪个磁盘上
-
select DISK_NUMBER,REDUNDANCY,name,FAILGROUP,VOTING_FILE from v$asm_disk;
-
-
crsctl replace votedisk +OCR_VOTE
-
-
移动asm的spfile (实际为执行,应该是停掉asm实例再执行,考虑到影响不大,就未调整)
-
create pfile='/tmp/asmpfile.ora' from spfile;
-
create spfile='+OCR_VOTE' from pfile='/tmp/asmpfile.ora';
-
-
asmcmd spget
-
asmcmd spmove '+DATA/tzdb-cluster/asmparameterfile/registry.253.976405429' '+OCR_VOTE/tzdb-cluster/spfileASM.ora'
再执行删除
alter diskgroup data drop disk 'DATA_0000','DATA_0001','DATA_0002' REBALANCE POWER 11;
又等了20分钟
创建arch磁盘组
create diskgroup arch external redundancy disk '/dev/oracleasm/disks/ASM_DATA1','/dev/oracleasm/disks/ASM_DATA2','/dev/oracleasm/disks/ASM_DATA3','/dev/oracleasm/disks/ASM_DATA4';
在节点2 mount 磁盘组arch
alter diskgroup arch mount;
修改归档位置
create pfile='/tmp/a.ora' from spfile;
sho parameter reco
alter system set log_archive_dest_1='location=+arch' sid='*';
滚动重启crs,正常!
一个归档满,牵扯出这么多问题:
归档文件不应该与数据存放在一个磁盘组
磁盘组内的磁盘大小应该一致
ocr、vote应该存放在专用的磁盘组中
自己的收获:
oracleasm绑定磁盘有些生疏
删除磁盘之前最好看看内容、状态
熟悉了移动ocr vote步骤
undrop disks回滚时间不短呀
提醒注意:
创建新asm磁盘组,其他节点需要mount一下
删除归档后顺手 crosscheck
后期清理这些临时备份、移出来的归档、+data里的旧归档
参考:
-
select GROUP_NUMBER,DISK_NUMBER, MODE_STATUS,HEADER_STATUS,
-
MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;
-
-
select name,COMPATIBILITY,DATABASE_COMPATIBILITY,state,type from v$asm_diskgroup;
-
--alter diskgroup OCR_VOTE set attribute 'compatible.asm'='11.2';
-
select DISK_NUMBER,REDUNDANCY,name,FAILGROUP,VOTING_FILE from v$asm_disk;
-
-
https://blog.csdn.net/u010692693/article/details/49617153
-
https://www.cnblogs.com/wenxiao1-2-3-4/p/15732052.html
-
ORA-15250 : ASM disk in DROPPING state with same command doing add and drop (Doc ID 1918438.1)
阅读(580) | 评论(0) | 转发(0) |