利用批处理文件可以方便客户导入或导出数据,便于维护。
@echo off&setlocal enabledelayedexpansion
color 0a
:start
set username=test
set password=1
set database=orcl
set /p choice=1.备份 2.导入 3.按任意键退出:
if %choice%==1 goto exp
if %choice%==2 goto imp
:exp
set /p file=请输入备件数据库的文件名:
set /p path=请输入存放的路径(记得输冒号:):
EXP.EXE %username%/%password% file=%path%\%file% full=y
set /p choice=1.继续 2.按任意键退出:
if %choice%==1 goto start
:imp
set /p file=请将要导入的数据库文件拖入窗体内:
IMP.EXE %username%/%password%@%database% file=%file% fromuser=test touser=test ignore=y
set /p choice=1.继续 2.按任意键退出:
if %choice%==1 goto start