Oracle自动备份脚本 [ Windows]

255次阅读
没有评论
@ECHO OFF
set ora_path=G:\oracle\product\10.2.0\db_1\BIN
set ORACLE_SID=orcl
set bakfile_path=G:\backup\oradmp

del G:\backup\myfile.txt
del G:\backup\myfile1.txt
date /t >>G:\backup\myfile.txt
time /t >>G:\backup\myfile1.txt
for /F "eol=; tokens=1 delims=/ " %%i in (G:\backup\myfile.txt) do set outp1=%%i
for /F "eol=; tokens=2 delims=/ " %%i in (G:\backup\myfile.txt) do set outp2=%%i
for /F "eol=; tokens=3 delims=/ " %%i in (G:\backup\myfile.txt) do set outp3=%%i
for /F "eol=; tokens=1 delims=: " %%i in (G:\backup\myfile1.txt) do set outp4=%%i
for /F "eol=; tokens=2 delims=: " %%i in (G:\backup\myfile1.txt) do set outp5=%%i
set outp6=20_full_%outp1%-%outp2%-%outp3%_%outp4%_%outp5%
set DaysAgo=2
forfiles /p %bakfile_path% /s /m *.dmp /d -%DaysAgo% /c "cmd /c del @path" 
forfiles /p %bakfile_path% /s /m *.log /d -%DaysAgo% /c "cmd /c del @path" 


%ora_path%\expdp.exe system/****** directory=expdp_dir2 dumpfile=%outp6%_%%U.dmp filesize=8192M logfile=%outp6%.log parallel=1 full=y
copy %bakfile_path%\%outp6%.log G:\backup\log

 

Honest1y
版权声明:本站原创文章,由Honest1y2018-06-26发表,共计916字。
转载提示:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
载入中...