oracle表结构表数据导入导出

--------------------------------------imp/exp---------------------------------------------------------------------------

//导入表数据以及表结构
  imp 用户名/密码@数据库名称 fromuser(文件的指定用户,即从那个用户导入数据)=用户名 
touser(目标用户,即导入到当前登录的那个用户)=用户名 
  file=要导入的dmp文件位置 ignore=y(忽略错误创建)

//example:
  imp AML/[email protected]:1521/orcl fromuser=URSPMONITOR touser=AML 
  FILE=/data/aml.dmp full=y ignore=y;

//导出表数据以及表结构
  exp 用户名/密码@数据库名字 owner=用户名 file=dmp文件存储位置(即导出文件为.dmp文件)

  

示例,生产数据导入到本地测试库:

create table aml_rule_autoslay_0705 as select * from aml.aml_rule_autoslay;


exp urspmonitor/[email protected]:1521/dwursp file=aml_rule_autoslay.dump tables=aml_rule_autoslay_0705


drop table aml_rule_autoslay_0705;


imp aml/[email protected]:1521/pisa  fromuser=URDPMONITOR touser=aml file=/jgtest/aml_rule_autoslay.dump 

imp aml/[email protected]:1521/pisa  file=/jgtest/aml_rule_autoslay.dump 

  

  

1、运到问题?

在导入数据时出现无法找到目标用户进行赋值错误,需要使用fromuser=URSPMONITOR  touser=AML,即忽略用户授权错误;

2、或者使用工具在导入数据面板取消勾选,行数,授权。若出现唯一约束错误,取消“约束”勾选;

猜你喜欢

转载自www.cnblogs.com/Alexr/p/9362132.html
今日推荐