Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3233211
  • 博文数量: 949
  • 博客积分: 10126
  • 博客等级: 上将
  • 技术积分: 12100
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-16 10:57
文章分类

全部博文(949)

文章存档

2013年(1)

2012年(4)

2011年(4)

2010年(12)

2009年(342)

2008年(586)

分类: Oracle

2009-04-14 12:59:07

备份脚本分享一下,集群环境:

全备:

export ORACLE_SID=solo1
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.3
rq=` date +"20%y%m%d%H%M%S" `
/oracle/app/oracle/product/10.2.3/bin/rman nocatalog target rman/rman log=/oracle/rman /backup_log/backupall_$rq.log<
run
{
allocate channel ch1 device type disk connect ;
allocate channel ch2 device type disk connect ;
allocate channel ch3 device type disk connect ;
allocate channel ch4 device type disk connect ;
allocate channel ch5 device type disk connect ;
allocate channel ch6 device type disk connect ;
allocate channel ch7 device type disk connect ;
allocate channel ch8 device type disk connect ;
crosscheck backup;
crosscheck archivelog all;
sql 'alter system archive log current';
backup database format '/eaibak/fullbak/db_%d_%T_%U';
sql 'alter system archive log current';
backup archivelog all format '/eaibak/fullbak/arc_%t_%s' delete all input;
backup format '/eaibak/fullbak/cntrl_%s_%p_%t' current controlfile;
crosscheck backup;
crosscheck archivelog all;
delete expired backup;
delete obsolete;
delete  noprompt backup of database completed before 'sysdate -15';
delete  archivelog all;
delete  noprompt backup of archivelog all completed before 'sysdate -15';
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
release channel ch6;
release channel ch7;
release channel ch8;
}
EOF


归档:

export ORACLE_SID=solo1
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.3
rq=` date +"20%y%m%d%H%M%S" `
/oracle/app/oracle/product/10.2.3/bin/rman nocatalog target rman/rman log=/oracle/rman /backup_log/backuparc_$rq.log<run
{
allocate channel ch1 device type disk connect ;
allocate channel ch2 device type disk connect ;
allocate channel ch3 device type disk connect ;
allocate channel ch4 device type disk connect ;
allocate channel ch5 device type disk connect ;
allocate channel ch6 device type disk connect ;
allocate channel ch7 device type disk connect ;
allocate channel ch8 device type disk connect ;
sql 'alter system archive log current';
backup archivelog all format '/eaibak/fullbak/arc_%t_%s' delete all input;
crosscheck archivelog all;
delete archivelog all;
release channel ch1;
release channel ch2;
release channel ch3;
release channel ch4;
release channel ch5;
release channel ch6;
release channel ch7;
release channel ch8;
}
EOF

可以大致的监控到RMAN备份进行的程度

SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,
ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
FROM V$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%'
AND OPNAME NOT LIKE '%aggregate%'
AND TOTALWORK != 0
AND SOFAR <> TOTALWORK;

阅读(1023) | 评论(0) | 转发(0) |
0

上一篇:tag:rman

下一篇:00600

给主人留下些什么吧!~~