午夜国产狂喷潮在线观看|国产AⅤ精品一区二区久久|中文字幕AV中文字幕|国产看片高清在线

    Oracle數(shù)據(jù)庫自動備份的實現(xiàn)歷程
    來源:易賢網(wǎng) 閱讀:1185 次 日期:2014-09-17 14:36:40
    溫馨提示:易賢網(wǎng)小編為您整理了“Oracle數(shù)據(jù)庫自動備份的實現(xiàn)歷程”,方便廣大網(wǎng)友查閱!

    問題描述:

    Oracle自動備份腳本的實現(xiàn)。

    錯誤提示1:

    Message file RMAN.msb not found

    Verify that Oracle_HOME is set properly

    。。。。。。

    錯誤原因:

    自動執(zhí)行的不能夠識別相應(yīng)的命令,需要在自動備份腳本中顯式的聲明Oracle的環(huán)境變量。

    錯誤提示2:

    standard in must be a tty

    。。。。。。

    錯誤原因:

    不能在cron使用su或者管道等操作,必須將su命令移動到相關(guān)的shell腳本中。

    錯誤提示3:

    Argument Value Description

    -----------------------------------------------------------------------------

    target  quoted-string connect-string for target database

    catalog quoted-string connect-string for recovery catalog

    nocatalognone  if specified, then no recovery catalog

    cmdfile quoted-string name of input command file

    log quoted-string name of output message log file

    tracequoted-string name of output debugging message log file

    append  none  if specified, log is opened in append mode

    debugoptional-args activate debugging

    msgnonone  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 integernumber 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腳本調(diào)用的cmdfile是在同一個目錄下就可以直接使用文件名或者直接使用./

    正確示例代碼:

    1、#cron文件

    0 12,18 * * * /home/Oracle/bak_sh/backup_ar.sh

    #表示每天12,18點對數(shù)據(jù)庫歸檔日至進行全備份

    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的環(huán)境。

    2、我們做的cron測試:

    實例:

    Vi /etc/cron.minly/new.sh

    內(nèi)容:

    Su – Oracle –c “/home/Oracle/mginfo.sh”

    Vi /home/Oracle/mginfo.sh

    內(nèi)容:

    Exp mginfotech/mginfotech file=mginfotech.dmp log=mginfotech.log

    Vi /etc/crontab

    內(nèi)容:

    59 23 * * * root run-parts /etc/cron.minly

    每晚23:59分鐘執(zhí)行

    cron中無法讀取環(huán)境變量

    在shell中顯示地export環(huán)境變量

    export Oracle_HOME=/opt/ora9/product/9.2

    export Oracle_SID=Oracle

    export NLS_LANG=xxxxx

    然后再試

    更多信息請查看IT技術(shù)專欄

    更多信息請查看數(shù)據(jù)庫
    易賢網(wǎng)手機網(wǎng)站地址:Oracle數(shù)據(jù)庫自動備份的實現(xiàn)歷程
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

    2025國考·省考課程試聽報名

    • 報班類型
    • 姓名
    • 手機號
    • 驗證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報警專用圖標(biāo)