@ echo off &title ORACLE导入导出 NUCHINA
color 0a
:choice0
echo --------------------------------------------------------------------------------
echo.
echo 请 选 择 操 作 步 骤
echo.
echo 1.导出数据库
echo 2.导入数据库
echo 0.退出
echo.
echo --------------------------------------------------------------------------------
@set choice=
@set /p choice= 请选择:
@if /i "%choice%"=="1" goto exp
@if /i "%choice%"=="2" goto imp
@if /i "%choice%"=="0" goto exit
:exp
echo.
set /p username=用户名:
set /p password=密码:
Set SqlDir=C:/
Set /p db=SID:
Set /p isrows=是否导出数据(Y/N):
Set dt=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%
exp %username%/%password%@%db% owner=(%username%) rows=%isrows% file=%SqlDir%/%username%-%dt%.dmp
echo 导出 : 成功,文件路径:%SqlDir%/%username%-%dt%.dmp
pause
exit
:imp
echo.
set /p username=用户名:
set /p password=密码:
Set /p db=SID:
Set /p SqlDir=选择导入的文件:
imp %username%/%password%@%db% file=%SqlDir% ignore=y FULL=Y
echo 导入 : 成功
pause
exit
:exit
exit