---
title: "oracle导入导出bat脚本"
author: "thomas0988"
date: "2013-01-11T10:05:05Z"
tags: []
categories: ["编程语言"]
slug: "oracle-bat"
draft: false
lastmod: "2013-01-11T10:05:05Z"
id: 1767932
url: "https://thomas0988.iteye.com/blog/1767932"
---

```
@echo off&setlocal enabledelayedexpansion
color 0a

:start
set var=D:\oracle\product\10.1.0\Db_1\BIN
set username=addranalyse
set password=jt888
set table=test

set /p choice=1.备份 2.导入 3.按任意键退出： 
if %choice%==1 goto exp 
if %choice%==2 goto imp 

:exp 
set /p file=请输入备件数据库的文件名： 
set /p path=请输入存放的路径(记得输冒号:)： 
%var%\EXP.EXE %username%/%password% file=%path%\%file% TABLES=(%table%) log=d:\a.log
set /p choice=1.继续 2.按任意键退出： 
if %choice%==1 goto start 

:imp 
set /p file=请将要导入的数据库文件拖入窗体内： 
%var%\IMP.EXE %username%/%password% file=%file% TABLES=(%table%) log=d:\a.log
set /p choice=1.继续 2.按任意键退出： 
if %choice%==1 goto start
```

 简单修改调整