zoukankan      html  css  js  c++  java
  • rmanbak.sh


    #creation:2021-02-02
    #Define variable
    date=`date +%Y%m%d`
    basedir=/data2/backup

    #Create
    cd $basedir
    mkdir rmanbak0_$date

    #delete expire document
    #find $basedir -name "rmanbak0_*" -mtime +7 |xargs rm -rf

    #Create pfile from spfile
    sqlplus / as sysdba <<EOF
    create pfile='$basedir/rmanbak0_$date/pfile$date.ora' from spfile;
    EOF

    #RMAN BACKUP DATABASE
    rman target / log=$basedir/rmanbak0_$date/rman_$date.log <<EOF
    run{
    allocate channel c1 device type disk;
    allocate channel c2 device type disk;
    allocate channel c3 device type disk;
    allocate channel c4 device type disk;
    backup database filesperset 4 format '$basedir/rmanbak0_$date/rman_full_%d_%T_%s_%p';
    sql 'alter system archive log current';
    sql 'alter system archive log current';
    backup archivelog all format '$basedir/rmanbak0_$date/rman_arch_%d_%T_%s_%p' delete input;
    #backup archivelog all format '$basedir/rmanbak0_$date/rman_arch_%d_%T_%s_%p';
    #delete archivelog until time 'sysdate-7';
    backup current controlfile format '$basedir/rmanbak0_$date/rman_ctl_%d_%T_%s_%p';
    release channel c1;
    release channel c2;
    release channel c3;
    release channel c4;

    }
    EOF

    #cd $basedir
    #tar -zcvf rmanbak$date.tar.gz rmanbak$date
    #rm -rf rmanbak$date
    #see tar -xzvf rmanbak$date.tar.gz

  • 相关阅读:
    Linux 环境变量 设置 etc profile
    Linux 升级glibc-2.14 失败 我遇到的问题
    qt窗口的切换
    qt事件机制---事件范例
    qt中的事件机制
    qt的信号与槽函数
    linux下qt的安装
    qt中的udp编程
    qt中的tcp编程
    qt中的多线程
  • 原文地址:https://www.cnblogs.com/oracle-ziyuhou/p/14387594.html
Copyright © 2011-2022 走看看