Home  >  Q&A  >  body text

java实现备份和还原oracle数据库?

由于工作需要,需要实现使用java程序控制备份整个oracle数据库(一个schme)以及将此备份restore。

在网上看到很多人的实现方式是:imp/exp;我想:exp确实能够将数据库对象全部以dmp文件的方式备份下来。但是‘恢复’时却需要将数据库所有对象全部删除。自己理解这种方式不好:

  1. imp/exp本质上不是备份和恢复工具,而是一种导入导出工具,虽然它能完成功能,但是这不是他的本质工作。

  2. 当imp的时候需要删除所有对象,当数据库对象很多的时候操作很不方便。之前想过使用drop user cascade ,但是这样操作之后还需要重新创建用户并且进行赋权等操作,仍然不方便。

    有经验的通知能否给提供一个比较正确的思路?感激不尽!

PHP中文网PHP中文网2715 days ago533

reply all(2)I'll reply

  • 阿神

    阿神2017-04-17 13:53:42

    I have implemented an operation and maintenance system before, using Java to dynamically generate shell scripts based on backup and recovery strategies. You can refer to the following

    reply
    0
  • PHPz

    PHPz2017-04-17 13:53:42

    Oracle backup and recovery, the formal method is to use rman, which has nothing to do with java. At most, java calls the shell script of the operating system, and then executes the relevant commands of rman.

    reply
    0
  • Cancelreply