日期:2014-05-16  浏览次数:20487 次

oracle的导出并自动压缩为rar文件

rem DOS get current time yyyy-mm-dd hhmiss week
rem =======================
rem get yyyy/mm/dd
set mydate=%DATE:~0,10%
echo %mydate%
rem =======================
rem get yyyy
set yyyy=%DATE:~0,4%
echo %yyyy%
rem =======================
rem get mm
set mm=%DATE:~5,2%
echo %mm%
rem =======================
rem get dd
set dd=%DATE:~8,2%
echo %dd%

rem =======================
rem get week ,display CN
set week=%DATE:~11,2%
echo %week%

rem =======================
rem get hour
set hh=%TIME:~0,2%
echo %hh%

rem =======================
rem get min
set mi=%TIME:~3,2%
echo %mi%

rem =======================
rem get ss
set ss=%TIME:~6,2%
echo %ss%

rem =======================
rem get yyyy-mm-dd
set curdate=%yyyy%-%mm%-%dd%_%hh%%mi%%ss%(%week%)
echo %curdate%

exp dev/dev@orcl file='D:/数据库备份/dev_%curdate%.dmp'

rem "C:\Program Files\WinRAR\WinRAR.exe" a -V4k -V4k D:/数据库备份/dev_%curdate%.rar  D:/数据库备份/dev_%curdate%.dmp

rem 后台模式压缩 并设置解压密码
cd D:/数据库备份
"C:\Program Files\WinRAR\WinRAR.exe" a -ibck -p123456 dev_%curdate%.rar dev_%curdate%.dmp

rem ftp -s:ftp.ini

del dev_%curdate%.dmp