<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    szhswl
    宋針還的個人空間

     問題描述:
    oracle自動備份腳本的實現。

    錯誤提示1:
    Message file RMAN<lang>.msb not found
     
    Verify that ORACLE_HOME is set properly
     
    。。。。。。

    錯誤原因:
    自動執行的不能夠識別相應的命令,需要在自動備份腳本中顯式的聲明oracle的環境變量。

    錯誤提示2:
    standard in must be a tty
     
    。。。。。。

    錯誤原因:
    不能在cron使用su或者管道等操作,必須將su命令移動到相關的shell腳本中。

    錯誤提示3:
    Argument     Value          Description
    -----------------------------------------------------------------------------
    target       quoted-string  connect-string for target database
    catalog      quoted-string  connect-string for recovery catalog
    nocatalog    none           if specified, then no recovery catalog
    cmdfile      quoted-string  name of input command file
    log          quoted-string  name of output message log file
    trace        quoted-string  name of output debugging message log file
    append       none           if specified, log is opened in append mode
    debug        optional-args  activate debugging
    msgno        none           show RMAN-nnnn prefix for all messages
    send         quoted-string  send a command to the media manager
    pipe         string         building block for pipe names
    timeout      integer        number of seconds to wait for pipe input
    checksyntax  none           check the command file for syntax errors
    -----------------------------------------------------------------------------
    Both single and double quotes (' or ") are accepted for a quoted-string.
    Quotes are not required unless the string contains embedded white-space.
     
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-00556: could not open CMDFILE "backup_ar.rcv"
     
    。。。。。。


    錯誤原因:
    需要在cmdfile中指明絕對路徑,不能因為shell腳本調用的cmdfile是在同一個目錄下就可以直接使用文件名

    或者直接使用./

    正確示例代碼:

    1、#cron文件
    0 12,18 * * * /home/oracle/bak_sh/backup_ar.sh
    #表示每天12,18點對數據庫歸檔日至進行全備份

    2、入口shell文件,文件名:backup_ar.sh
    export ORACLE_HOME=/home/u01/app/oracle/oracle/product/10.2.0/db_1
    export ORACLE_SID=test
    export LANG=en_US.UTF-8
    /home/u01/app/oracle/oracle/product/10.2.0/db_1/bin/rman cmdfile = backup_ar.rcv

    3、rman備份腳本
    connect target /
    connect catalog rman/rman@rman
    run{
    allocate channel d1 device type disk;
    sql 'alter system archive log current';
    backup archivelog all delete input
      format '/opt/rmanback/full_%u_%p_%c.ac' filesperset = 3;
    release channel d1;
    }

    學習入口(來自論壇):
    1、兩種辦法
    一是用root的crontab,*/2 * * * * a.sh --》su - oracle -c a.sh
    一是在a.sh里加上oracle的環境。


    2、我們做的cron測試:
    實例:
    Vi /etc/cron.minly/new.sh
    內容:
    Su – oracle –c “/home/oracle/mginfo.sh”

    Vi /home/oracle/mginfo.sh
    內容:
    Exp mginfotech/mginfotech file=mginfotech.dmp log=mginfotech.log

    Vi /etc/crontab
    內容:
    59 23 * * * root run-parts /etc/cron.minly
    每晚23:59分鐘執行


    cron中無法讀取環境變量
    在shell中顯示地export環境變量
    export ORACLE_HOME=/opt/ora9/product/9.2
    export ORACLE_SID=oracle
    export NLS_LANG=xxxxx



    ---------------------------------------------------------------------------------------------------------------------------------
    說人之短,乃護己之短。夸己之長,乃忌人之長。皆由存心不厚,識量太狹耳。能去此弊,可以進德,可以遠怨。
    http://www.tkk7.com/szhswl
    ------------------------------------------------------------------------------------------------------ ----------------- ---------
    posted on 2007-12-06 19:57 宋針還 閱讀(859) 評論(0)  編輯  收藏 所屬分類: ORACLE
    主站蜘蛛池模板: 亚洲中文字幕无码久久综合网| 日韩av无码久久精品免费| 日韩精品成人无码专区免费| 亚洲精品日韩中文字幕久久久| 亚洲日本在线免费观看| 亚洲一区二区成人| 1a级毛片免费观看| 亚洲国产精品综合福利专区| 免费精品人在线二线三线区别| 国产成人精品日本亚洲直接| 免费看少妇作爱视频| 最新亚洲人成无码网www电影| 免费一级肉体全黄毛片| 美女被免费网站视频在线| 亚洲一级片内射网站在线观看| 人碰人碰人成人免费视频| 亚洲精品成人无码中文毛片不卡| 免费国产99久久久香蕉| 亚洲精彩视频在线观看| 最近中文字幕mv免费高清电影| 亚洲国产成人久久精品软件| 亚洲Av无码国产情品久久| 美女网站在线观看视频免费的| 久久精品国产96精品亚洲| 在线观看www日本免费网站| 亚洲中文字幕一二三四区| 免费欧洲美女牲交视频| 免费h视频在线观看| 亚洲日韩av无码中文| 亚洲午夜AV无码专区在线播放 | 色片在线免费观看| 久久乐国产综合亚洲精品| 亚洲一区二区三区无码影院| 亚洲精品免费在线观看| 亚洲精品无播放器在线播放| 久99精品视频在线观看婷亚洲片国产一区一级在线| 在线观看免费视频网站色| 亚洲中文字幕久久精品无码VA| 亚洲性在线看高清h片| 国产精品成人观看视频免费| 羞羞漫画页面免费入口欢迎你|