Oracle-10g数据库一周备份方案的设计(linux)

实施思路:
1、mkdir
cd /rmanbak
2、通用脚本
connect.rcv
connect catalog rmanuser/rman@orac;
connect target sys/system@clonedb;
global_del global_arch global_ctl
1、
rman>replace global script. global_del{
allocate channel d1 device type disk;
delete obsolete recovery window of 15 days;
release channel d1;
}
---查看----
list global script. names;
print global script  global_bkctl;
{allocate channel d1 device type disk;
backup as compressed backupset
format='/rmanbak.backupctl.ctl'
tag ='bkctl'
channel = d1
current controlfile reuse;
release channel d1;
}
2.
rman> replace global script. global_arch commect "backup archivelog  
as well as delete input"{
allocate channel d1 device type disk;
sql " alter database archive log current";
set limit channel d1 readrate = 10240;
set limit channel d1 kbytes = 4096000;
backup as compressed backupset
format='/rmanbak/arch_%d_%U'
tag = 'bkarch'
channel = d1
archivelog all delete input;
replease channel d1;
}
零级备份
rman> replace global script. global_inc0 comment
"backup database as incremental level 0"{
execute global script  global_del;
allocate channel d1 device type disk;
set limit channel d1 readrate = 10240;
set limit channel d1 kbytes = 4096000;
backup as compressed backupset
incremental level = 0
format ='/rmanbak/inc0_%d_%U'
tag = 'inc0'
channel =d1
database;
release channel d1;
execute global script. global_arch;
execute global script. global_bkctl;
}
1级备份
rman> replace global script. global_inc1 comment
"backup database as incremental level 1"{
execute global script  global_del;
allocate channel d1 device type disk;
set limit channel d1 readrate = 10240;
set limit channel d1 kbytes = 4096000;
backup as compressed backupset
incremental level = 1
format ='/rmanbak/inc0_%d_%U'
tag = 'inc1'
channel =d1
database;
release channel d1;
execute global script. global_arch;
execute global script. global_bkctl;
}
2级备份
rman> replace global script. global_inc2 comment
"backup database as incremental level 2"{
execute global script  global_del;
allocate channel d1 device type disk;
set limit channel d1 readrate = 10240;
set limit channel d1 kbytes = 4096000;
backup as compressed backupset
incremental level = 2
format ='/rmanbak/inc0_%d_%U'
tag = 'inc2'
channel =d1
database;
release channel d1;
execute global script. global_arch;
execute global script. global_bkctl;
}
--检验脚本
run{
execute global script. global_inc0;
execute global script. global_inc1;
execute global script. global_inc2;
}
3、Cmdfile$rman catalog script.
执行外部命令:
rman cmdfile=/rmanbak/script/connect.rcv
vi inc0.rcv
@@/rmanbak/script/connect.rcv
run{
execute global script. global_inc0;
}
exit
*******************************************
vi inc1.rcv
@@/rmanbak/script/connect.rcv
run{
execute global script. global_inc1;
}
exit
*******************************************
vi inc2.rcv
*******************************************
@@/rmanbak/script/connect.rcv
run{
execute global script. global_inc2;
}
exit
*******************************************
4、shell script.
vi inc0.sh
****************************************************
nohup$ORACLE_HOME/bin/rman cmdfile=/rmanbak/dcript/inc0.rcv
log = /rmanbak/script/inc0.log append
$
****************************************************
vi inc1.sh
***************************************************
nohup$ORACLE_HOME/bin/rman cmdfile=/rmanbak/dcript/inc1.rcv
log = /rmanbak/script/inc1.log append
$
***************************************************
vi inc2.sh
****************************************************
nohup$ORACLE_HOME/bin/rman cmdfile=/rmanbak/dcript/inc2.rcv
log = /rmanbak/script/inc2.log append
$
***************************************************
5、crontab -e(备份计划和方案)
***************************************************
#min  hour  date  mon  day   command
0         1         *       *       0        /rmanbak/script/inc0.sh
0         1         *       *       1       /rmanbak/script/inc2.sh
0         1         *       *       2       /rmanbak/script/inc2.sh
0         1         *       *       3      /rmanbak/script/inc2.sh
0         1         *       *       4      /rmanbak/script/inc1.sh
0         1         *       *       5     /rmanbak/script/inc2.sh
0         1        *        *       6     /rmanbak/script/inc2.sh
**************************************************
6、chown u+x*.sh(执行权限)
experience:
1、bakckup controlfile in each script's tail
2、delete obsolete backupset in each script's thrashold
3、switch logfile before backup database
4、chmod u+x*.sh

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14136468/viewspace-534831/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/14136468/viewspace-534831/

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值