HP Data Protector Manager 备份和恢复oracle数据库参考脚本

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
 format 'host1.dbf'
 database;
crosscheck archivelog all;
delete expired archivelog all;
backup
 format 'host1.dbf'
 archivelog all
 delete input;
backup
 format 'host1.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';
}
请使用浏览器的分享功能分享到微信等