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双击执行命令
网友评论