一、list常用命令总结备忘list命令列出控制文件、RMAN恢复目录中备份信息,是我们对所有可见的数据库备份文件的一个最直观的了解的方法listincarnation;&..
一、list常用命令总结备忘
list incarnation;
list backup summary;
list backup of database summary;
list backup of tablespace summary;
list backup of datafile n,n summary;
list archivelog all summary;
list archivelog all;
list backup by file;
list backup;
list expired backup;
list copy;
list backup of spfile;
list backup of controlfile;
list backup datafile n,n,n;
list backup tablespace tablespace_name;
list backup of archivelog all;
list backup of archivelog from scn ...;
list backup of archivelog until scn ...;
list backup of archivelog from sequence ..;
list backup of archivelog until time 'sysdate-10';
list backup of archivelog {all, from, high, like, logseq, low, scn, sequence, time, until};
1.List 当前RMAN所备份的数据库:
RMAN> list incarnation;
1.1. list backup summary; --概述可用的备份
这个命令可以派生出很多类似命令,例如
list backup of database summary
list backup of archivelog all summary
list backup of tablespace users summary;
list backup of datafile n,n,n summary
这些命令可以让我们对已有的备份文件有一个整体,直观的了解。
1.2.list backup by file;--按照文件类型分别列出
1.3.list backup;
这个命令列出已有备份集的详细信息。
1.4.list expired backup;
列出过期的备份文件
1.5.list copy;
list copy of database;
list copy of controlfile;
list copy of tablespace users;
list copy of datafile n,n,n;
list copy of archivelog all;
list copy of archivelog from scn 10000;
list copy of archivelog until sequence 12;
2.List 相关文件的信息
list backup of {archivelog, controlfile, database, datafile, spfile, tablespace};
list backup of database; --full,incremental,tablespace,datafile
list backup of spfile;
2.2 控制文件:
list backup of controlfile;
2.3 数据文件:
list backup of datafle n,n,n,n;
2.4表空间:
2.5归档日志:
list backup of archivelog {all, from, high, like, logseq, low, scn, sequence, time, until};
list backup of archivelog all;
list backup of archivelog until time 'sysdate-1';
list backup of archivelog from sequence 10;
list backup of archivelog until sequence 10;
list backup of archivelog from scn 10000;
list backup of archivelog until scn 200000;
list archivelog from scn 1000;
list archivelog until scn 2000;
list archivelog from sequence 10;
list archivelog until sequence 12;
二、report常用命令总结备忘
report用于判断数据库当前可恢复状态、以及数据库已有备份的信息。
最常使用的是report obsolete; report schema;
report {device, need, obsolete, schema, unrecoverable}
report schema;
report obsolete;
report unrecoverable;
report need backup;
report need backup recovery window of 2 days;
2.1.report schema;
报告数据库模式
22.report obsolete;
2.3.report unrecoverable;
2.4.report need backup;
report need backup days=3;
report need backup incremental=3;
report need backup redundancy=3;
report need backup recovery window of 2 days;
三、backup常用命令总结备忘
1.设置备份标记
backup database tag='full_bak1';
注:每个标记必须唯一,相同的标记可以用于多个备份只还原最新的备份。
backup database maxsetsize=100m tag='datafile1';
RMAN-06183: datafile or datafile copy larger than MAXSETSIZE: file# 1 /data/oradata/system01.dbf
run {
allocate channel c1 type disk maxpicecsize 100m format '/data/backup/full_0_%U_%T';
backup database tag='full_0';
release channel c1;
}
Configure channel device type disk maxpiecesize 100 m;
configure channel device type disk clear;
4.备份集的保存策略