zoukankan      html  css  js  c++  java
  • 一周RMAN备份脚本

    #! /bin/bash
    #crontab---->00 20 * * 0 su - oracle -c '/scripts/oracle_full_backup.sh'
    #crontab---->00 20 * * 1-6 su - oracle -c '/scripts/oracle_inc_backup.sh'
    export BACKUP_DIR=/backup
    export ORACLE_HOME=/oracle/oracle/product/11.2.0/db_1
    #exec >> delarch`date +%y%m%d%H`.log
    exec > /backup/rman_orcldb_backup.log
    ###############################################
    $ORACLE_HOME/bin/rman target / <<EOF
    ########################start script_rman_full.sh #################################
    #backup database level=0
    run {
    ALLOCATE CHANNEL ch00 DEVICE TYPE DISK ;
    ALLOCATE CHANNEL ch01 DEVICE TYPE DISK ;
    backup as compressed backupset incremental level = 0 database format '$BACKUP_DIR/%d_%T_dbfull_%t_%s_%p';
    sql 'alter system archive log current';
    release CHANNEL ch00;
    release CHANNEL ch01;
    }
    #backup archivelog
    run{
    ALLOCATE CHANNEL ch00 DEVICE TYPE DISK CONNECT 'sys/oracle@orcldb1';
    ALLOCATE CHANNEL ch01 DEVICE TYPE DISK CONNECT 'sys/oracle@orcldb2';
    backup archivelog all format '$BACKUP_DIR/%d_%T_arch_%t_%s_%p' delete all input;
    release CHANNEL ch00;
    release CHANNEL ch01;
    }
    #backup controlfile
    run{
    ALLOCATE CHANNEL ch00 DEVICE TYPE DISK ;
    ALLOCATE CHANNEL ch01 DEVICE TYPE DISK ;
    backup current controlfile format '$BACKUP_DIR/%d_%T_ctl_%t_%s_%p';
    release CHANNEL ch00;
    release CHANNEL ch01;
    }
    delete noprompt obsolete recovery window of 30 days;
    ##########################end script_rman_full.sh #################################
    exit;
    EOF
    echo '===THE FULL BACKUP OF END TIME IS '$(date +%Y/%m/%d/%H:%M:%S)===

    #! /bin/bash
    #crontab---->00 20 * * 0 su - oracle -c '/scripts/oracle_full_backup.sh'
    #crontab---->00 20 * * 1-6 su - oracle -c '/scripts/oracle_inc_backup.sh'
    export BACKUP_DIR=/backup
    export ORACLE_HOME=/oracle/oracle/product/11.2.0/db_1
    #exec >> delarch`date +%y%m%d%H`.log
    exec > /backup/rman_orcldb_backup.log
    ###############################################
    $ORACLE_HOME/bin/rman target / <<EOF
    ########################start script_rman_inc.sh #################################
    #backup database level=1
    run {
    ALLOCATE CHANNEL ch00 DEVICE TYPE DISK ;
    ALLOCATE CHANNEL ch01 DEVICE TYPE DISK ;
    backup as compressed backupset incremental level = 1 cumulative database format '$BACKUP_DIR/%d_%T_dbinc_%t_%s_%p';
    sql 'alter system archive log current';
    release CHANNEL ch00;
    release CHANNEL ch01;
    }
    #backup archivelog
    run{
    ALLOCATE CHANNEL ch00 DEVICE TYPE DISK CONNECT 'sys/oracle@orcldb1';
    ALLOCATE CHANNEL ch01 DEVICE TYPE DISK CONNECT 'sys/oracle@orcldb2';
    backup archivelog all format '$BACKUP_DIR/%d_%T_arch_%t_%s_%p' delete all input;
    release CHANNEL ch00;
    release CHANNEL ch01;
    }
    #backup controlfile
    run{
    ALLOCATE CHANNEL ch00 DEVICE TYPE DISK ;
    ALLOCATE CHANNEL ch01 DEVICE TYPE DISK ;
    backup current controlfile format '$BACKUP_DIR/%d_%T_ctl_%t_%s_%p';
    release CHANNEL ch00;
    release CHANNEL ch01;
    }
    ##########################end script_rman_inc.sh #################################
    exit;
    EOF
    echo 'THE INC BACKUP OF END TIME IS '$(date +%Y/%m/%d/%H:%M:%S)

  • 相关阅读:
    团队任务拆解
    团队贡献分分配规则
    使用highcharts绘制美观的燃尽图
    【Alpha】阶段第一次Scrum Meeting
    项目功能规格说明书
    技术规格说明书
    软件工程团队第二次作业
    软工第一次团队作业
    团队作业 # 项目功能规格说明书
    团队作业 #2 —— 项目选择
  • 原文地址:https://www.cnblogs.com/datalife/p/7249635.html
Copyright © 2011-2022 走看看