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

    归档备份

    source ~/.bash_profile
    export ORACLE_SID=XXXXXX
    rman target / catalog xxxx/xxxx@XXX.XXX.XXX.XXX:1521/rcat <<eof
    run{ allocate channel c1 device type disk format
    '/backup/arch_%d_%T_%s_%p.bak'; allocate channel c2 device type disk format '/backup/arch_%d_%T_%s_%p.bak'; sql 'alter system archive log current'; backup as compressed backupset archivelog all delete input; } exit; eof

    全备

    source ~/.bash_profile
    export ORACLE_SID=XXXXXX
    rman target / catalog xxxx/xxxx@xxx.xxx.xxx.xxx:1521/rcat <<eof
    run{ allocate channel c1 device type disk format
    '/backup/full_%d_%T_%s_%p.bak'; allocate channel c2 device type disk format '/backup/full_%d_%T_%s_%p.bak'; allocate channel c3 device type disk format '/backup/full_%d_%T_%s_%p.bak'; sql 'alter system archive log current'; backup as compressed backupset database plus archivelog; backup current controlfile; backup spfile; crosscheck backup; delete noprompt obsolete; delete noprompt expired backup; } exit; eof

    delete obsolete删除恢复数据库不需要的备份集,这个是根据保留策略的(configure retention policy to redundancy 1)

    delete expired删除使用os命令删除的备份集信息

  • 相关阅读:
    Generate Parentheses
    Length of Last Word
    Maximum Subarray
    Count and Say
    二分搜索算法
    Search Insert Position
    Implement strStr()
    Remove Element
    Remove Duplicates from Sorted Array
    Remove Nth Node From End of List
  • 原文地址:https://www.cnblogs.com/monkey6/p/11765779.html
Copyright © 2011-2022 走看看