语句:exp SDE/SDE@IP:1521/orcl FILE=C:数据库备份sde%date:~0,4%%date:~5,2%%date:~8,2%.dmp COMPRESS=y direct=y log=C:数据库备份logsde%date:~0,4%%date:~5,2%%date:~8,2%.log
在这里主要要保证C盘下有数据库备份和数据库备份下有log文件加 才能保证导出成功
如果想定期备份数据库 就需要将上述命令放在在bat文件中,并且通过windows任务计划的方式定期备份数据库
bat文件内容:IP为你数据库安装的IP地址
@echo off
exp DJXT/DJXT@IP:1521/orcl FILE=C:数据库备份djxt%date:~0,4%%date:~5,2%%date:~8,2%.dmp COMPRESS=y direct=y log=C:数据库备份logdjxt%date:~0,4%%date:~5,2%%date:~8,2%.log
exp SDE/SDE@IP:1521/orcl FILE=C:数据库备份sde%date:~0,4%%date:~5,2%%date:~8,2%.dmp COMPRESS=y direct=y log=C:数据库备份logsde%date:~0,4%%date:~5,2%%date:~8,2%.log
forfiles /p "C:数据库备份" /s /m *.* /d -30 /c "cmd /c del @path"
forfiles /p "C:数据库备份log" /s /m *.* /d -30 /c "cmd /c del @path"
exit