连接到目标数据库(不使用恢复目录数据库)
$rman target / nocatalog
显示rman配置
rman> show all;
报告目标数据库的物理结构
rman> report schema;
报告陈旧备份
rman> report obsolete;
报告不可恢复的数据文件
rman> report unrecoverable;
列出备份信息
rman> list backup;
rman> list backup of database;
rman> list backup of tablespace table_name;
rman> list backup of controlfile;
rman> list backup of spfile;
rman> list backupset id;
校验备份
rman> crosscheck backup;
rman> crosscheck backup of database;
rman> crosscheck backup of tablespace system;
rman> crosscheck backup of controlfile;
rman> crosscheck backup of spfile;
rman> crosscheck backup of archivelog all;
校验没有备份过的归档日志
rman>crosscheck archivelog all;
rman>delete noprompt expired archivelog all;
刪除所有的archivelog files
rman> delete archivelog all;
強制刪除昨天以前的archivelog files
rman> delete force archivelog until time 'sysdate -1';
rman> delete noprompt force archivelog until time 'sysdate -2';
刪除所有过期的archivelog files
rman> delete expired archivelog all;
删除备份
rman> delete obsolete; -- 删除陈旧备份
rman> delete noprompt obsolete;
rman> delete expired backup;
--删除所有expired的备份(包括归档日志、控制文件、备份聚)
rman> delete expired ;
rman> delete backupset id;
rman> delete backup; -- 删除所有备份
改变备份集的状态
rman> change backupset id unavailable;
改为长期备份
rman> change backupset id keep forever logs;
rman> change backupset id keep until time 'sysdate 30' logs;
rman> change backupset id nokeep;
基于时间:
rman>configure retention policy to recovery window of 30 days;
基于冗余数量:
configure retention policy to redundancy n ;
取消备份保留策略:
configure retention policy to none;
设置归档日志存放在其它位置
set archivelog destination to 'e:\temp';
阅读(8573) | 评论(0) | 转发(0) |