說明:本文為Oracle RMAN帶庫備份恢複/帶庫全備恢複/帶庫0級備份恢複操作概要
溫馨提示:如果您發現本文哪裡寫的有問題或者有更好的寫法請留言或私信我進行修改優化
①帶庫備份
rman target / catalog rman/[email protected]
run
{
allocate channel zzt_disk01 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
allocate channel zzt_disk02 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
allocate channel zzt_disk03 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin/tdpo.opt)';
#資料檔案
crosscheck backup;
delete noprompt expired backup;
backup
incremental level 0 as compressed backupset
filesperset 10
tag zzt_level_0_data
format 'zzt_level_0_data_%s_%p_%t.dbf'
database;
#歸檔檔案(為了恢複需要,隻需要備份最近1天的即可)
sql 'alter system archive log current';
sql 'alter system archive log current';
sql 'alter system archive log current';
crosscheck archivelog all;
delete noprompt expired archivelog all;
backup
as compressed backupset archivelog
from time 'sysdate-1'
delete input
tag zzt_level_0_arch
filesperset 50
format 'zzt_level_0_arch_%s_%p_%t.arc';
#控制檔案
backup current controlfile tag zzt_level_0_cont
format 'zzt_level_0_cont_%s_%p_%t.ctl' ;
#參數檔案
backup spfile tag zzt_level_0_spfi
format 'zzt_level_0_spfi_%s_%p_%t.spf' ;
release channel zzt_disk01;
release channel zzt_disk02;
release channel zzt_disk03;
}
②帶庫恢複
rman target / catalog rman/[email protected]
run
{
allocate channel zzt_disk01 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel zzt_disk02 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
allocate channel zzt_disk03 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
crosscheck backup;
crosscheck archivelog all;
restore spfile;
restore controlfile;
resotre database;
recover database;
release channel zzt_disk01;
release channel zzt_disk02;
release channel zzt_disk03;
}
※ 如果您覺得文章寫的還不錯, 别忘了在文末給作者點個贊哦 ~
over