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

     
    单机环境全备
     
    export ORACLE_BASE=/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
    export ORACLE_SID=hncdfpos001
    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
    export PATH=$ORACLE_HOME/bin:$PATH
    rman target / log /backup/hncdfpos001/rman_full.log append<<EOF
    run
    {allocate channel c1 type disk;
    allocate channel c2 type disk;
    backup database filesperset 4 format '/backup/hncdfpos001/full_%d_%T_%s_%p';
    sql 'alter system archive log current';
    backup archivelog all format '/backup/hncdfpos001/arch_%d_%T_%s_%p' delete input;
    backup current controlfile format '/backup/hncdfpos001/ctl_%d_%T_%s_%p';
    crosscheck backup;
    crosscheck archivelog all;
    delete noprompt obsolete;
    delete noprompt  expired backup;
    delete noprompt  expired archivelog all;
    }
    EOF
     
     
    单机环境备归档
     
    export ORACLE_BASE=/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
    export ORACLE_SID=hncdfpos001
    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
    export PATH=$ORACLE_HOME/bin:$PATH
    rman target / log /backup/hncdfpos001/rman_arch.log append<<EOF
    run
    {allocate channel c1 type disk;
    allocate channel c2 type disk;
    sql 'alter system archive log current';
    backup archivelog all format '/backup/hncdfpos001/arch_%d_%T_%s_%p' delete input;
    backup current controlfile format '/backup/hncdfpos001/ctl_%d_%T_%s_%p';
    crosscheck backup;
    crosscheck archivelog all;
    delete noprompt  expired backup;
    delete  noprompt expired archivelog all;
    }
    EOF
     
     
     
    RAC环境全备
     
    run {
    allocate channel c1 device type disk connect 'sys/Oracle11@rac101';
    allocate channel c2 device type disk connect 'sys/Oracle11@rac102';
    backup database database format '/backup/rmanbak/db_full_%T_%d_%t_%s_%p_bak0';
    sql 'alter system archive log current';
    backup archivelog all format '/backup/rmanbak/arch_%T_%d_%t_%s_%p_bak0' delete input;
    backup current controlfile format '/backup/rmanbak/controlfile_%T_%d_%t_%s_%p_bak0';
    backup spfile format '/backup/rmanbak/spfile_%T_%d_%t_%s_%p_bak0';
    crosscheck backup;
    crosscheck archivelog all;
    delete noprompt obsolete;
    delete noprompt expired backup;
    delete noprompt expired archivelog all;
    release channel c1;
    release channel c2;
    }
     
     
  • 相关阅读:
    Poj 1742 Coins(多重背包)
    Poj 2350 Above Average(精度控制)
    求二进制数中1的个数
    Poj 1659 Distance on Chessboard(国际象棋的走子规则)
    Poj 2411 Mondriaan's Dream(压缩矩阵DP)
    Poj 2136 Vertical Histogram(打印垂直直方图)
    Poj 1401 Factorial(计算N!尾数0的个数——质因数分解)
    poj 2390 Bank Interest(计算本利和)
    Poj 2533 Longest Ordered Subsequence(LIS)
    Poj 1887 Testing the CATCHER(LIS)
  • 原文地址:https://www.cnblogs.com/l10n/p/9410649.html
Copyright © 2011-2022 走看看