Oracle备份恢复

2020-04-21  本文已影响0人  MaJiT

1.备份数据库 backup.bat

@ECHO OFF
set user=root
set password=123456
set sid=ORCL
set logfile=./backup_20180912.log
set backupfile=C:\temp\TEST_20180912.dmp
exp %user%/%password%@%sid% file=%backupfile% log=%logfile% STATISTICS=NONE owner=(%user%)
pause

2.恢复数据库 restore.bat

@ECHO OFF
set user=root
set password=123456
set sid=ORCL
set logfile=./restore_20180912.log
set backupfile=C:/temp/TEST_20180912.dmp
imp %user%/%password%@%sid% file=%backupfile% log=%logfile% ignore=y full=y;
pause

赋值到txt文件里,文件后缀改成bat双击执行命令

上一篇下一篇

猜你喜欢

热点阅读