[20160202]crosscheck archivelog all.txt

[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

--这样才恢复正常。

时间: 2024-10-05 16:38:30

[20160202]crosscheck archivelog all.txt的相关文章

[20150902]rman的list archivelog命令.txt

[20150902]rman的list archivelog命令.txt --昨天同事要查询2015/8/13号日志,要确定需要检查日志的范围: RMAN> list archivelog all  completed between '2015-08-13' and '2015-08-13 18:00:00'; List of Archived Log Copies for database with db_unique_name xxxxxx ========================

[20160923]取出备份集的archivelog文件.txt

[20160923]取出备份集的archivelog文件.txt --这个测试来源1次帮别人解决问题时遇到的情况,当时需要使用logminer分析archivelog文件,因为要求对方把archivelog拿过来在我 --的电脑分析.前提是要使用 EXECUTE DBMS_LOGMNR_D.BUILD(OPTIONS=> DBMS_LOGMNR_D.STORE_IN_REDO_LOGS); 生成数据字典文件在 --归档日志中,可以参考我以前写的blog,链接: http://blog.itpub

【rman】list archivelog all与list backup of archivelog all

list archivelog all 是列出控制文件中记录的未被rman delete 命令删除的手工删除的日志文件,如果手工删除之后使用list命令对应的日志文件的status为标记为X! 模拟删除日志yangdb_1_192_762800109.log  oracle@rac3:/opt/oracle/yangdb_arch>mv yangdb_1_192_762800109.log /tmp/ crosscheck 命令检查归档日志的信息: RMAN> crosscheck archi

oracle自动清理archivelog文件的具体方法_oracle

1.登陆到服务器上创建rman自动删除两天前的归档日志脚本[oracle@108 ~]$ cat >>del_ora_log.rman <<EOF crosscheck archivelog all;delete noprompt expired archivelog all;delete noprompt force archivelog until time 'sysdate -2';   -------删除两天前的archivelogexit;EOF2.手动执行清除日志[or

oraclerman备份日志单独备份和交叉校验

 手动备份归档日志 1.database01 [oraprod@db01 scripts ]$ pwd /usr/tivoli/scripts [oraprod@db01 scripts ]$ ls 1.txt nohup.out oraicr0.sh scheoraicr0.sh BKlog null oraicr1.sh scheoraicr0.sh.test BKlog.tar oraarch.sh oraicr1.sh.orig scheoraicr1.sh DBArchivelogBK

小麦苗的常用代码(仅限自己使用)

点击(此处)折叠或打开 ? ● ? ◆ ※ ⊙ ------GBK: =E6=B5=B7=E6=BB=A8 (=E5=8F ---> LHR (=E5=8F ------3DUTF-8: =E6=B5=B7=E6=BB=A8 (=E5=8F ---> =E5=B0=8F=E9=BA=A6=E8=8B=97 (=E5=8F ---小麦苗 3DUTF-8:=E5=B0=8F=E9=BA=A6=E8=8B=97 3DGBK: =D0=A1=C2=F3=C3=E7 ----- editplus 替换空

Oracle增量备份和快速备份(块改变跟踪Block Change Tracking)

Oracle增量备份和快速备份(块改变跟踪Block Change Tracking) 下面小麦苗给出全库备份的脚本: 点击(此处)折叠或打开 [oracle@rhel6lhr ~]$ crontab -l 2 12 * * 1 /home/oracle/lhr/rman/rman_backup_full.sh [oracle@rhel6lhr ~]$ more /home/oracle/lhr/rman/rman_backup_full.sh export ORACLE_SID=orclasm

【BBED】丢失归档文件情况下的恢复

[BBED]丢失归档文件情况下的数据文件的恢复   1.1  BLOG文档结构图     1.2  前言部分   1.2.1  导读和注意事项 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~: ① 若丢失归档情况下数据文件的恢复,bbed和隐含参数(重点) ② 数据库启动过程中的介质恢复,scn号的关系 ③ BBED如何修改文件头 ④ 归档和非归档模式下数据库的全备     Tips:        ① 若文章代码格式有错乱,推荐使用QQ

rman命令备忘录

list命令  可以用于查看对应文件的信息,backup,copy,archivelog等 list incarnation ===================================================list incarnation; list incarnation of database; list incarnation of database 'ORA9I'; ==================================================