zoukankan      html  css  js  c++  java
  • rman 脚本大全

    ################################################################
    一个增量备份的例子脚本
    ################################################################
    #!/bin/bash
    # incremental level 0 backup script

    source /home/oracle/.bash_profile

    current_day=`date +%Y%m%d`
    incr_day=102_incr_$current_day
    mkdir /data/oracle/ora_backup/$incr_day
    echo '-------------------------------------'
    echo "-- Begin Increment Backup of DB 10.103.23.102 DateTime: `date` --"
    echo '-------------------------------------'
    rman target / <<EOF
    run
    {
    CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
    CONFIGURE BACKUP OPTIMIZATION ON;
    CONFIGURE CONTROLFILE AUTOBACKUP ON;
    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/data/oracle/ora_backup/$incr_day/PID-%F';
    CONFIGURE DEVICE TYPE DISK PARALLELISM 4;
    crosscheck backup;
    delete noprompt obsolete;
    delete noprompt expired backup;
    allocate channel dev1 type disk maxpiecesize=30720M;
    allocate channel dev2 type disk maxpiecesize=30720M;
    allocate channel dev3 type disk maxpiecesize=30720M;
    allocate channel dev4 type disk maxpiecesize=30720M;
    backup as compressed backupset incremental level 1 tag='db1'
    format '/data/oracle/ora_backup/$incr_day/%n_%T_%U' database;
    sql 'alter system archive log current';
    backup archivelog all format '/data/oracle/ora_backup/$incr_day/arc_%n_%T_%U' delete all input;
    release channel dev1;
    release channel dev2;
    release channel dev3;
    release channel dev4;
    }
    EOF
    echo '------------------------------------'
    echo "-- End Increment Backup of DB 10.103.23.102 DateTime: `date` --"
    echo '------------------------------------'
    scp -l 51200 -r /data/oracle/ora_backup/$incr_day oracle@10.103.23.103:/data/oracle/ora_backup102 &
    wait
    echo '------------------------------------'
    echo "-- End of Send file to 10.103.23.103 DateTime: `date` --"
    echo '------------------------------------'
    echo ''
    echo ''

  • 相关阅读:
    nested exception is java.lang.IllegalStateException: No persistence units parsed from {classpath*:META-INF/persistence.xml}
    Thrift Expected protocol id ffffff82 but got 0
    idea
    Activity工作流入门之HelloWorld
    Thrift 入门之helloWorld
    Thrift入门之mac下的安装流程
    netty的解码器与粘包和拆包
    java反射(一)
    使用Spring报错:No default constructor found;
    jpa关联映射(一)
  • 原文地址:https://www.cnblogs.com/zfox2017/p/6704285.html
Copyright © 2011-2022 走看看