oracle10g exp可否用一个用户导出另一个用户的某表呢?

SQL> conn /as sysdba
已连接。

SQL> create user user1 identified by system default tablespace users;

用户已创建。

SQL> grant resource,connect to user1;

授权成功。


SQL> alter user user1 account unlock;

用户已更改。

SQL> conn user1/system
已连接。
SQL> create table tables(a int);

表已创建。

SQL> conn /as sysdba
已连接。
SQL> create user user2 identified by system default tablespace users;

用户已创建。

SQL> grant resource,connect to user2;

授权成功。

SQL> alter user user2 account unlock;

用户已更改。


C:\Documents and Settings\Administrator>exp userid=user2/system file=c:\exp_othe
r_user_table.dmp wner=user1 tables=tables

Export: Release 10.2.0.3.0 - Production on 星期四 6月 7 09:33:02 2012

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


连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
EXP-00026: 指定了冲突模式    ----注:本义是我想用USER2用户导出user1用户的表tables,猜测owner与tables选项是冲突互斥的
EXP-00000: 导出终止失败

C:\Documents and Settings\Administrator>exp userid=system/system file=c:\exp_oth
er_user_table.dmp wner=user1 tables=tables --注:证实owner与tables选项是冲突互斥的,即便用system用户,仍旧出错

Export: Release 10.2.0.3.0 - Production on 星期四 6月 7 09:33:30 2012

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


连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
EXP-00026: 指定了冲突模式
EXP-00000: 导出终止失败

C:\Documents and Settings\Administrator>exp userid=system/system file=c:\exp_oth
er_user_table.dmp wner=user1 --注:深入证明,发现仅留owner选项,即导出user1用户所有对象.

Export: Release 10.2.0.3.0 - Production on 星期四 6月 7 09:35:50 2012

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


连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集

即将导出指定的用户...
. 正在导出 pre-schema 过程对象和操作
. 正在导出用户 USER1 的外部函数库名
. 导出 PUBLIC 类型同义词
. 正在导出专用类型同义词
. 正在导出用户 USER1 的对象类型定义
即将导出 USER1 的对象...
. 正在导出数据库链接
. 正在导出序号
. 正在导出簇定义
. 即将导出 USER1 的表通过常规路径...
. . 正在导出表                          TABLES导出了           0 行
. 正在导出同义词
. 正在导出视图
. 正在导出存储过程
. 正在导出运算符
. 正在导出引用完整性约束条件
. 正在导出触发器
. 正在导出索引类型
. 正在导出位图, 功能性索引和可扩展索引
. 正在导出后期表活动
. 正在导出实体化视图
. 正在导出快照日志
. 正在导出作业队列
. 正在导出刷新组和子组
. 正在导出维
. 正在导出 post-schema 过程对象和操作
. 正在导出统计信息
成功终止导出, 没有出现警告。

C:\Documents and Settings\Administrator>exp userid=user2/system file=c:\exp_othe
r_user_table.dmp wner=user1 --结论:用user2想导出user1的对象,须具有dba权限

Export: Release 10.2.0.3.0 - Production on 星期四 6月 7 09:36:15 2012

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


连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
EXP-00032: 非 DBA 不能导出其他用户
EXP-00000: 导出终止失败



C:\Documents and Settings\Administrator>exp userid=user2/system file=c:\exp_othe
r_user_table.dmp  tables=tables --结论:不加选项owner,留选项tables,导出时会在userid用户下查找tables指定的表是否存在.

Export: Release 10.2.0.3.0 - Production on 星期四 6月 7 09:39:03 2012

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


连接到: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集

即将导出指定的表通过常规路径...
EXP-00011: USER2.TABLES 不存在 --可以佐证上述结论,它会找user2用户下面的tables表,事实我们想导出user1用户下面的tables表
导出成功终止, 但出现警告。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-732111/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9240380/viewspace-732111/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值