IMP-00013: only a DBA can import a file exported by another DBA解决

129 篇文章 7 订阅

问题描述

[oracle@aud oradata]$ imp aud/xxxx file=/u01/app/oracle/oradata/audit_log.dmp tables=audit_log

Import: Release 11.2.0.4.0 - Production on Wed Jun 3 10:54:17 2020

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path
IMP-00013: only a DBA can import a file exported by another DBA
IMP-00000: Import terminated unsuccessfully

问题原因

查询错误号IMP-00013是因为当前用户aud不具有导入由其他用户导出数据的权限,因为audit_log.dmp在源库是由sys用户导出的,在目标库需要用aud导入。

解决办法

  • 方法1,使用DBA用户导入,添加fromuser和touser参数(未验证)
$ imp \'aud/xxxx as sysdba\' =/u01/app/oracle/oradata/audit_log.dmp tables=audit_log fromuser=sys touser=aud ignore=y log=imp.log
  • 方法2,赋予该用户imp_full_database的权限
SQL> grant imp_full_database to aud;

注:如果源DB中USER01用户只有exp_full_database权限,即使只是导出了自己的表,在导入时也必须要有imp_full_database的权限。

[oracle@aud oradata]$ imp nsfcaud/nsfcaud_rac11g file=/u01/app/oracle/oradata/audit_log.dmp tables=audit_log

Import: Release 11.2.0.4.0 - Production on Wed Jun 3 11:05:45 2020

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V11.02.00 via conventional path

Warning: the objects were exported by SYS, not by you

import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
export client uses AL32UTF8 character set (possible charset conversion)
. importing SYS's objects into AUD
. importing SYS's objects into AUD
. . importing table                    "AUDIT_LOG"   22491788 rows imported
Import terminated successfully without warnings.

收回权限

SQL> revoke exp_full_database,imp_full_database from XXXX;
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值