共计 916 个字符,预计需要花费 3 分钟才能阅读完成。
@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
正文完