以下为ORACLE 自动备份批处理文件内容,请配合任务计划实现
@ECHO OFF
SET BACKPATH=d:\
SET BACKPATH=d:\
ECHO 准备备份数据库
REM 7天一个循环
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
:ONE
SET BACKPATH_FULL=%BACKPATH%\ONE
REN %BACKPATH%\ONE TWO
GOTO BACK
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
SET BACKPATH_FULL=%BACKPATH%\TWO
REN %BACKPATH%\TWO THREE
GOTO BACK
:THREE
SET BACKPATH_FULL=%BACKPATH%\THREE
REN %BACKPATH%\THREE FOUR
GOTO BACK
SET BACKPATH_FULL=%BACKPATH%\THREE
REN %BACKPATH%\THREE FOUR
GOTO BACK
:FOUR
SET BACKPATH_FULL=%BACKPATH%\FOUR
REN %BACKPATH%\FOUR FIVE
GOTO BACK
SET BACKPATH_FULL=%BACKPATH%\FOUR
REN %BACKPATH%\FOUR FIVE
GOTO BACK
:FIVE
SET BACKPATH_FULL=%BACKPATH%\FIVE
REN %BACKPATH%\FIVE SIX
GOTO BACK
SET BACKPATH_FULL=%BACKPATH%\FIVE
REN %BACKPATH%\FIVE SIX
GOTO BACK
:SIX
SET BACKPATH_FULL=%BACKPATH%\SIX
REN %BACKPATH%\SIX SEVEN
GOTO BACK
SET BACKPATH_FULL=%BACKPATH%\SIX
REN %BACKPATH%\SIX SEVEN
GOTO BACK
:SEVEN
SET BACKPATH_FULL=%BACKPATH%\SEVEN
REN %BACKPATH%\SEVEN ONE
GOTO BACK
SET BACKPATH_FULL=%BACKPATH%\SEVEN
REN %BACKPATH%\SEVEN ONE
GOTO BACK
:BACK
EXP TESTUSER/TEST FILE=%BACKPATH_FULL%.DMP
EXP TESTUSER/TEST FILE=%BACKPATH_FULL%.DMP
SET BACKPATH=
SET BACKPATH_FULL=
SET BACKPATH_FULL=
EXIT
©著作权归作者所有:来自51CTO博客作者老三的原创作品,如需转载,请注明出处,否则将追究法律责任
0
收藏
推荐专栏更多
猜你喜欢
我的友情链接
Java咖啡馆(9)——一个压缩归档实用软件
大数据采集、清洗、处理:使用MapReduce进行离线数据分析完整案例
oracle表分区详解
JQuery ajax返回JSON时的处理方式
Java异常处理总结
三大文本处理工具grep、sed及awk的简单介绍
Redis 通配符查找及批量删除key
日志处理两大生态Splunk和ELK深度对比
Oracle用户、权限、角色管理
Oracle的AWR报告分析
ORACLE EXP/IMP的使用详解
记一次修改sga大小之后出现的一系列报错
面对oracle ocfs2文件丢失,你能想到解决办法有哪些?
Oracle RAC集群测试-生产环境最佳方法(Oracle 11g/12c/18c/19 RAC)
Oracle 12C 利用Rman Duplicate搭建 Data Guard
ORACLE数据库EXPDP/IMPDP常用参数
完全Oracle安装建库手册
RHEL 6.8 + Oracle 11g RAC multipath 配置
12C环境下分库分表改造查询优化
扫一扫,领取大礼包
转载于:https://blog.51cto.com/sam2080/17695
Ctrl+Enter 发布
发布
取消