zoukankan      html  css  js  c++  java
  • 【Vegas原创】RMAN数据库Daily备份脚本(Linux版)

    例:添加oralin数据库每日RMAN备份

    1,添加/u03/script/oralin/fullbak.sh
    #!/bin/sh
    echo "`date` 
    backup start"
    $ORACLE_HOME
    /bin/rman target / nocatalog <<EOF
    run{
    allocate channel c1 type 
    disk;
    allocate channel c2 type 
    disk;
    allocate channel c3 type 
    disk;
    backup  format '/u03/dmp/oralin/dbfile/full%u_%s_%p' database
    include 
    current controlfile;
    sql 
    'alter system archive log current';
    backup filesperset 3 format '/u03/dmp/oralin/log/arch%u_%s_%p'
    archivelog 
    all delete input;
    release channel c1;
    release channel c2;
    release channel c3;
    }
    EOF
    echo "`date` 
    backup successful"
    exit;

    2,添加/u03/script/oralin/delobsolete.sh
    $ORACLE_HOME/bin/rman target / nocatalog <<EOFi
    run{
    crosscheck archivelog 
    all;
    crosscheck 
    backup;
    delete noprompt obsolete;
    }

    3,crontab -e,添加:
    00 03 * * * su - oracle -c "sh /u03/script/oralin/fullbak.sh">/u03/script/oralin/full.log
    00 07 * * * su - oracle -c "sh /u03/script/oralin/delobsolete.sh">/u03/script/oralin/delobsolete.log
  • 相关阅读:
    通过mixins方法处理调取服务器时间
    记录个人对vuex的简单理解
    利用弹性布局实现垂直居中
    vue.set的适用方法
    深拷贝和浅拷贝的实现方法
    Maven安装步骤
    build tools
    Git
    Url和Uri的区别
    函数式编程语言
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/3744320.html
Copyright © 2011-2022 走看看