oracle異地備份


一、安裝oracle客戶端


右鍵以管理員身份運行

 

選擇管理員


跳過軟件更新


選擇語言,默認中文


指定安裝位置


檢查當前環境


安裝

 

二、使用exp命令備份

exp 用戶名/密碼@IP地址/數據庫 owner=所有者 file=%filename%.dmp log=%filename%.log
 
三、新建批處理文件
@echo off
set logfile=.\oraback.log      (指定備份日志文件名)
set filename=.\%date:~0,4%%date:~5,2%%date:~8,2%    (指定備份文件名,以當前日期命名)
set nowdate=%date:~0,4%%date:~5,2%%date:~8,2%       (獲取當前日期)
echo the BK is begining,Pls Waiting.... >>%logfile%         (echo內容到日志文件)
echo The Time is %nowdate%---%time% now! >> %logfile%       (把當前時間輸入到日志文件)
exp 用戶名/密碼@IP地址/數據庫  owner=所有者  file=%filename%.dmp log=%filename%.log     (執行備份命令)
echo The Oracle Backup has completed.Bye! >>%logfile%         (echo內容到日志文件)
echo the Completed time is %nowdate%---%time% >>%logfile%     (把當前時間輸入到日志文件)
echo line of demarcation*******************************>>%logfile%      (echo內容到日志文件)
echo ***>>%logfile%    (echo內容到日志文件)
echo ***>>%logfile%    (echo內容到日志文件)
forfiles /p "." /s /m *.dmp /d -15 /c "cmd /c del @path"       (刪除15天前,后綴名為dmp的文件)
forfiles /p "." /s /m *.log /d -15 /c "cmd /c del @path"       (刪除15天前,后綴名為log的文件)

三、添加批處理文件到任務計划


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM