以下为ORACLE 自动备份批处理文件内容,请配合任务计划实现
 
@ECHO OFF
SET BACKPATH=d:\
ECHO 准备备份数据库
REM 7天一个循环
IF EXIST %BACKPATH%\ONE GOTO ONE
IF EXIST %BACKPATH%\TWO GOTO TWO
IF EXIST %BACKPATH%\THREE GOTO THREE
IF EXIST %BACKPATH%\FOUR GOTO FOUR
IF EXIST %BACKPATH%\FIVE GOTO FIVE
IF EXIST %BACKPATH%\SIX GOTO SIX
IF EXIST %BACKPATH%\SEVEN GOTO SEVEN
ECHO E > %BACKPATH%\ONE

:ONE
SET BACKPATH_FULL=%BACKPATH%\ONE
REN %BACKPATH%\ONE TWO
GOTO BACK
:TWO
SET BACKPATH_FULL=%BACKPATH%\TWO
REN %BACKPATH%\TWO THREE
GOTO BACK
:THREE
SET BACKPATH_FULL=%BACKPATH%\THREE
REN %BACKPATH%\THREE  FOUR
GOTO BACK
:FOUR
SET BACKPATH_FULL=%BACKPATH%\FOUR
REN %BACKPATH%\FOUR FIVE
GOTO BACK
:FIVE
SET BACKPATH_FULL=%BACKPATH%\FIVE
REN %BACKPATH%\FIVE SIX
GOTO BACK
:SIX
SET BACKPATH_FULL=%BACKPATH%\SIX
REN %BACKPATH%\SIX SEVEN
GOTO BACK
:SEVEN
SET BACKPATH_FULL=%BACKPATH%\SEVEN
REN %BACKPATH%\SEVEN ONE
GOTO BACK
:BACK
EXP TESTUSER/TEST FILE=%BACKPATH_FULL%.DMP
SET BACKPATH=
SET BACKPATH_FULL=
EXIT

 

0

收藏

老三

29篇文章,18W+人气,0粉丝

Ctrl+Enter 发布

发布

取消

f92360e227f9d91cdff7ea95120630ef.png
left-qr.jpg

扫一扫,领取大礼包

0

1
分享
qr-url?url=https%3A%2F%2Fblog.51cto.com%2Fsam2080%2F17695
老三
noavatar_middle.gif