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 <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
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';
}
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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 恢復目錄資料庫備份指令碼資料庫指令碼
- InnoDB 中文參考手冊 --- 6 備份和恢復 InnoDB 資料庫 (轉)資料庫
- 【備份恢復】從備份恢復資料庫資料庫
- 課時7-備份與恢復----資料庫備份策略指令碼資料庫指令碼
- oracle資料庫備份和恢復的內容Oracle資料庫
- 備份和恢復postgreSQL資料庫SQL資料庫
- 資料庫資料的恢復和備份資料庫
- oracle資料庫的備份與恢復Oracle資料庫
- PostgreSql資料庫的備份和恢復SQL資料庫
- Mongo 資料庫備份和恢復命令Go資料庫
- 備份和恢復SQL Server資料庫SQLServer資料庫
- Oracle資料庫冷備和恢復Oracle資料庫
- 備份與恢復:polardb資料庫備份與恢復資料庫
- Oracle資料庫備份與恢復之RMANOracle資料庫
- Oracle資料庫的備份與恢復(轉)Oracle資料庫
- Oracle 資料庫的備份與恢復(轉)Oracle資料庫
- 【備份恢復】Oracle 資料備份與恢復微實踐Oracle
- 使用Mysqldump備份和恢復MySQL資料庫MySql資料庫
- 非RMAN熱備份資料庫和恢復資料庫
- db2備份和恢復資料庫DB2資料庫
- oracle資料庫使用rman備份指令碼Oracle資料庫指令碼
- Oracle多例項資料庫備份指令碼Oracle資料庫指令碼
- 【備份恢復】noarchive模式下使用增量備份恢復資料庫Hive模式資料庫
- Oracle 備份和恢復Oracle
- 【RMAN】Oracle12c以後rman 備份恢復命令參考Oracle
- Oracle資料庫備份與恢復之三:OS備份/使用者管理的備份與恢復Oracle資料庫
- HP -Data Protector Restore file systemREST
- Oracle資料庫冷備份的異地恢復Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(6)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(5)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(4)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(3)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(2)Oracle資料庫
- ORACLE RAC資料庫的備份與恢復(1)Oracle資料庫
- 資料庫備份指令碼資料庫指令碼
- 【備份恢復】在 ARCHIVELOG 模式下執行資料庫還原和恢復操作(源庫備份源庫恢復)Hive模式資料庫
- 達夢資料庫備份恢復資料庫
- postgresql備份與恢復資料庫SQL資料庫