【EXP】Oracle多表导出问题

来源:互联网 发布:非农数据的影响 编辑:程序博客网 时间:2024/05/17 05:19

有些时候,需要导入某个用户的一些相关表。但是不知道用户的用户名和密码。这样就很尴尬

但是如果手上有dba权限的用户的话,就很方便的能导出了


先要知道多表导出的语句

exp system/123456 file=test.dmp tables=table1,table2,table3 log=test.log

或者

exp system/123456 file=test.dmp tables="(table1,table2,table3)" log=test.log

这句如果不加上双引号,那么就会提示括号有问题


下面来介绍如何用dba权限用户导出其他用户的表

只要在需要导出的表前面加上想要导出的用户名就可以了

例如:将test用户下的table1,table2,table3导出

exp system/123456 file=test.dmp tables=test.table1,test.table2,test.table3 log=test.log

或者

exp system/123456 file=test.dmp tables="(test.table1,test.table2,test.table3)" log=test.log


exp hr/hr@192.168.1.222:1521/exam file=d:backup.dmp


但是如果是指定的一个用户下的全部的表的话,需要一个owner就可以解决问题

例如:导出test下的所有表

exp system/123456 file=test.dmp owner=test log=test.log

这里一定要注意,如果使用了tables就不能用owner,如果用了owner就不能用tables

否则回报错:

Export: Release 10.2.0.1.0 - Production on Wed Nov 15 10:06:46 2017


Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
EXP-00026: conflicting modes specified
EXP-00000: Export terminated unsuccessfully


这个问题让你摸不到头绪,原因就在于用了tables和owner同时存在了




原创粉丝点击