B 表示 backup
F 表示 FULL
A 表示 archive log
S 說明備份狀態 (A AVAILABLE X EXPIRED )
按照 數據文件備份
list backup of tablespace 和list backup of datafile 輸出和list backup 相似
如
list backup of datafile
RMAN>list backup of archivelog all; 詳細信息
RMAN>list backup of controlfile;
RMAN>list backup of spfile;
=====================================================
=====================================================
RMAN 的 report命令
RMAN>report need backup days=
RMAN>report need backup redundancy=
RMAN>report need backup recovery window of
RMAN>report unrecoverable;
RMAN>report schema;
如果使用了保存策略
=====================================================
=====================================================
RMAN的crosscheck 命令
crosscheck backup
crosscheck backup of datafile
crosscheck backup of tablespace users;
crosscheck backup of controfile;
crosscheck backup of controlfile;
crosscheck backup tag=
crosscheck backup completed after
crosscheck backup completed between
crosscheck backup device type sbt;
crosscheck archivelog all;
crosscheck archivelog like
crosscheck archivelog from sequence
crosscheck archivelog until sequence
=====================================================
使用delete expired archivelog all 命令刪除所有過期歸檔日志
=====================================================
RMAN 的validate 命令
=====================================================
=====================================================
RMAN 的備份保存策略以及change
change backupset
change backuppiece
change archivelog until logseq =
備份冗余備份保存策略(backup redundancy backup retension policy) 基於備份的數量
兩類策略互相排斥
要查看標記為丟棄的備份 report obsolete
nfigure retension policy to recovery window of
configure retension policy to redundancy
顯示結果 show all;
backup database keep forever;
backup database keep
可以修改備份為永久保存並將以及該備份的相關的日志保存下來
change backupset
可以設置備份丟棄的新日期
change backupset
change backupset
標記為unavailable狀態的備份集並不參與crosscheck;
=====================================================
=====================================================
恢復目錄的記錄刪除
隨後啟動SQL*Plus
=====================================================
=====================================================
手工同步恢復目錄
resync catalog;
Oracle同步恢復目錄的時候
=====================================================
=====================================================
在RMAN 中存儲腳本
rman target / catalog rman/rman@rman
RMAN>create script my_bk_script
create script my_bk_script
RMAN>print script my_bk_script;
printing stored scipt:my_bk_script
{backup database plus archivelog;}
RMAN>run {execute scipt my_bk_script;}
RMAN>delete script my_bk_script;
=====================================================
=====================================================
archivelog模式下的完全恢復
step
rman target rman_backup/password
configure controlfile autobackup on;
step
step
step
step
set DBID=****
restore controlfile from autobackup;
alter database mount;
step
recover database;
alter database open resetlogs;
表空間恢復
sql
sql
restore tablespace users
recover tablespace users
sql
sql
數據文件恢復
sql
sql
restore datafile
restore datafile
recover datafile
recover datafile
sql
sql
=====================================================
=====================================================
切換當前的incarnation 回到resetlogs 前RESET DATABASE TO INCARNATION inc_key
=====================================================
=====================================================
RMAN 高級恢復
run
{
set until time
restore database;
recover database;
alter database open resetlogs;
}
startup mount;
restore database UNTIL SCN
recover database UNTIL SCN
alter database open resetlogs;
startup mount;
restore database UNTIL SEQUENCE
recover database UNTIL SEQUENCE
alter database open resetlogs;
From:http://tw.wingwit.com/Article/program/Oracle/201311/18245.html