在bat文件中 執行 從一個數據庫 導出數據 然后導入另一個數據庫 怎么寫??????????????

horizonlyhw 2009-04-21 01:37:31
在bat文件中 執行 從一個數據庫 導出數據 然后導入另一個數據庫 怎么寫??????????????

導出數據以后 要drop掉即將導入的數據庫的user?
...全文
102 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunnyrain 2009-04-26
  • 打赏
  • 举报
回复
导入的时候 加 fromuser和touser就好了
horizonlyhw 2009-04-24
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 fengzhou0920 的回复:]
怎么是繁体字呀,学习
[/Quote]


公司用繁體字 懶得來回的切換了 ·~
GeekZFZ 2009-04-23
  • 打赏
  • 举报
回复
怎么是繁体字呀,学习
又是违规昵称 2009-04-21
  • 打赏
  • 举报
回复
exp system/manager@db2 fromuser=scott touser=scott ignore=y file=.\scott.emp

这一行写错了,应该是导入
imp system/manager@db2 fromuser=scott touser=scott ignore=y file=.\scott.emp
horizonlyhw 2009-04-21
  • 打赏
  • 举报
回复
不drop掉user 那么原來的table什么的 在導入之后 不是會同時存在兩個??
又是违规昵称 2009-04-21
  • 打赏
  • 举报
回复
比如scott用户,从db1导入到db2

bat文件

exp scott/tiger@db1 owner=scott ignore=y file=.\scott.emp
sqlplus system/manager@db2 @dropscott.sql
exp system/manager@db2 fromuser=scott touser=scott ignore=y file=.\scott.emp

dropscott.sql文件
drop user scott cascade;
exit;

没测试过,大致这个意思
gisinfo 2009-04-21
  • 打赏
  • 举报
回复
EXP USER/PASSWORD FILE=C:\FILE.DMP
IMP USER/PASSWORD FILE=C:\FILE.DMP IGNORE=Y

就可以啊
gisinfo 2009-04-21
  • 打赏
  • 举报
回复
这很简单啊 不用 DROP 掉USER

17,088

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧