[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
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
2497    1    1421    A 2015-08-13 07:12:52
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1421_862160568.dbf

--很奇怪!仅仅看见一个实例有文件。另外的实例呢?增加一点时间:

RMAN> list archivelog all  completed between '2015-08-13' and '2015-08-14 00:00:00';

List of Archived Log Copies for database with db_unique_name xxxxxx
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
2497    1    1421    A 2015-08-13 07:12:52
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1421_862160568.dbf

2499    1    1422    A 2015-08-13 16:09:00
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1422_862160568.dbf

2498    2    1237    A 2015-08-13 07:12:50
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/2_1237_862160568.dbf

--终于明白为什么?主要是要理解rman命令list archivelog命令里面的completed,表示完成的时间。而它显示的Low Time。
--我上面的查询实际上指在'2015-08-13' and '2015-08-13 18:00:00'这个时间段完成的日志。主要是单个日志文件设置太大。

RMAN> list archivelog all  completed between '2015-08-13' and '2015-08-14 06:00:00';

List of Archived Log Copies for database with db_unique_name xxxxxx
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
2497    1    1421    A 2015-08-13 07:12:52
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1421_862160568.dbf

2499    1    1422    A 2015-08-13 16:09:00
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1422_862160568.dbf

2501    1    1423    A 2015-08-13 20:44:16
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1423_862160568.dbf

2503    1    1424    A 2015-08-14 05:27:04
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1424_862160568.dbf

2498    2    1237    A 2015-08-13 07:12:50
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/2_1237_862160568.dbf

2500    2    1238    A 2015-08-13 20:44:18
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/2_1238_862160568.dbf

2502    2    1239    A 2015-08-14 05:27:03
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/2_1239_862160568.dbf

--可以发现实例1需要'2015-08-13' and '2015-08-13 18:00:00'时间范围内,实际需要文件
--Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1421_862160568.dbf
--Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1422_862160568.dbf
--Name: /u01/app/oracle/oradata/xxxxxx/archivelog/2_1237_862160568.dbf

--如果要真正这样查询,上面的命令自己还要做1点点判断,如何写rman命令直接显示需要的结果呢?自己测试以下,应该写成如下。

RMAN> list archivelog time between '2015-08-13' and '2015-08-13 18:00:00';

List of Archived Log Copies for database with db_unique_name xxxxxx
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
2497    1    1421    A 2015-08-13 07:12:52
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1421_862160568.dbf

2499    1    1422    A 2015-08-13 16:09:00
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1422_862160568.dbf

2498    2    1237    A 2015-08-13 07:12:50
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/2_1237_862160568.dbf

--顺便写一个rman小技巧,查手册太慢。可以输入list archivelog,加两次回车这样会出现命令的一些解析,不断猜出可以完成命令的拼写。
--例子:

RMAN> list archivelog
2>
3>

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "end-of-file": expecting one of: "all, from, high, like, low, scn, sequence, time, until, double-quoted-string, integer, single-quoted-string"
RMAN-01007: at line 3 column 1 file: standard input

RMAN> list archivelog time
2>
3>

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "end-of-file": expecting one of: "between"
RMAN-01007: at line 3 column 1 file: standard input

RMAN> list archivelog time between '2015-08-13' and '2015-08-13 18:00:00';

List of Archived Log Copies for database with db_unique_name xxxxxx
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
2497    1    1421    A 2015-08-13 07:12:52
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1421_862160568.dbf

2499    1    1422    A 2015-08-13 16:09:00
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/1_1422_862160568.dbf

2498    2    1237    A 2015-08-13 07:12:50
        Name: /u01/app/oracle/oradata/xxxxxx/archivelog/2_1237_862160568.dbf

时间: 2024-11-09 09:46:59

[20150902]rman的list archivelog命令.txt的相关文章

【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

[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

[20160524]rman备份与检查点4.txt

[20160524]rman备份与检查点4.txt --链接: http://blog.itpub.net/267265/viewspace-2105221/ http://blog.itpub.net/267265/viewspace-2105223/ --昨晚仔细思考,重复测试看看,使用新的控制文件是否可以恢复.感觉我的问题在于我做了catalog注册了备份文件时丢失某些信息.重新 --测试看看. 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING      

[20160523]rman备份与检查点3.txt

[20160523]rman备份与检查点3.txt --从前面的测试可以发现: --1.通过以上信息可以确定备份文件会写检查点. --2.而且备份文件是先写检查点,再做备份. --我这里就产生1个疑问,假设某个数据文件备份时间很长,这样数据文件的某个数据块的scn可能大于文件头的CHECKPOINT_CHANGE#.当我 --们恢复使用不完全恢复到某个时间点或者SCN,应该使用那个备份文件呢?做一个测试来说明问题. 1.环境: SCOTT@book> @ &r/ver1 PORT_STRIN

[20161220]rman恢复时间点的疑问.txt

[20161220]rman恢复时间点的疑问.txt --昨天在恢复时遇到缺少归档的问题,自己开始感觉奇怪,做一点分析记录. RMAN> list backupset summary ; List of Backups =============== Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag ------- -- -- - ----------- -----------------

[20161220]rman tag format标识2.txt

[20161220]rman tag format标识2.txt --别人问的问题,想全备份与归档放在不同目录,并且归档要求至少备份2次.我以前写过一个例子,链接: http://blog.itpub.net/267265/viewspace-2089074/ --例子: backup as compressed backupset full database tag='full 20161220' format '/home/oracle/backup/full20161220_%U'    

[20160202]crosscheck archivelog all.txt

[20160202]crosscheck archivelog all.txt --当使用crosscheck archivelog all检查时注意一个细节,通过例子来说明: 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ------------------------------ -------------- --------------------------------

[20171121]rman使用copy image恢复.txt

[20171121]rman使用copy image恢复.txt --//上个星期做数据文件块头恢复时,提到使用rman备份数据文件时,文件头数据库信息是最后写入备份集文件的,在filesperset=1的情况 --//下写入备份集文件中的倒数第2块就是文件头的备份.参考链接: http://blog.itpub.net/267265/viewspace-2147297/=>[20171115]恢复数据文件块头4补充.txt --//而且我最后还做了测试证明如果resotre数据文件,实际上文件

[20171129]rman input memory buffer 5.txt

[20171129]rman input memory buffer 5.txt --//Input Memory Buffers如何测试,不清楚.不过找到一本电子书.摘要如下: Oracle RMAN 11g Backup and Recovery.pdf 作者:Robert G. Freeman Matthew Hart 页数:689 出版社:Mc graw hill 出版号: ISBN: 978-0-07-162861-7         MHID: 0-07-162861-4 RMAN