Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3672941
  • 博文数量: 715
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7745
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(715)

文章存档

2023年(75)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

分类: Oracle

2020-11-18 10:18:19

临时发起个


  1. #!/bin/sh
  2. . /home/oracle/.bash_profile
  3. dir=/u02/rman/$ORACLE_SID
  4. mkdir -p $dir

  5. rman target / log=$dir/rman_backup.log<<EOF
  6. run {
  7.   allocate channel c1 type disk;
  8.   allocate channel c2 type disk;
  9.   allocate channel c3 type disk;
  10.   allocate channel c4 type disk;
  11.   allocate channel c5 type disk;
  12.   allocate channel c6 type disk;
  13.   backup as compressed backupset database filesperset 3 format '$dir/prod_full_%U';
  14.   sql 'alter system archive log current';
  15.   backup as compressed backupset archivelog all format '$dir/prod_arch_%U';
  16.   backup current controlfile format '$dir/prod_ctl_%U';
  17.   release channel c1;
  18.   release channel c2;
  19.   release channel c3;
  20.   release channel c4;
  21.   release channel c5;
  22.   release channel c6;
  23. }
  24. exit
  25. EOF




rman 每日20点 备份aix平台的oracle数据库

计划任务
0 20 * * * sh /home/oracle/rman_db_full.sh 

脚本内容;

点击(此处)折叠或打开

  1. #!/bin/sh
  2. . /home/oracle/.profile

  3. rman target / log=/dbbak/rman_backup.log<<EOF
  4. run {
  5.   allocate channel c1 type disk;
  6.   allocate channel c2 type disk;
  7.   allocate channel c3 type disk;
  8.   allocate channel c4 type disk;
  9.   allocate channel c5 type disk;
  10.   allocate channel c6 type disk;
  11.   backup as compressed backupset database filesperset 3 format '/dbbak/prod_full_%U';
  12.   sql 'alter system archive log current';
  13.   backup as compressed backupset archivelog all format '/dbbak/prod_arch_%U';
  14.   backup current controlfile format '/dbbak/prod_ctl_%U';
  15.   release channel c1;
  16.   release channel c2;
  17.   release channel c3;
  18.   release channel c4;
  19.   release channel c5;
  20.   release channel c6;
  21. }
  22. exit
  23. EOF



每日备份归档脚本

点击(此处)折叠或打开

  1. #!/bin/sh
  2. . /home/oracle/.profile

  3. rman target / log=/dbbak/rman_arch.log append <<EOF
  4. run {
  5.   allocate channel c1 type disk;
  6.   allocate channel c2 type disk;
  7.   allocate channel c3 type disk;
  8.   allocate channel c4 type disk;
  9.   allocate channel c5 type disk;
  10.   allocate channel c6 type disk;
  11.   backup as compressed backupset archivelog from time 'sysdate-1' format '/dbbak/prod_arch1_%U';
  12.   release channel c1;
  13.   release channel c2;
  14.   release channel c3;
  15.   release channel c4;
  16.   release channel c5;
  17.   release channel c6;
  18. }
  19. exit
  20. EOF



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