從網絡上找到rman命令集合
一
list命令列出控制文件
list incarnation;
list backup summary;
list backup of database summary;
list backup of tablespace summary;
list backup of datafile n
list archivelog all summary;
list backup by file;
list backup;
list expired backup;
list copy;
list backup of spfile;
list backup of controlfile;
list backup datafile 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
list backup of archivelog {all
RMAN> list incarnation;
匯總查詢
B 表示backup
A 表示Archivelog
A 表示可用AVALIABLE
這個命令可以派生出很多類似命令
list backup of database summary
list backup of archivelog all summary
list backup of tablespace users summary;
list backup of datafile n
這些命令可以讓我們對已有的備份文件有一個整體
分別為
這個命令列出已有備份集的詳細信息
列出過期的備份文件
列出copy文件
list copy of database;
list copy of controlfile;
list copy of tablespace users;
list copy of datafile n
list copy of archivelog all;
list copy of archivelog from scn
list copy of archivelog until sequence
list backup of {archivelog
list backup of database;
list backup of spfile;
list backup of controlfile;
list backup of datafle n
list backup of tablespace tablespace_name;
list backup of archivelog {all
list backup of archivelog all;
list backup of archivelog until time
list backup of archivelog from sequence
list backup of archivelog until sequence
list backup of archivelog from scn
list backup of archivelog until scn
list archivelog from scn
list archivelog until scn
list archivelog from sequence
list archivelog until sequence
二
report用於判斷數據庫當前可恢復狀態
最常使用的是report obsolete; report schema;
report {device
report schema;
report obsolete;
report unrecoverable;
report need backup;
report need backup days=
report need backup redundancy=
report need backup recovery window of
報告數據庫模式
報告已丟棄的備份集(配置了保留策略)
報告當前數據庫中不可恢復的數據文件(即沒有這個數據文件的備份
報告需要備份的數據文件(根據條件不同)
report need backup days=
report need backup incremental=
report need backup redundancy=
report need backup recovery window of
三
backup database tag=
注
backup database maxsetsize=
注
RMAN
run {
allocate channel c
backup database tag=
release channel c
}
可以在allocate子句中設定每個備份片的大小
也可以在configure中設置備份片大小
Configure channel device type disk maxpiecesize
configure channel device type disk clear;
backup database keep forever;
backup database keep until time=
backup databas noexclude keep forever tag=
backup validate database;
使用RMAN來掃描數據庫的物理/邏輯錯誤
backup database skip readonly;
backup database skip offline;
backup database skip inaccessible;
backup database ship readonly skip offline ship inaccessible;
backup database force;
backup database not backed up;
backup database not backed up since time=
backup check logical database;
backup validate check logical database;
backup database copies=
backup database device type disk includ current controlfile;
四
RMAN 配置參數為:
CONFIGURE RETENTION POLICY TO REDUNDANCY
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO
CONFIGURE DEVICE TYPE DISK PARALLELISM
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
NCFDBA
SQL> select name
configure retention policy to recovery window of
configure retention policy to redundancy
configure retention policy clear;
CONFIGURE RETENTION POLICY TO NONE;
第一種recover window是保持所有足夠的備份
第二種redundancy 是為了保持可以恢復的最新的
第三四
一般最安全的方法是采用第二種保持策略
configure backup optimization on;
configure backup optimization off;
configure backup optimization clear;
默認值為關閉
configure default device type to disk;
configure default device type to stb;
configure default device type clear;
是指定所有I/O操作的設備類型是硬盤或者磁帶
磁帶的設置是CONFIGURE DEFAULT DEVICE TYPE TO SBT;
configure controlfile autobackup on;
configure controlfile autobackup format for device type disk to
configure controlfile autobackup clear;
configrue controlfile autobackup format for device type disk clear;
configrue snapshot controlfile name to
configrue snapshot controlfile name clear;
強制數據庫在備份文件或者執行改變數據庫結構的命令之後將控制文件自動備份
configure device type disk|stb parallelism
configure device type disk|stb clear;
configure channel device type disk format
configure channel device type disk maxpiecesize
configure channel device type disk rate
configure channel
configure channel
configure channel
配置數據庫設備類型的並行度
configure datafile backup copies for device type disk|stb to
configure archivelog backup copies for device type disk|stb to
configure datafile|archivelog backup copies for device type disk|stb clear
BACKUP DEVICE TYPE DISK DATABASE
FORMAT
是配置數據庫的每次備份的copy數量
configure exclude for tablespace
configrue exclude clear;
此命令用於將指定的表空間不備份到備份集中
configure maxsetsize to
configure maxsetsize clear;
CONFIGURE AUXNAME FOR DATAFILE
CONFIGURE AUXNAME FOR DATAFILE
CONFIGURE AUXNAME FOR DATAFILE
CONFIGURE AUXNAME FOR DATAFILE
CONFIGURE AUXNAME FOR DATAFILE
CONFIGURE AUXNAME FOR DATAFILE
CONFIGURE AUXNAME FOR DATAFILE
CONFIGURE AUXNAME FOR DATAFILE
Rman的format格式中的%
%c 備份片的拷貝數
%d 數據庫名稱
%D 位於該月中的第幾天 (DD)
%M 位於該年中的第幾月 (MM)
%F 一個基於DBID唯一的名稱
日期
%n 數據庫名稱
%u 一個八個字符的名稱代表備份集與創建時間
%p 該備份集中的備份片號
%U 一個唯一的文件名
%s 備份集的號
%t 備份集時間戳
%T 年月日格式(YYYYMMDD)
From:http://tw.wingwit.com/Article/program/Oracle/201311/17971.html