rman list命令
设置输出时间格式:
$export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
>set NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS (Windows)
01 list incarnation
===========================
list incarnation
list incarnation of database
list incarnation of database 'ORACL'
===================================================
02 list backup example
===========================
list backup
list backup of database
list backup of tablespace 'SYSTEM','USERS'
list backup of datafile 1,3,5
list backup of datafile '/u01/app/oracle/oradata/oracl/system01.dbf'
list backup of controlfile
list backup of spfile
list backup of archivelog all
list backup of archivelog like '%.log'
list backup of archivelog from time 'sysdate-14'
list backup of archivelog until time 'sysdate-7'
list backup of archivelog from time 'sysdate-14' until time 'sysdate-7'
list backup of archivelog from scn 10000
list backup of archivelog until scn 11000
list backup of archivelog from scn 10000 until scn 11000
list backup of archivelog from logseq 135
list backup of archivelog until logseq 139
list backup of archivelog from logseq 135 until logseq 139
list backup completed after 'sysdate -14'
list backup completed before 'sysdate -7'
list backup completed between 'sysdate -14' and 'sysdate-7'
list backup tag=WHOLE_COLDBACK
list backup recoverable
list backup device type disk
list backup completed after 'sysdate-14' tag=TAG20111130T170752 device type disk recoverable
===================================================
03 list copy example
===========================
list copy
list copy of database
list copy of tablespace 'SYSTEM','USERS'
list copy of datafile 1,3,7
list copy of datafile '/u01/app/oracle/oradata/oracl/system01.dbf'
list copy of controlfile
list copy of spfile
list copy of archivelog all
list copy of archivelog like '%.log'
list copy of archivelog from time 'sysdate-14'
list copy of archivelog from time "to_date('07-11-2004','mm-dd-yyyy')"
list copy of archivelog until time 'sysdate-7'
list copy of archivelog from time 'sysdate-14' until time 'sysdate-7'
list copy of archivelog from scn 10000
list copy of archivelog until scn 11000
list copy of archivelog from scn 10000 until scn 11000
list copy of archivelog from logseq 135
list copy of archivelog until logseq 139
list copy of archivelog from logseq 135 until logseq 139
list copy completed after 'sysdate -14'
list copy completed before 'sysdate -7'
list copy completed between 'sysdate -14' and 'sysdate-7'
list copy tag=WHOLE_COLDBACK
list copy recoverable
list copy device type disk
list copy completed after 'sysdate-14' tag=TAG20111130T170752 device type disk recoverable
================================================
04. list backup summary
===========================
list backup summary
list backup of database summary
list backup of tablespace users summary
list backup of datafile 9 summary
list backup of archivelog all summary
list backup of controlfile summary
list backup of spfile summary
=======================================================
05. list others
===========================
list expired backup
list expired backup of archivelog all summary
list backup by file
list archivelog all
list backupset
===================================
restore database preview;
restore database preview summary
restore database until scn 100 preview summary;
restore database until time '2009-09-06 07:41:32' preview summary;
restore database until sequence 1 preview summary;
restore database until logseq 1 preview summary;
================================================
restore archivelog all;
restore archivelog from sequence 201 until sequence 300;
restore archivelog all
restore archivelog from logseq 5 until logseq 8;
restore archivelog from logseq 5;
restore archivelog from time 'sysdate-7';
restore archivelog until logseq 3;
restore archivelog low logseq 5; -- 从第5个日志开始
restore archivelog high logseq 5; -- 到第5个日志为止
1、SHOW命令:
显示rman配置:RMAN> show all
2、REPORT命令:
RMAN>report schema 报告目标数据库的物理结构
RMAN>report need backup days=3 报告最近3天没有被备份的数据文件;
RMAN> report need backup days 3 tablespace users 在USERS表空间上3天未备份的数据文件
RMAN> report need backup incremental 3 报告恢复数据文件需要的增量备份个数超过3次的数据文件
RMAN> report need backup redundancy 2 database 报告备份文件低于2份的所有数据文件
RMAN> report need backup redundancy=2
RMAN> report need backup recovery window of 6 days 报告文件报表的恢复需要超过6天的归档日志的数据文件
RMAN> report unrecoverable 报告数据库所有不可恢复的数据文件
RMAN> report obsolete redunndancy 2 报告备份次数超过2次的陈旧备份
RMAN> report obsolete 报告多余的备份
3、LIST命令:列出备份信息
列出数据文件备份集
RMAN> list backup 列出详细备份;
RMAN> list expired backup 列出过期备份
RMAN> list backup of database 列出所有数据文件的备份集;
RMAN> list backup of tablespace users 列出特定表空间的所有数据文件备份集;
RMAN> list backup of controlfile 列出控制文件备份集
RMAN> list backup of archivelog all 列出归档日志备份集详细信息
RMAN> list archivelog all 列出归档日志备份集简要信息
RMAN> list backup of spfile 列出SPFILE备份集
RMAN> list copy of datafile 5 列出数据文件映像副本
RMAN> list copy of controlfile 列出控制文件映像副本
RMAN> list copy of archivelog all 列出归档日志映像副本
RMAN> list incarnation of database 列出对应物/列出数据库副本
RMAN> list backup summary 概述可用的备份;
RMAN> list backup by file 按备份类型列出备份按照数据文件备份,归档日志备份,控制文件备份,服务器参数文件备份 列出
4、CROSSCHECK命令:校验备份信息
RMAN> crosscheck backup 核对所有备份集
RMAN> crosscheck backup of database 核对所有数据文件的备份集
RMAN> crosscheck backup of tablespace users 核对特定表空间的备份集
RMAN> crosscheck backup of datafile 4 核对特定数据文件的备份集
RMAN> crosscheck backup of controlfile 核对控制文件的备份集
RMAN> crosscheck backup of spfile 核对SPFILE的备份集
RMAN> crosscheck backup of archivelog sequence 3 核对归档日志的备份集
RMAN> crosscheck copy 核对所有映像副本
RMAN> crosscheck copy of database 核对所有数据文件的映像副本
RMAN> crosscheck copy of tablespace users 核对特定表空间的映像副本
RMAN> crosscheck copy of datafile 6 核对特定数据文件的映像副本
RMAN> crosscheck copy of archivelog sequence 4 核对归档日志的映像副本
RMAN> crosscheck copy of controlfile 核对控制文件的映像副本
RMAN> crosscheck backup tag='SAT_BACKUP'
RMAN> crosscheck backup completed after 'sysdate - 2'
RMAN> crosscheck backup completed between 'sysdate - 5' and 'sysdate -2 '
RMAN> crosscheck backup device type SBT
RMAN> crosscheck archivelog all
RMAN> crosscheck archivelog like '%ARC100.bak'
RMAN> crosscheck archivelog from sequence 12
RMAN> crosscheck archivelog until sequence 522
5、DELETE:删除备份
RMAN> delete obsolete 删除陈旧备份;
RMAN> delete expired backup 删除EXPIRED备份
RMAN> delete expired copy 删除EXPIRED副本;
RMAN> delete backupset 19 删除特定备份集;
RMAN> delete backupset tag 'TAG20111130T170752';
RMAN> delete backuppiece '/u01/rman_backup/2011/201111/mybak/df_768589735_8_1.bak' 删除特定备份片
RMAN> delete backup 删除所有备份集
RMAN> delete datafilecopy '/u01/rman_backup/2011/201111/mybak/df_768589735_8_1.bak' 删除特定映像副本
RMAN> delete copy 删除所有映像副本
RMAN> delete archivelog all delete input
RMAN> delete backupset 22 format = '/u01/rman_backup/2011/201111/mybak/df_768589735_8_1.bak' delete input 在备份后删除输入对象
RMAN> delete backupset id
RMAN> delete archivelog until sequence 38; --删除直到某个seq的归档日志
RMAN> delete archivelog '/u01/app/oracle/duplicate/1_33_769179320.dbf'; --具体删除某个归档日志
RMAN> delete force archivelog until sequence 38; --强制删除直到某个seq的归档日志
RMAN>delete force archivelog until sequence 13 thread 2; -- RAC环境下指定删除节点的归档
6.change命令
change datafilecopy '/tmp/control01.ctl' unavailable;
change copy of archivelog sequence between 1000 and 1012 unavailable;
change backupset 12 unavailable;
change backupset 12 available;
change backupset tag 'TAG20120229T040223' unavailable;
change backup of spfile tag 'tag20020208t154556' unavailable;
change datafilecopy '/tmp/system01.dbf' available;
change backup of spfile tag 'tag20020208t154556' available;
7.catalog命令
扫描备份片
catalog backuppiece '/u01/rman_backup/2011/201111/mybak/df_768589733_7_1.bak';
扫描归档日志
catalog archivelog '/u01/rman_backup/archive_bak/archlog_78922.bak';
扫描数据文件拷贝,并且将其做为增量备份的level 0
catalog datafilecopy '/u01/rman_backup/2011/201111/mybak/df_768589733_7_1.bak' level 0;
扫描控制文件拷贝
catalog controlfilecopy '/u01/app/oracle/oradata/oracl/control01.ctl'
扫描整个目录
catalog start with '/u01/rman_backup/2011/201111/mybak';
扫描闪回恢复区
catalog recovery area noprompt;
8.坏块恢复
blockrecover datafile 5 block 147551; -- 具体恢复某个数据快
blockrecover corruption list;
9.set command
==========================
set maxcorrupt for datafile 5 to 20; -- 设置允许出现最大坏块数
set archivelog destination to 'new_path';
阅读(356) | 评论(0) | 转发(0) |