博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[20160202]crosscheck archivelog all.txt
阅读量:6824 次
发布时间:2019-06-26

本文共 5347 字,大约阅读时间需要 17 分钟。

[20160202]crosscheck archivelog all.txt

--当使用crosscheck archivelog all检查时注意一个细节,通过例子来说明:

1.环境:

SCOTT@book> @ &r/ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

RMAN> list archivelog all;

List of Archived Log Copies for database with db_unique_name BOOK

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

Key     Thrd Seq     S Low Time

------- ---- ------- - -------------------
294     1    309     A 2016-02-01 05:00:22
        Name: /u01/app/oracle/archivelog/book/1_309_896605872.dbf

295     1    310     A 2016-02-01 22:00:15

        Name: /u01/app/oracle/archivelog/book/1_310_896605872.dbf

$ cd /u01/app/oracle/archivelog/book/
$ ll
total 89164
-rw-r----- 1 oracle oinstall 44703744 2016-02-01 22:00:16 1_309_896605872.dbf
-rw-r----- 1 oracle oinstall 46494208 2016-02-01 22:13:55 1_310_896605872.dbf

--仅仅存在2个备份,改名1个archive log:

$ mv 1_309_896605872.dbf 1_309_896605872.dbf_xxx

2.测试:

--备份archive log:
RMAN> backup archivelog all  format '/home/oracle/backup/archive_%u' ;

Starting backup at 2016-02-02 15:37:53

current log archived
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 02/02/2016 15:37:54
RMAN-06059: expected archived log not found, loss of archived log compromises recoverability
ORA-19625: error identifying file /u01/app/oracle/archivelog/book/1_309_896605872.dbf
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

RMAN> crosscheck archivelog all ;

released channel: ORA_DISK_1

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=123 device type=DISK
validation failed for archived log
archived log file name=/u01/app/oracle/archivelog/book/1_309_896605872.dbf RECID=294 STAMP=902700016
validation succeeded for archived log
archived log file name=/u01/app/oracle/archivelog/book/1_310_896605872.dbf RECID=295 STAMP=902700835
validation succeeded for archived log
archived log file name=/u01/app/oracle/archivelog/book/1_311_896605872.dbf RECID=296 STAMP=902763474
Crosschecked 3 objects

--可以发现校验/u01/app/oracle/archivelog/book/1_309_896605872.dbf RECID=294失败。而这个时候接着执行:

RMAN> backup archivelog all  format '/home/oracle/backup/archive_%u' ;

Starting backup at 2016-02-02 15:39:48
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=310 RECID=295 STAMP=902700835
input archived log thread=1 sequence=311 RECID=296 STAMP=902763474
input archived log thread=1 sequence=312 RECID=297 STAMP=902763588
channel ORA_DISK_1: starting piece 1 at 2016-02-02 15:39:49
channel ORA_DISK_1: finished piece 1 at 2016-02-02 15:39:50
piece handle=/home/oracle/backup/archive_25qsu525 tag=TAG20160202T153948 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2016-02-02 15:39:50

--可以发现这个时候备份成功,但是漏掉了1_309_896605872.dbf.也就是讲当做了crosscheck archivelog all 后,已经表示那些文件不存在,这样才解决

--问题前已经漏掉了一些备份。

3.改名回来:

$ mv 1_309_896605872.dbf_xxx 1_309_896605872.dbf

RMAN> list archivelog all;

List of Archived Log Copies for database with db_unique_name BOOK

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

Key     Thrd Seq     S Low Time

------- ---- ------- - -------------------
294     1    309     X 2016-02-01 05:00:22
        Name: /u01/app/oracle/archivelog/book/1_309_896605872.dbf

295     1    310     A 2016-02-01 22:00:15

        Name: /u01/app/oracle/archivelog/book/1_310_896605872.dbf

296     1    311     A 2016-02-01 22:13:55

        Name: /u01/app/oracle/archivelog/book/1_311_896605872.dbf

297     1    312     A 2016-02-02 15:37:53

        Name: /u01/app/oracle/archivelog/book/1_312_896605872.dbf

--注意: S=X.

RMAN> crosscheck archivelog all ;

released channel: ORA_DISK_1

allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=123 device type=DISK
validation succeeded for archived log
archived log file name=/u01/app/oracle/archivelog/book/1_309_896605872.dbf RECID=294 STAMP=902700016
validation succeeded for archived log
archived log file name=/u01/app/oracle/archivelog/book/1_310_896605872.dbf RECID=295 STAMP=902700835
validation succeeded for archived log
archived log file name=/u01/app/oracle/archivelog/book/1_311_896605872.dbf RECID=296 STAMP=902763474
validation succeeded for archived log
archived log file name=/u01/app/oracle/archivelog/book/1_312_896605872.dbf RECID=297 STAMP=902763588
Crosschecked 4 objects

RMAN> list archivelog all;

List of Archived Log Copies for database with db_unique_name BOOK

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

Key     Thrd Seq     S Low Time

------- ---- ------- - -------------------
294     1    309     A 2016-02-01 05:00:22
        Name: /u01/app/oracle/archivelog/book/1_309_896605872.dbf

295     1    310     A 2016-02-01 22:00:15

        Name: /u01/app/oracle/archivelog/book/1_310_896605872.dbf

296     1    311     A 2016-02-01 22:13:55

        Name: /u01/app/oracle/archivelog/book/1_311_896605872.dbf

297     1    312     A 2016-02-02 15:37:53

        Name: /u01/app/oracle/archivelog/book/1_312_896605872.dbf

--这样才恢复正常。

转载地址:http://lpgzl.baihongyu.com/

你可能感兴趣的文章
Redis数据结构
查看>>
金三银四,所有人都应该知道的事
查看>>
SQLServer之触发器简介
查看>>
这个俄罗斯大神,又出新作品了!
查看>>
用vuepress搭建一个够自己用的博客
查看>>
AMD(中文版)
查看>>
Tomcat的web应用加载过程
查看>>
小程序挖坑之路
查看>>
MySQL 数据类型
查看>>
changelog 日志自动生成插件
查看>>
Eventloop不可怕,可怕的是遇上Promise
查看>>
如何让textarea随着内容自适应高度
查看>>
用Flex实现常见的几种布局
查看>>
前端错误日志上报相关实践
查看>>
使用SQLAlchemy添加数据库数据时,db.session.commit()报错:InvalidRequestError: This Session'......
查看>>
吴恩达MachineLearning-week1
查看>>
java锁浅析
查看>>
Windows的Linux子系统Attempt~
查看>>
http协议&缓存-几个常见状态码
查看>>
Objectiv-C NSObject
查看>>