Linux平台下Oracle定時備份資料

2022-07-29 10:57:10 字數 1030 閱讀 9512

臨時收到乙個任務,就是在生產環境上定時備份oracle的資料。空閒時間搞了一下,真是一波三折,過程有點小鬱悶,結果哈哈。現在進行總結一下

(1)新建乙個shell指令碼test.sh

#!/bin/bash

currenttime=`date +%y%m%d`

(2)chmod 744 test.sh

(3)使用linux的crontab命令定時備份

可以使用 crontab -l 檢視當前使用者定時的任務

(4)錯誤資訊排查並解決:

後面發現定時任務不執行,一開始以為指令碼寫錯了,不過在linux下直接使用./test.sh發現正常執行。

於是,檢視了cron日誌,vim /var/log/cron發現報錯了:(admin) mail (mailed 77 bytes of output but got status 0x004b#012)

更改了執行的指令碼test.sh,將錯誤資訊輸入到檔案中,如下:

#!/bin/bash

currenttime=`date +%y%m%d`

執行後檢視錯誤檔案,發現報錯資訊:message 206 not found; no message file for product=rdbms, facility=exp: release 11.2.0.1.0

#!/bin/bash

export oracle_sid=bpmtest 

currenttime=`date +%y%m%d`

後來又要定時刪除備份的資料,伺服器只保留最近7天的資料備份。發現在shell中linux命令不執行,後來查了一下,需要匯入path環境變數,且執行命令需要寫全路徑。**如下:

#!/bin/bash

export oracle_sid=bpmprd

currenttime=`date +%y%m%d`

~

Linux平台下解除安裝ORACLE

實驗環境 作業系統版本 red hat enterprise linux server release 5.5 tikanga 資料庫版本 oracle database 10g enterprise edition release 10.2.0.1.0。解除安裝oracle 10g的過程,在不同平...

linux 平台下安裝oracle 10g

1.測試系統 rhel 5.4 oracle 10g r 2 系統中有c,c 的編譯環境,要安裝以下rpm rpm ivh kernel headers 2.6.18 164.el5.i386.rpm rpm ivh compat glibc headers 2.3.4 2.26.i386.rpm ...

windows平台下Oracle自動備份指令碼

因資料安全需要,要求每天定時對oracle資料庫中的業務資料進行備份,我參照相關資料編寫了一下指令碼 echo off rem windows server2000 oracle資料庫自動備份批處理指令碼 rem 取得當前日期和時間,可能因作業系統不同而取值不同 set curdate date 0...