转
在使用RMAN备份、还原的过程中,我们经常需要查看备份的一些详细信息,例如,RMAN提供了LIST命令。关于LIST命令的详细信息
可以参考Oracle Database Backup and Recovery Reference文档。
列出备份信息
列出详细备份信息:备份集(Backup Sets),镜像备份(image copies),proxy copies的信息。
#lists backup sets, image copies, and proxy copies
RMAN> list backup;
列出信息备份信息:备份集(Backup Sets),proxy copies信息。
#lists only backup sets and proxy copies
RMAN> list backupset;
列出所有数据文件的备份信息
# lists backups of all files in database
RMAN> list backup of database;
列出特定表空间的所有数据文件备份集
RMAN> list backup of tablespace users;
列出指定文件的备份信息
RMAN> list backup of datafile 1;
或
RMAN> list backup of datafile '/u01/app/oracle/oradata/epps/system01.dbf';
按备份类型列出备份
RMAN> list backup by file;
列出备份的映像副本信息
#lists only disk copies
RMAN> list copy;
列出过期备份信息(backup sets, proxy copies, and image copies)。
Displays backup sets, proxy copies, and image copies marked in the repository as EXPIRED, that is, "not found."
RMAN> list expired backup;
列出过期备份信息(backup sets, proxy copies)
RMAN> list expired backupset;
按备份类型列出过期备份信息
RMAN> list expired backup by file;
概述可用的备份
RMAN> list backup summary;
概述过期的备份
RMAN> list expired backup summary;
列出某个备份集的信息
RMAN> list backupset 59139;
列出数据文件映像副本
RMAN> list copy of datafile '/u01/app/oracle/oradata/epps/system01.dbf';
列出控制文件的备份信息
RMAN> list backup of controlfile;
列出备份集中TAGE的备份片信息
RMAN> list backupset tage 'TAG20160811T000724'
列出所有备份的控制文件信息
RMAN> list backup of controlfile;
列出备份的spfile文件信息
RMAN> list backup of spfile;
查看已备份的归档日志信息
RMAN> list backup of archivelog all;
RMAN> list backup of archivelog from scn 22727871375;
RMAN> list backup of archivelog until scn 22727813497;
RMAN> list backup of archivelog from scn 22727031113 until scn 22727268951;
RMAN> list backup of archivelog from logseq 25432;
RMAN> list backup of archivelog until logseq 25432;
RMAN> list backup of archivelog from logseq 25426 until logseq 25428;
列出所有的归档日志
RMAN> list archivelog all;
列出所有失效的归档日志
RMAN>list expired archivelog all;
列出指定表空间的备份信息
RMAN> list copy of tablespace 'SYSTEM';
Listing Database Incarnations
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 PPS 2179993557 PARENT 1 30-JUN-05
2 2 PPS 2179993557 PARENT 446075 19-JUL-09
3 3 PPS 2179993557 CURRENT 18010906971 26-APR-15
RMAN>
RMAN> list incarnation of database;
RMAN> list incarnation of database xxx;
列出备份信息时间显示问题
列出备份信息时,缺省情况下,使用RMAN备份与恢复界面仅仅显示的是日期,而没有具体的时间,有时候你想查看更详细的时间。此时需要设置环境变量NLS_DATE_FORMAT。如下所示,当然,你也可以在.bash_profile等文件设置这个环境变量,一劳永逸。
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
59096 1.91G DISK 00:03:26 09-AUG-16
BP Key: 62620 Status: AVAILABLE Compressed: YES Tag: TAG20160809T032503
Piece Name: /u05/backup/backupsets/ora_df919394703_s59692_s1
List of Archived Logs in backup set 59096
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 25062 22666260230 09-AUG-16 22666276962 09-AUG-16
1 25063 22666276962 09-AUG-16 22666279924 09-AUG-16
1 25064 22666279924 09-AUG-16 22666281456 09-AUG-16
1 25065 22666281456 09-AUG-16 22666313201 09-AUG-16
1 25066 22666313201 09-AUG-16 22666547751 09-AUG-16
1 25067 22666547751 09-AUG-16 22666770896 09-AUG-16
1 25068 22666770896 09-AUG-16 22666984056 09-AUG-16
1 25069 22666984056 09-AUG-16 22667014419 09-AUG-16
1 25070 22667014419 09-AUG-16 22667044115 09-AUG-16
1 25071 22667044115 09-AUG-16 22667065450 09-AUG-16
1 25072 22667065450 09-AUG-16 22667102643 09-AUG-16
1 25073 22667102643 09-AUG-16 22667134524 09-AUG-16
1 25074 22667134524 09-AUG-16 22667171180 09-AUG-16
1 25075 22667171180 09-AUG-16 22667254582 09-AUG-16
1 25076 22667254582 09-AUG-16 22667375773 09-AUG-16
1 25077 22667375773 09-AUG-16 22667385502 09-AUG-16
1 25078 22667385502 09-AUG-16 22667409670 09-AUG-16
$ export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS';
RMAN> list backup;