IMP-00013 问题及解决方法

昨天在生产上出现了一个问题,客户的dba发现,使用临时用户导出了一个dump之后,无法导入测试环境,报错是常见的

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


这个问题一般碰到的处理方法就是在 给目标环境的用户赋予dba权限,或者细粒度一些,赋予imp_full_database的权限,就能解决

我检查了一下目标环境,是11g的库
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.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

SQL> show parameter insta
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
active_instance_count integer
cluster_database_instances integer 1
instance_groups string
instance_name string TEST02
instance_number integer 0
instance_type string RDBMS
open_links_per_instance integer 4
parallel_instance_group string

parallel_server_instances integer 1


SQL> select * from dba_sys_privs where grantee = 'TESTAPP';
GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
TESTAPP ON COMMIT REFRESH NO
TESTAPP CREATE TABLE NO
TESTAPP CREATE TYPE NO
TESTAPP GLOBAL QUERY REWRITE NO
TESTAPP QUERY REWRITE NO
TESTAPP CREATE ANY SYNONYM NO
TESTAPP UNLIMITED TABLESPACE NO

7 rows selected.
--查看用户的role,已经有dba了。
SQL> select * from dba_role_privs where grantee ='TESTAPP';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
TESTAPP TIGER_ROLE NO YES
TESTAPP TESTAPP_SEL YES NO
TESTAPP TESTAPP_ALL YES NO
TESTAPP DBA NO NO


查看其它的dba用户,发现default字段是YES,查看metalink ID 949279.1,里面也给出了类似问题的解决方法。
SQL> select * from dba_role_privs where grantee ='N1';


GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
N1 DBA NO YES

CAUSE

The granted roles are not activated (DEFAULT_ROLE is NO).

SOLUTION

First activate the roles with:

SQL> alter user usr001 default role all;

再次尝试。
SQL> ALTER USER TESTAPP DEFAULT ROLE ALL;
User altered.

激活后,再次验证,发现dba权限已经default了。

SQL> select * from dba_sys_privs where grantee = 'TESTAPP';


GRANTEE PRIVILEGE ADM
------------------------------ ---------------------------------------- ---
TESTAPP ON COMMIT REFRESH NO
TESTAPP CREATE TABLE NO
TESTAPP CREATE TYPE NO
TESTAPP GLOBAL QUERY REWRITE NO
TESTAPP QUERY REWRITE NO
TESTAPP CREATE ANY SYNONYM NO
TESTAPP UNLIMITED TABLESPACE NO
7 rows selected.

SQL> select * from dba_role_privs where grantee ='TESTAPP';


GRANTEE GRANTED_ROLE ADM DEF
------------------------------ ------------------------------ --- ---
TESTAPP TIGER_ROLE NO YES
TESTAPP TESTAPP_SEL YES YES
TESTAPP TESTAPP_ALL YES YES
TESTAPP DBA NO YES

再次导入,就没有碰到问题。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值