[20160202]crosscheck archivelog all.txt

简介: [20160202]crosscheck archivelog all.txt --当使用crosscheck archivelog all检查时注意一个细节,通过例子来说明: 1.

[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

--这样才恢复正常。

目录
相关文章
|
Oracle 关系型数据库 Linux
[20180115]RMAN-06820.txt
[20180115]RMAN-06820.txt --//在备库做归档备份出现RMAN-06820的问题。就是如果在备库做全表,因为要做主库日志切换,一般执行rman target /会出现问题。
1420 0
|
Oracle 关系型数据库 测试技术
[20171225]RMAN-06808.txt
[20171225]RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect.txt --//朋友拿我的一些例子来测试遇到的RMAN-06808: SECTION SIZE cannot be used when piece limit is in effect问题.
951 0
|
关系型数据库
[20171221]RMAN-05501.txt
[20171221]RMAN-05501 aborting duplication of target database.txt --//昨天使用rman duplicate建立dg,出现如下错误: rman > duplicate target database for standby from active database; .
1070 0
|
Oracle 关系型数据库 Linux
[20171208]rman与truncate3.txt
[20171208]rman与truncate3.txt --//前几天测试truncate表依旧备份一部分信息,测试几次确定备份8extent.当时的测试几个extents是相邻的.
896 0
|
Oracle 关系型数据库 测试技术
[20171206]rman与truncate.txt
[20171206]rman与truncate.txt --//昨天下班在回家的路上,突然想起以前遇到的问题,就是truncate表后,rman做备份时会备份多少truncate表的信息, --//当时在itpub上,还存在讨论,就是rman会备份空block吗?参考链接:http://www.
1003 0
|
Oracle 关系型数据库 Linux
[20171206]rman与truncate2.txt
[20171206]rman与truncate2.txt --//上午测试发现truncate的表在做rman备份时还要做8个extents的备份. --//不知道自己的猜测是否正确,选择一个使用UNIFORM SIZE 的表空间测试看看.
1074 0
|
Oracle 关系型数据库
[20171130]关于rman的一些总结.txt
[20171130]关于rman的一些总结.txt --//最近一直做rman相关测试,测试那个乱,没办法.无法从周围的人获得帮助,纯粹是自己的乱猜,乱测,不知道别人是否能看懂我写的东西.
1090 0
|
Oracle 关系型数据库 Shell
[20171121]rman backup as copy 2.txt
[20171121]rman backup as copy 2.txt --//昨天测试backup as copy ,备份时备份文件的文件头什么时候更新.是最后完成后还是顺序写入备份文件.
1013 0
|
Oracle 关系型数据库 Linux
[20171121]rman backup as copy.txt
[20171121]rman backup as copy.txt --//上个星期做数据文件块头恢复时,提到使用rman备份数据文件时,文件头数据库信息是最后写入备份集文件的,在filesperset=1的情况 --//下写入备份集文件中的倒数第2块就是文件头的备份.
1228 0
|
Oracle 关系型数据库 数据库
[20170616]recover copy of datafile 6.txt
[20170616]no copy of datafile 6 found to recover.txt --//最近几天一直被这个问题纠缠,我虽然不知道问题在哪来,还是找到简单的解决方法,做1个记录: --//链接:http://www.
1153 0