oracle自动备份并打包成压缩文件的脚步------绝对非常实用,window中添加定时任务就可自动备份了

转载:https://blog.csdn.net/wenzhihui_2010/article/details/12099029

@echo 开始备份…. 

@echo 本程序使用zip压缩,备份后的文件可使用rar或者zip解压。 
set instanse=orcl
set username=user
set password=password
set extname=rar
set year=%date:~0,4%
set month=%date:~5,2%
set day=%date:~8,2%
set mydate=%year%-%month%-%day%
set spath=e:\backup\
mkdir "%spath%"
 
set filename=e:\backup\%username%%mydate%

@echo %filename% 

exp %username%/%password%@%instanse% file=%filename%.dmp owner=%username% log=%filename%.log 

C:\WinRAR\rar.exe a %filename%.%extname% %filename%.dmp %filename%.log 

del %filename%.dmp 
del %filename%.log

@echo 备份完毕! 

@echo 备份文件为:%filename%.%extname% 

@echo 执行sql…. 
@echo off

echo OK! 


把上面脚步写在批处理文件(bak_oracle.bat)文件中,就搞定了

猜你喜欢

转载自blog.csdn.net/yingwang9/article/details/80823596