#!/bin/sh
source /home/oracle/.bash_profile
$ORACLE_HOME/bin/rman <<EOF
connect target /
run{
allocate channel 'd1' type disk;
allocate channel 'd2' type disk;
allocate channel 'd3' type disk;
allocate channel 'd4' type disk;
backup full tag 'dbfull' format '/archive/backup/full%u_%p_%c' database;
sql 'alter system archive log current';
backup format '/archive/backup/%T_arch_%s_%p' archivelog all delete input;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
list backup;
exit;
EOF
echo "-------------------------end------------------------------";date
crontab的格式:
minutes|hours|day of month|month|day of week|
下面是在CRONTAB里面的语句
03 23 * * 0 /home/oracle/backupscript/b_fullbackup.sh
00 02 01 * *
上面是一个全备份。
下面是一个一零级备份的脚本:
source /home/oracle/.bash_profile
$ORACLE_HOME/bin/rman <<EOF
connect target /
run{
allocate channel 'd1' type disk;
allocate channel 'd2' type disk;
allocate channel 'd3' type disk;
allocate channel 'd4' type disk;
backup incremental level 0 cumulative tag 'db0' format '/home/oracle/backup/db0%u_%s_%p' database;
sql 'alter system archive log current';
backup filesperset 4 archivelog all delete input;
delete noprompt obsolete;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
list backup;
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
exit;
EOF
echo "-------------------------end------------------------------";date
下面是一个一级备份脚本:
source /home/oracle/.bash_profile
$ORACLE_HOME/bin/rman <<EOF
connect target /
run{
allocate channel 'd1' type disk;
allocate channel 'd2' type disk;
allocate channel 'd3' type disk;
allocate channel 'd4' type disk;
backup incremental level 1 cumulative tag 'db1' format '/home/oracle/backup/db1%u_%s_%p' database;
sql 'alter system archive log current';
backup filesperset 4 archivelog all delete input;
delete noprompt obsolete;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
list backup;
crosscheck backup;
delete noprompt expired backup;
delete noprompt obsolete;
exit;
EOF
echo "-------------------------end------------------------------";date
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1;
export ORACLE_HOME
ORACLE_SID=orcl1;
export ORACLE_SID
rq=" data+'%m%d' "
/u01/app/oracle/product/10.2.0/db_1/bin/exp system/oracle file=/bak/backup/exp$rq.dmp full=y
分享到:
相关推荐
linux环境下oracle备份脚本.pdf
linux环境下oracle备份脚本参照.pdf
Oracle备份脚本(Linux)
Linux下实现Oracle数据库自动备份的脚本
Linux oracle 自动备份脚本,学习了
linux下oracle数据库备份的脚本文件
oracle数据库的自动化备份脚本,生产环境多次验证过。包含 oracle rman 备份和 expdp备份。
linux 下的 oracle 自动备份脚本
windows下备份脚本,常见linux下备份脚本,现在这是windows平台,经测试可实际应用的脚本
Oracle数据库热备份脚本, 可以备份dbf, ora, ctl文件. bat批处理文件, 适用于windows系统, oracle11g测试有效.
Linux环境下rman备份的实例脚本
linux下oracle备份的shell脚本,带压缩功能,附带操作说明,只需要会cv
linux环境下,oracle自动备份的shell脚本
Linux 环境维护Oracle数据库,对数据库进行备份.及其操作.
linux 平台下的rman全备份和增量备份
oracle 11g rman 全备份脚本
Linux服务器备份Oracle脚本及设置CRON详细步骤。 1、包含shell脚本 2、包含crontab的详细设置 3、线上生产环境专用脚本
linux下oracle数据泵备份完美解决了数据备份的完整性,这里提供大家数据泵自动备份的脚本,为各类生产环境中的数据的备份提供的较完善的解决方案
在windows系统下去备份linux数据库服务上的...本文以上述环境为备份场景,采用物理增量备份方法,制定备份策略,包括自动备份的脚本以及任务计划的配置。 本文可作为oracle自动物理增量备份手册,为运维人员参考采用。