ORACLE 一个完整的rman备份脚本
2017-08-31 09:37
579 查看
#!/bin/bash
. ~/.bash_profile
export ORACLE_SID=prdrisk
DATE1=`date '+%Y%m%d'_%H%M%S`
mv /dbfile/scripts/log/*.log /dbfile/scripts/logs/.
$ORACLE_HOME/bin/rman log=/dbfile/scripts/log/Rman_prdrisk_$DATE1.log << EOF
connect target /;
crosscheck archivelog all;
run {
allocate channel ch1 device type disk ;
report schema;
crosscheck backup of database;
crosscheck backup of archivelog all;
crosscheck backup of controlfile;
crosscheck backup of spfile;
crosscheck archivelog all;
delete noprompt force expired backup;
delete noprompt force expired archivelog until time 'sysdate-0.5';
delete noprompt force expired copy;
delete noprompt force obsolete;
report need backup;
report unrecoverable;
release channel ch1;
}
run{
allocate channel ch1 device type disk maxpiecesize=4096M;
allocate channel ch2 device type disk maxpiecesize=4096M;
allocate channel ch3 device type disk maxpiecesize=4096M;
allocate channel ch4 device type disk maxpiecesize=4096M;
backup as compressed backupset incremental level 0
format '/dbfile/rmanbak/prdrisk_%p_%s_%u.ful'
(database);
sql 'alter system archive log current';
backup as compressed backupset
format '/dbfile/rmanbak/prdrisk_%p_%s_%u.arb'
(archivelog all);
backup
format '/dbfile/rmanbak/prdrisk_%p_%s.ctb'
(current controlfile);
backup spfile format '/dbfile/rmanbak/%d_sp_%s_%p_%t.sbk' tag 'spfile_backup';
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
}
exit;
EOF
. ~/.bash_profile
export ORACLE_SID=prdrisk
DATE1=`date '+%Y%m%d'_%H%M%S`
mv /dbfile/scripts/log/*.log /dbfile/scripts/logs/.
$ORACLE_HOME/bin/rman log=/dbfile/scripts/log/Rman_prdrisk_$DATE1.log << EOF
connect target /;
crosscheck archivelog all;
run {
allocate channel ch1 device type disk ;
report schema;
crosscheck backup of database;
crosscheck backup of archivelog all;
crosscheck backup of controlfile;
crosscheck backup of spfile;
crosscheck archivelog all;
delete noprompt force expired backup;
delete noprompt force expired archivelog until time 'sysdate-0.5';
delete noprompt force expired copy;
delete noprompt force obsolete;
report need backup;
report unrecoverable;
release channel ch1;
}
run{
allocate channel ch1 device type disk maxpiecesize=4096M;
allocate channel ch2 device type disk maxpiecesize=4096M;
allocate channel ch3 device type disk maxpiecesize=4096M;
allocate channel ch4 device type disk maxpiecesize=4096M;
backup as compressed backupset incremental level 0
format '/dbfile/rmanbak/prdrisk_%p_%s_%u.ful'
(database);
sql 'alter system archive log current';
backup as compressed backupset
format '/dbfile/rmanbak/prdrisk_%p_%s_%u.arb'
(archivelog all);
backup
format '/dbfile/rmanbak/prdrisk_%p_%s.ctb'
(current controlfile);
backup spfile format '/dbfile/rmanbak/%d_sp_%s_%p_%t.sbk' tag 'spfile_backup';
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
}
exit;
EOF
相关文章推荐
- 一个完整的RMAN备份脚本
- 一次完整的oracle rman备份与恢复的例子
- Linux 下 Oracle备份脚本(RMAN/EXP)
- ORACLE模拟一个数据文件坏块并使用RMAN备份来恢复
- Linux 下 Oracle备份脚本(RMAN/EXP)
- Oracle RMAN备份脚本
- Oracle RMAN备份脚本
- Oracle的RMAN备份与恢复脚本
- oracle rman自动备份脚本
- 完整的oracle rman备份恢复的例子
- ORACLE RMAN 增量备份完整恢复测试
- Windows下oracle RMAN备份脚本
- oracle rman备份脚本
- Linux下完整的RMAN增量备份shell脚本
- Oracle RMAN 备份恢复方案及脚本
- ORACLE RMAN备份的脚本配置
- Oracle生产环境RMAN备份脚本
- 转帖:完整的ORACLE RMAN 备份恢复…
- Oracle Rman备份脚本与自动删除重复备份文件
- Oracle的RMAN备份与恢复脚本