bat 脚本备份oracle数据库dmp文件(案例)

 

bat 脚本常用命令介绍:http://ysj5125094.iteye.com/blog/2348997

 

@echo off
rem 导出ctTableProfix相关表
rem 导入命令:imp iem/iem@blueDev file=D:/bak/ctTableProfix.dmp log=D:/bak/imp.log full=y
set v_dump_dir=D:\bak\
set v_dump_bak=%v_dump_dir%ctTableProfix.dmp
set v_dump_bak_log=%v_dump_dir%exp.log
set v_oracle_bin=D:\app\client\shaojian.yu\product\12.1.0\client_1\BIN
set v_userName=root
set v_password=root
set v_serviceName=dev
set v_tables=(aTable, bTable, cTable, dTable)

rem 判断文件是否存在
if exist %v_dump_bak_log% (
  rem log文件已存在
  echo log file exist... ... 
) else (
   rem log文件不存在, 自动创建
  echo log file not exist... ...
  echo=>%v_dump_bak_log%
)
cd %v_oracle_bin%
rem 执行导出命令
echo execute exp... ...
exp %v_userName%/%v_password%@%v_serviceName% file=%v_dump_bak% log=%v_dump_bak_log% tables=%v_tables%
cd %v_dump_dir%
rem 导出完成
echo done... ... 

 

 

 

 

你可能感兴趣的:(bat,bat,oracle)