Chinaunix首页 | 论坛 | 博客
  • 博客访问: 676617
  • 博文数量: 163
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1625
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-24 11:40
个人简介

资深Oracle数据库专家 OCM认证大师 10年数据库相关服务及开发经验 各类数据库相关方案的编写,管理及实施 数据中心数据库日常运维、大型项目割接、性能优化等方面有丰富的实战经验 客户包括: 电信,银行,保险,航空,国网,汽车,烟草等 想要一起学习探讨数据安全技术的请加qq群 256041954

文章分类

全部博文(163)

文章存档

2017年(2)

2016年(112)

2015年(38)

2014年(11)

我的朋友

分类: Oracle

2014-12-23 17:16:51

[oracle@BossServerA ~]$ crontab -l
30 3 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31 * * /rmanback/SMSdg/dbbackup/rman_bk.sh
30 1 27 * * /opt/oracle/product/any.sh
30 4 * * * /bossdata/clean_arch.sh


1:
[oracle@BossServerA ~]$ more /rmanback/SMSdg/dbbackup/rman_bk.sh
#!/bin/bash
. /home/oracle/.bash_profile
echo "Backup Beginning time:" `date +'%Y-%m-%d %H:%M'`
env
dir_data=`/bin/awk '{print $1}' /rmanback/SMSdg/dbbackup/last_dir`
if [ "$dir_data" == "u01" ]
then
/opt/oracle/product/10.2/bin/rman target / nocatalog log=/rmanback/SMSdg/dbbackup/log.rman @/rmanback/backup_s.rman
cp /opt/oracle/product/10.2/dbs/lkSTARBOSS* /rmanback/u01/rmanbackup/dbs_s/.
cp /opt/oracle/product/10.2/dbs/orapwstarboss /rmanback/u01/rmanbackup/dbs_s/.
echo "u02" > /rmanback/SMSdg/dbbackup/last_dir
else
/opt/oracle/product/10.2/bin/rman target / nocatalog log=/rmanback/SMSdg/dbbackup/log.rman @/rmanback/backup_d.rman
cp /opt/oracle/product/10.2/dbs/lkSTARBOSS* /rmanback/u02/rmanbackup/dbs_d/.
cp /opt/oracle/product/10.2/dbs/orapwstarboss /rmanback/u02/rmanbackup/dbs_d/.
echo "u01" > /rmanback/SMSdg/dbbackup/last_dir
fi
echo "Backup End time:" `date +'%Y-%m-%d %H:%M'`


2:
[oracle@BossServerA ~]$ more /rmanback/backup_s.rman
report obsolete;
delete noprompt obsolete;
run{
allocate channel d1 type disk MAXPIECESIZE 2000M;
allocate channel d2 type disk MAXPIECESIZE 2000M;
allocate channel d3 type disk MAXPIECESIZE 2000M;
allocate channel d4 type disk MAXPIECESIZE 2000M;
backup filesperset 8 database tag bbbossdb_s include current controlfile format '/rmanback/u01/rmanbackup/backup_s/bossdb%d%U.dbf.%T';
sql 'alter system archive log current';
sql 'alter system archive log current';
backup filesperset 20 format '/rmanback/u01/rmanbackup/dbs_s/bossdblog_t%t_s%s_p%p' archivelog all;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
delete archivelog until time 'sysdate-3';
quit


3:
[oracle@BossServerA ~]$ more /opt/oracle/product/any.sh
sqlplus /nolog @/opt/oracle/product/analyze.sql
4:
[oracle@BossServerA ~]$ more /bossdata/clean_arch.sh
find /bossdata/Archive_log/ -name "*.dbf" -mtime 20 -exec rm {} \;

阅读(1710) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~