aix linux tab,AIX/Linux生产环境下crontab自动调度RMAN物理备份例子

rmanBackupL0(rman 0级增量备份执行脚本):

run{

backup as compressed backupset incremental level 0 database plus archivelog delete all input;

crosscheck backup;

delete noprompt expired backup;

delete noprompt obsolete;

delete noprompt backup of archivelog all;

backup current controlfile;

sql 'alter database backup controlfile to trace';

}

rmanBackupL1(rman 1级增量备份执行脚本):

run{

backup as compressed backupset incremental level 1 database plus archivelog delete input;

}

rmanL0Call.sh(Linux系统执行rman 0级备份shell脚本):

#! /bin/sh

export ORACLE_HOME=/u01/app/oracle/db_1

export ORACLE_SID=test

/u01/app/oracle/db_1/bin/rman target / nocatalog cmdfile=/u01/app/oracle/scripts/rmanBackupL0 log=/u01/app/oracle/scripts/logs/rmanBackupL0.log append

rmanL1Call.sh(Linux系统执行rman 1级备份shell脚本):

#! /bin/sh

export ORACLE_HOME=/u01/app/oracle/db_1

export ORACLE_SID=test

/u01/app/oracle/db_1/bin/rman target / nocatalog cmdfile=/u01/app/oracle/scripts/rmanBackupL1 log=/u01/app/oracle/scripts/logs/rmanBackupL1.log append

cron_rmanL0(crontab自动调度rman 0级备份脚本):

0,10,20,30,40,50 * * * * /u01/app/oracle/scripts/rmanL0Call.sh

cron_rmanL1(crontab自动调度rman 1级备份脚本):

6,15,17,24,27,34,37,44,47,54,57 * * * * /u01/app/oracle/scripts/rmanL1Call.sh

注意:

我们一般在oracle用户下通过crontab同时调用0级备份和1级备份,那么我们可以执行crontab -e命令,

加入:

0,10,20,30,40,50 * * * * /u01/app/oracle/scripts/rmanL0Call.sh

6,15,17,24,27,34,37,44,47,54,57 * * * * /u01/app/oracle/scripts/rmanL1Call.sh

保存退出,就可以执行2个脚本同时调度了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值