1.crosscheck
校验备份文件与备份元数据信息之间的一致性;
RMAN> crosscheck;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "archivelog, backuppiece, backupset, backup, controlfilecopy, copy, datafilecopy, foreign, proxy"
RMAN-01007: at line 1 column 11 file: standard input
RMAN> crosscheck backup;
--校验所有的备份
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=17 device type=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/ORCL11G/backupset/2013_06_25/o1_mf_nnndf_TAG20130625T165337_8wlpnlfl_.bkp RECID=52 STAMP=819046418
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/u01/app/oracle/fast_recovery_area/ORCL11G/backupset/2013_06_25/o1_mf_ncsnf_TAG20130625T165337_8wlq1lxf_.bkp RECID=53 STAMP=819046834
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/u01/app/oracle/fast_recovery_area/ORCL11G/backupset/2013_06_26/o1_mf_nnndf_TAG20130626T101135_8wnmgqm9_.bkp RECID=54 STAMP=819108695
Crosschecked 3 objects
RMAN> list backup of tablespace tbs_bmr;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
54 Full 19.79M DISK 00:00:01 26-JUN-13
BP Key: 54 Status: EXPIRED Compressed: NO Tag: TAG20130626T101135
Piece Name: /u01/app/oracle/fast_recovery_area/ORCL11G/backupset/2013_06_26/o1_mf_nnndf_TAG20130626T101135_8wnmgqm9_.bkp
List of Datafiles in backup set 54
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
10 Full 1886353 26-JUN-13 /u01/app/oracle/oradata/orcl11g/tbs_bmr01.dbf
2.delete删除命令
RMAN> delete;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "archivelog, backuppiece, backupset, backup, controlfilecopy, copy, datafilecopy, expired, force, foreign, global, noprompt, obsolete, proxy, script"
RMAN-01007: at line 1 column 7 file: standard input
RMAN> delete expired archivelog all;
--删除所有失效状态的归档日志
RMAN> delete expired backup;
--删除失效备份
RMAN> delete backup;
--删除所有备份
RMAN> delete backupset 55;
--删除指定备份集
RMAN> delete backuppiece 55;
--删除备份片
RMAN> delete obsolete;
--删除冗余备份
3.report 命令
报告信息
RMAN> report;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "device, need, obsolete, schema, unrecoverable"
RMAN-01007: at line 2 column 7 file: standard input
RMAN> report schema;
--查看当前目标库的可备份数据
RMAN> report obsolete;
--查看冗余的备份,根据当前的备份保留策略来判断
RMAN> report need backup;
--查看哪些源文件,没有达到备份的保留策略
RMAN> report unrecoverable;
Report of files that need backup due to unrecoverable operations
File Type of Backup Required Name
---- ----------------------- -----------------------------------
4.list
列表命令
RMAN> list;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "all, archivelog, backed, backuppiece, backupset, backup, completed, controlfilecopy, copy, datafilecopy, db_unique_name, device, expired, failure, foreign, global, incarnation, like, proxy, recoverable, restore, script, tag"
RMAN-01007: at line 1 column 5 file: standard input
RMAN> list backup;
--查看所有备份
RMAN> list archivelog all;
--查看归档日志
RMAN> list backupset;
--查看备份集
RMAN> list backup of tablespace tbs_bmr;
--查看指定类型的备份
5.catalog
将备份文件信息注册到控制文件中;
RMAN> catalog;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found ";": expecting one of: "archivelog, backuppiece, backup, controlfilecopy, datafilecopy, db_recovery_file_dest, device, recovery, start"
RMAN-01007: at line 1 column 8 file: standard input
--热备份一个表空间
SYS@orcl11g> alter tablespace tbs_bmr begin backup;
SYS@orcl11g> host cp /u01/app/oracle/oradata/orcl11g/tbs_bmr01.dbf /u01/app/backup
SYS@orcl11g> alter tablespace tbs_bmr end backup;
RMAN> catalog datafilecopy '/u01/app/backup/tbs_bmr01.dbf';
RMAN> list copy of tablespace tbs_bmr;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - --------------- ---------- ---------------
5 10 A 26-JUN-13 1908658 26-JUN-13
Name: /u01/app/backup/tbs_bmr01.dbf
RMAN> catalog start with '/u01/app/backup';
--将某个路径下面所有的文件都注册到控制文件