• 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;

  • 相关阅读:
    查漏补缺:QT入门
    添砖加瓦:设计模式(工厂方法模式)
    Luogu 4784 [BalticOI 2016 Day2]城市
    Luogu 1606 [USACO07FEB]白银莲花池Lilypad Pond
    Luogu 3698 [CQOI2017]小Q的棋盘
    CF547D Mike and Fish
    Luogu 3066 [USACO12DEC]逃跑的BarnRunning Away From…
    Luogu 2403 [SDOI2010]所驼门王的宝藏
    NEERC17 J Journey from Petersburg to Moscow
    Luogu 3350 [ZJOI2016]旅行者
  • 原文地址:https://www.cnblogs.com/Wardenking/p/11242283.html
Copyright © 2020-2023  润新知