oracle imp ora 00959,快速解决IMP中的ORA-00959

快速解决IMP中的ORA-00959

用IMP向测试库导入DMP时,又遇到了ORA-00959表空间不存在的问题。

一般的解决方法:

1.先建表,在导入dmp时加ignore=y 的参数。

2.新建对应的表空间

3.使用expdp从新导出,在impdp时用REMAP_TABLESPACE

无论用那种方法都比较麻烦,都需要耗费一定的工作量。如果在oracle10g中,

采用重命名表空间的方法,可以快速解决这个问题。

SQL> alter tablespace &old_tbsname  rename to &new_tbs_name;

如当前用户默认的表空间为TEST,现在改为需要的表空间YWDBS

SQL>alter tablespace TEST  rename to YWDBS;

/oracle$imp TEST/TEST file=dev_bak_20110702.dmp tables=PRPDRISK statistics=none

Import: Release 10.2.0.4.0 - Production on Wed Jul 6 09:39:25 2011

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V10.02.01 via conventional path

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

import done in ZHS16GBK character set and AL16UTF16 NCHAR character set

. importing DEV's objects into REPORTTEST

. importing DEV's objects into REPORTTEST

IMP-00017: following statement failed with ORACLE error 959:

...

IMP-00003: ORACLE error 959 encountered

ORA-00959: tablespace 'YWDBS' does not exist

Import terminated successfully with warnings.

SQL> alter tablespace TEST  rename to YWDBS;

重命名表空间后,会在alert.log中看到如下信息:Tablespace 'TEST' is renamed to 'YWDBS'.

Completed: alter tablespace TEST  rename to YWDBS

重命名表空间后,dmp可以顺利导入

/oracle$imp TEST/TEST file=dev_bak_20110702.dmp tables=PRPDRISK statistics=none

Import: Release 10.2.0.4.0 - Production on Wed Jul 6 10:05:08 2011

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Export file created by EXPORT:V10.02.01 via conventional path

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

import done in ZHS16GBK character set and AL16UTF16 NCHAR character set

. importing DEV's objects into REPORTTEST

. importing DEV's objects into REPORTTEST

. . importing table                     "PRPDRISK"         68 rows imported

Import terminated successfully without warnings.

为了管理上的规范,在导入成功后可以在将表空间名该回去。

IMP中的ORA-00959一般发生在有CLOB字段的表上。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值