今天监控发现,数据库服务器的一个磁盘爆满,查之发现是一级备份目录,赶紧进去看看,啥情况
1. 报错信息
1.1查看备份日志报错信息:
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 11/04/2024 06:38:01
ORA-19606: Cannot copy or restore to snapshot control file

1.2 查看rman备份配置

2. 原因分析
报错是由于执行如下脚本导致,可能是控制文件已损坏,导致无法复制或恢复到快照控制文件
RMAN> delete noprompt expired backup;
3. 解决措施:重新设置 SNAPSHOT CONTROLFILE
3.1 重新设置
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/mnt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_virdb_bak.f';

3.2 检查旧的controlfilecopy
RMAN> crosscheck controlfilecopy '/mnt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_virdb.f'; using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=1147 device type=DISK validation failed for control file copy control file copy file name=/mnt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_virdb.f RECID=1 STAMP=1013348350 Crosschecked 1 objects
3.3 删除过期controlfilecopy
RMAN> delete expired controlfilecopy '/mnt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_virdb.f';
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1147 device type=DISK
List of Control File Copies
===========================
Key S Completion Time Ckp SCN Ckp Time
------- - ------------------- ---------- -------------------
1 X 2019:07:11 13:39:10 7999072 2019:07:11 13:39:10
Name: /mnt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_virdb.f
Tag: TAG20190711T133910
Do you really want to delete the above objects (enter YES or NO)? yes
deleted control file copy
control file copy file name=/mnt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_virdb.f RECID=1 STAMP=1013348350
Deleted 1 EXPIRED objects
3.4 配置回原来目录
RMAN> CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/mnt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_virdb.f'; old RMAN configuration parameters: CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/mnt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_virdb_bak.f'; new RMAN configuration parameters: CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/mnt/oracle/product/11.2.0/dbhome_1/dbs/snapcf_virdb.f'; new RMAN configuration parameters are successfully stored
4 测试:再次执行删除过期备份,可以正常执行了
RMAN> delete noprompt obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 83965 2024:10:12 02:37:59
Backup Piece 83965 2024:10:12 02:37:59 /backup/fullbak_0j37bp6q_1_1_20241012
Backup Set 83964 2024:10:12 02:28:15
Backup Piece 83964 2024:10:12 02:28:15 /backup/fullbak_0k37bp6q_1_1_20241012
-- 此处省略一千多行。。。
Deleted 1058 objects
到此,问题得到解决。
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




