HP Data Protector Manager 備份和恢復oracle資料庫參考指令碼

mengbing1990發表於2016-10-18
1.備份指令碼
run {
allocate channel 'dev_0' type 'sbt_tape'
 parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=host1)';
allocate channel 'dev_1' type 'sbt_tape'
 parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=host1)';
allocate channel 'dev_2' type 'sbt_tape'
 parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=host1)';
allocate channel 'dev_3' type 'sbt_tape'
 parms 'ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=host1)';
sql 'alter system archive log current';
backup incremental level <incr_level>
 format 'host1<xxxx_%s:%t:%p>.dbf'
 database;
crosscheck archivelog all;
delete expired archivelog all;
backup
 format 'host1<xxxx_%s:%t:%p>.dbf'
 archivelog all
 delete input;
backup
 format 'host1<xxxx_%s:%t:%p>.dbf'
 current controlfile;
}
2.restore指令碼
(前提
1.restore 制定時間的control file
Scp controlfiles

 Cp cotrolfile.dbf control01.ctl control02.ctl control03.ctl

2.Scp initORA

  Scp pfile

  Vi  .bash_pfile

3.Mkdir data01 data02

4.Rman target /

5.Startup mount

Restore

Recover


run {
allocate channel 'dev_0' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=1283838676,OB2BARHOSTNAME=host1)';
allocate channel 'dev_1' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=1283838676,OB2BARHOSTNAME=host1)';
allocate channel 'dev_2' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=1283838676,OB2BARHOSTNAME=host1)';
allocate channel 'dev_3' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=1283838676,OB2BARHOSTNAME=host1)';
restore database;
release channel 'dev_0';
release channel 'dev_1';
release channel 'dev_2';
release channel 'dev_3';
}
3.recover指令碼
allocate channel 'dev_1' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=1283838676,OB2BARHOSTNAME=host1)';
allocate channel 'dev_2' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=1283838676,OB2BARHOSTNAME=host1)';
allocate channel 'dev_3' type 'sbt_tape'
parms 'SBT_LIBRARY=/opt/omni/lib/libob2oracle8_64bit.so,ENV=(OB2BARTYPE=Oracle8,OB2APPNAME=xxxx,OB2BARLIST=1283838676,OB2BARHOSTNAME=host1)';
set until logseq 1234 thread 1;  -----logseq 在rman中檢視,list backupset all;找最後一個seq,然後加一在裡面。
recover database;
release channel 'dev_0';
release channel 'dev_1';
release channel 'dev_2';
release channel 'dev_3';
}

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29551564/viewspace-2126664/,如需轉載,請註明出處,否則將追究法律責任。

相關文章