Home > Database > Mysql Tutorial > body text

oracle数据库自动备份

WBOY
Release: 2016-06-07 16:21:25
Original
1100 people have browsed it

Windows下实现Oracle通过EXP每天晚上备份,并保留十天的备份数据。 1、建立备份脚本oraclebackup.bat 首先建立一个备份bat文件,在E盘下新建备份目录oraclebackup、dmp、log,将oracle安装目录下的EXP.EXE复制到此目录下,再新建一个文本文件oraclebackup.tx

   Windows下实现Oracle通过EXP每天晚上备份,并保留十天的备份数据。

  1、建立备份脚本oraclebackup.bat

  首先建立一个备份bat文件,在E盘下新建备份目录oraclebackup、dmp、log,将oracle安装目录下的EXP.EXE复制到此目录下,再新建一个文本文件oraclebackup.txt,内容如下:

  @echo off

  echo 删除10天前的备分文件和日志

  forfiles /p "E:oraclebackup" /dmp/OA *.dmp /d -10 /c "cmd /c del @path"

  forfiles /p "E:oraclebackup" /dmp/OA *.log /d -10 /c "cmd /c del @path"

  echo 正在备份 Oracle 数据库,请稍等……

  exp user/password@orcl file=E:/oraclebackup/dmp/OA_%date:~0,4%%date:~5,2%%date:~8,2%.dmp log=E:/oraclebackup/log/OA_%date:~0,4%%date:~5,2%%date:~8,2%.log owner=(jasoa_doc)

  echo 任务完成!

  完成后,将该记事本的后缀txt改成bat即可。

  双击oraclebackup.bat可以测试是否可以正常备份。

  2、新建计划任务

  进入windows的控制面板,,打开计划与任务,新建任务,点击浏览,选择刚才新建的E盘oraclebackup目录下的oraclebackup.bat文件。设置自动执行时间保存即可;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template