zoukankan      html  css  js  c++  java
  • rman备份脚本

    $ more backup_full_xxb.sh

    # database rman backup full

    ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
    ORACLE_HOME=$ORACLE_BASE/product/11.2/db_1; export ORACLE_HOME
    ORA_CRS_HOME=/oracle/product/10.2.0/crs; export ORA_CRS_HOME
    ORACLE_SID=cpzb20161; export ORACLE_SID


    # run
    echo "begin time: `date '+%Y/%m/%d'` `date '+%H:%M:%S'`"
    rq1=`date '+%Y/%m/%d'`" "`date '+%H:%M:%S'`

    rman target / cmdfile=/backup/run_full.sh >/backup/full.log

    rq2=`date '+%Y/%m/%d'`" "`date '+%H:%M:%S'`
    echo "rman time : "$rq1"---"$rq2 >>/backup/full.log

    $ more run_full.sh
    run
    {allocate channel t1 type disk;
    allocate channel t2 type disk;
    backup database skip read only
    format '/backup/rmanbackup/full_%t_%s_%p_%T';
    release channel t1;
    release channel t2;
    }

    run{
    allocate channel t3 type disk;
    backup archivelog until time 'sysdate-1' delete input format '/backup/rmanbackup/full_arch_%t' ;
    sql "alter system archive log current";
    backup current controlfile format '/backup/rmanbackup/ctl_%t_%s_%p_%T';
    crosscheck backup;
    crosscheck archivelog all;
    delete obsolete device type disk;
    release channel t3;
    }

    exit;


    排除某个表空间可以使用类似如下命令:

    configure exclude for tablespace users;
    如果想取消排除设置则可以使用如下命令:

    CONFIGURE EXCLUDE FOR TABLESPACE users CLEAR;
    此外常用的排除备份命令还有:

    BACKUP DATABASE SKIP READONLY, SKIP OFFLINE;
    configure exclude for tablespace users;

    configrue exclude clear; --清除设置

    BACKUP DATABASE NOEXCLUDE; --会备份USERS表空间

    此命令用于将指定的表空间不备份到备份集中。

    RMAN> configure exclude for tablespace users;

  • 相关阅读:
    搭建集群时遇到各种奇葩问题的大招~~
    oracle初学心得(转)
    "小寒"饮食养生
    时刻修正自已的思想
    myeclipse使用
    从javascript语言本身谈项目实战(转)
    Java的内存泄漏(转)
    概念解释
    小穴位大健康——李智
    历史朝代表
  • 原文地址:https://www.cnblogs.com/Wardenking/p/11242283.html
Copyright © 2011-2022 走看看