误删归档日志除导致备份归档日志失败

本文涉及的产品
日志服务 SLS,月写入数据量 50GB 1个月
简介: 背景:        测试环境的归档日志无意被删除了,导致备份归档日志的时候报RMAN-06059的错误,详细的日志:RMAN> connect target *2>3> RUN {4> ALLOCATE CHANNEL CH1 TYPE...

背景:

       测试环境的归档日志无意被删除了,导致备份归档日志的时候报RMAN-06059的错误,详细的日志:

RMAN> connect target *

2>

3> RUN {

4> ALLOCATE CHANNEL CH1 TYPE 'SBT_TAPE';

5> ALLOCATE CHANNEL CH2 TYPE 'SBT_TAPE';

6> SEND DEVICE TYPE 'SBT_TAPE' 'NSR_ENV=(NSR_CLIENT=joeonepiq)';

7> BACKUP ARCHIVELOG ALL filesperset 1 format 'PIQ_ARCH_%s_%p_%t' delete input;

8> BACKUP format 'PIQ_CONTROL_%s_%p_%T'  current controlfile;

9> RELEASE CHANNEL CH1;

10> RELEASE CHANNEL CH2;

11> }

12>

connected to target database: PIQ (DBID=1615856458)

using target database control file instead of recovery catalog

   

allocated channel: CH1

channel CH1: SID=88 device type=SBT_TAPE

channel CH1: NMDA Oracle v1.5.0

sent command to channel: CH1

   

allocated channel: CH2

channel CH2: SID=169 device type=SBT_TAPE

channel CH2: NMDA Oracle v1.5.0

sent command to channel: CH2

   

sent command to channel: CH1

sent command to channel: CH2

   

Starting backup at 23-JUN-14

released channel: CH1

released channel: CH2

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 06/23/2014 08:47:30

RMAN-06059: expected archived log not found, loss of archived log compromises recoverability

ORA-19625: error identifying file /oracle/PIQ/oraarch/PIQarch1_32074_791218442.dbf

ORA-27037: unable to obtain file status

IBM AIX RISC System/6000 Error: 2: A file or directory in the path name does not exist.

Additional information: 3

 

解决方法:

     RMAN>crosscheck archivelog all;

进行归档日志的校验;

     RMAN>delete expired archivelog all;

删除失效的归档日志;

 

RMAN> delete expired archivelog all;

   

released channel: ORA_DISK_1

released channel: ORA_DISK_2

released channel: ORA_DISK_3

released channel: ORA_DISK_4

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=88 device type=DISK

allocated channel: ORA_DISK_2

channel ORA_DISK_2: SID=169 device type=DISK

allocated channel: ORA_DISK_3

channel ORA_DISK_3: SID=244 device type=DISK

allocated channel: ORA_DISK_4

channel ORA_DISK_4: SID=330 device type=DISK

List of Archived Log Copies for database with db_unique_name PIQ

=====================================================================

Key Thrd Seq S Low Time

------- ---- ------- - ---------

31915 1 32074 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32074_791218442.dbf

 

31916 1 32075 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32075_791218442.dbf

 

31917 1 32076 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32076_791218442.dbf

 

31918 1 32077 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32077_791218442.dbf

 

31919 1 32078 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32078_791218442.dbf

 

31920 1 32079 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32079_791218442.dbf

 

31921 1 32080 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32080_791218442.dbf

 

31922 1 32081 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32081_791218442.dbf

 

31923 1 32082 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32082_791218442.dbf

 

31924 1 32083 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32083_791218442.dbf

 

31925 1 32084 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32084_791218442.dbf

 

31926 1 32085 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32085_791218442.dbf

 

31927 1 32086 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32086_791218442.dbf

 

31928 1 32087 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32087_791218442.dbf

 

31929 1 32088 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32088_791218442.dbf

 

31930 1 32089 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32089_791218442.dbf

 

31931 1 32090 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32090_791218442.dbf

 

31932 1 32091 X 24-APR-14

Name: /oracle/PIQ/oraarch/PIQarch1_32091_791218442.dbf

Do you really want to delete the above objects (enter YES or NO)? YES

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32074_791218442.dbf RECID=31915 STAMP=845742679

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32075_791218442.dbf RECID=31916 STAMP=845742682

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32076_791218442.dbf RECID=31917 STAMP=845742686

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32077_791218442.dbf RECID=31918 STAMP=845742707

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32078_791218442.dbf RECID=31919 STAMP=845742710

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32079_791218442.dbf RECID=31920 STAMP=845742713

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32080_791218442.dbf RECID=31921 STAMP=845742719

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32081_791218442.dbf RECID=31922 STAMP=845742793

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32082_791218442.dbf RECID=31923 STAMP=845742796

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32083_791218442.dbf RECID=31924 STAMP=845742800

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32084_791218442.dbf RECID=31925 STAMP=845742952

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32085_791218442.dbf RECID=31926 STAMP=845742958

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32086_791218442.dbf RECID=31927 STAMP=845743016

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32087_791218442.dbf RECID=31928 STAMP=845743362

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32088_791218442.dbf RECID=31929 STAMP=845743365

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32089_791218442.dbf RECID=31930 STAMP=845743370

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32090_791218442.dbf RECID=31931 STAMP=845743372

deleted archived log

archived log file name=/oracle/PIQ/oraarch/PIQarch1_32091_791218442.dbf RECID=31932 STAMP=845743376

Deleted 18 EXPIRED objects

 

原因分析:

数据库的archivelog文件被手工删除,但是控制文件仍然记录了归档日志的备份信息,rman做归档备份时还是要备份被无意删除的文件,但文件已经被物理删除,磁盘上找不到就会报错,通过rman crosscheck archivelog all也可以看到文件已经失效,所以备份之前先将归档文件从控制文件中删除,然后备份就会成功;

 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

本文作者:JOHN

ORACLE技术博客:ORACLE 猎人笔记               数据库技术群:367875324 (请备注ORACLE管理 )  

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

相关实践学习
日志服务之使用Nginx模式采集日志
本文介绍如何通过日志服务控制台创建Nginx模式的Logtail配置快速采集Nginx日志并进行多维度分析。
相关文章
|
27天前
|
SQL Oracle 关系型数据库
【赵渝强老师】Oracle的控制文件与归档日志文件
本文介绍了Oracle数据库中的控制文件和归档日志文件。控制文件记录了数据库的物理结构信息,如数据库名、数据文件和联机日志文件的位置等。为了保护数据库,通常会进行控制文件的多路复用。归档日志文件是联机重做日志文件的副本,用于记录数据库的变更历史。文章还提供了相关SQL语句,帮助查看和设置数据库的日志模式。
【赵渝强老师】Oracle的控制文件与归档日志文件
|
6月前
|
存储 SQL 关系型数据库
|
4月前
|
SQL Oracle NoSQL
实时计算 Flink版操作报错合集之报错“找不到对应的归档日志文件”,怎么处理
在使用实时计算Flink版过程中,可能会遇到各种错误,了解这些错误的原因及解决方法对于高效排错至关重要。针对具体问题,查看Flink的日志是关键,它们通常会提供更详细的错误信息和堆栈跟踪,有助于定位问题。此外,Flink社区文档和官方论坛也是寻求帮助的好去处。以下是一些常见的操作报错及其可能的原因与解决策略。
|
4月前
|
SQL Oracle 关系型数据库
"揭秘!一键解锁Oracle日志清理魔法,让海量归档日志无处遁形,守护数据库健康,告别磁盘空间告急噩梦!"
【8月更文挑战第9天】随着Oracle数据库在企业应用中的普及,归档日志管理对保持数据库健康至关重要。归档日志记录所有更改,对数据恢复极为重要,但也可能迅速占用大量磁盘空间影响性能。利用Oracle提供的RMAN工具,可通过编写Shell脚本来自动清理归档日志。脚本包括设置环境变量、连接数据库、检查和删除指定时间前的日志,并记录执行情况。通过Cron作业定时运行脚本,可有效管理日志文件,确保数据库稳定运行。
111 7
|
4月前
|
数据库 Java 监控
Struts 2 日志管理化身神秘魔法师,洞察应用运行乾坤,演绎奇幻篇章!
【8月更文挑战第31天】在软件开发中,了解应用运行状况至关重要。日志管理作为 Struts 2 应用的关键组件,记录着每个动作和决策,如同监控摄像头,帮助我们迅速定位问题、分析性能和使用情况,为优化提供依据。Struts 2 支持多种日志框架(如 Log4j、Logback),便于配置日志级别、格式和输出位置。通过在 Action 类中添加日志记录,我们能在开发过程中获取详细信息,及时发现并解决问题。合理配置日志不仅有助于调试,还能分析用户行为,提升应用性能和稳定性。
59 0
|
4月前
|
SQL 安全 测试技术
【数据守护者必备】SQL数据备份与恢复策略全解析:从全量到日志备份,手把手教你确保企业信息万无一失的实战技巧!
【8月更文挑战第31天】数据库是企业核心业务数据的基石,为防止硬件故障、软件错误或人为失误导致的数据丢失,制定可靠的备份与恢复策略至关重要。本文通过一个在线购物平台的案例,详细介绍了使用 SQL Server 进行全量备份、差异备份及事务日志备份的方法,并演示了如何利用 SQL Server Agent 实现自动化备份任务。此外,还提供了数据恢复的具体步骤和测试建议,确保数据安全与业务连续性。
189 0
|
4月前
|
SQL 监控 Oracle
Oracle数据误删不用怕,跟我来学日志挖掘
Oracle数据误删不用怕,跟我来学日志挖掘
60 0
|
5月前
|
存储 SQL Oracle
关系型数据库Oracle归档日志备份
【7月更文挑战第19天】
72 5
|
6月前
|
SQL Oracle 关系型数据库
探索 Linux 命令 `db_archive`:Oracle 数据库归档日志的工具
探索 Linux 中的 `db_archive`,实际与 Oracle 数据库归档日志管理相关。在 Oracle 中,归档日志用于恢复,当在线重做日志满时自动归档。管理员可使用 SQL*Plus 查看归档模式,通过 `RMAN` 进行备份和恢复操作。管理归档日志需谨慎,避免数据丢失。了解归档管理对 Oracle 管理员至关重要,确保故障时能快速恢复数据库。
|
6月前
|
存储 运维 关系型数据库