如何IMP存储在多TABLESPACE上的对象(IMP-00003 和 ORA-00959 问题的对应)

来源:百度文库 编辑:神马文学网 时间:2024/04/29 08:04:51

如何IMP存储在多TABLESPACE上的对象(IMP-00003 和 ORA-00959 问题的对应)

 上周在导入用户给的DUMP文件时,遇到IMP-00003 ORA-0095问题,解决过程整理如下: 源数据库中有一张照片表,其中lob字段独立于用户缺省表空间zhxt_data,单独存放在zhxt_lob中,表结构如下:SQL> create table RY_RXZP
  2  (
  3    RYBH      VARCHAR2(20),
  4    RXZP      blob
  5  )
  6  lob(rxzp) store as(tablespace zhxt_lob disable storage in row nocache); 
------------------------------- 
从源数据库中导出数据C:\oracle\product\9.2\bin>exp njgajwpt/njgajwpt@ora9 file=d:\temp\lob.dmp tables=ry_rxzp Export: Release 9.2.0.1.0 - Production on 星期一 9月 11 15:25:26 2006Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集即将导出指定的表通过常规路径 ...
. . 正在导出表                    RY_RXZP               5 行被导出
在没有警告的情况下成功终止导出。------------------------------- 
导入到目标数据库 目标数据库用户的缺省表空间是njga_jwpt,没有使用其他表空间 C:\oracle\product\9.2\bin>imp njgajwpt/njgajwpt@pc609_ora9 file=d:\temp\lob.dmp ignore=y Import: Release 9.2.0.1.0 - Production on 星期一 9月 11 15:31:57 2006Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production经由常规路径导出由EXPORT:V09.02.00创建的文件
已经完成ZHS16GBK字符集和AL16UTF16 NCHAR 字符集中的导入
. 正在将NJGAJWPT的对象导入到 NJGAJWPT
IMP-00017: 由于 ORACLE 的 959 错误,以下的语句失败
 "CREATE TABLE "RY_RXZP" ("RYBH" VARCHAR2(20), "RXZP" BLOB)  PCTFREE 10 "
 "PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELI"
 "ST GROUPS 1) TABLESPACE "NJGA_JWPT" LOGGING NOCOMPRESS LOB ("RXZP") STORE A"
 "S  (TABLESPACE "ZHXT_LOB" DISABLE STORAGE IN ROW CHUNK 8192 PCTVERSION"
 " 10 NOCACHE  STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1))"
IMP-00003: 遇到 ORACLE 错误 959
ORA-00959: 表空间'ZHXT_LOB'不存在
成功终止导入,但出现警告。-------------------------------
解决方法
在目标数据库中创建该表的表结构,在导入时,使用 ignore=y 选项SQL> create table RY_RXZP
  2  (
  3    RYBH      VARCHAR2(20),
  4    RXZP      blob
  5  )
  6  lob(rxzp) store as(tablespace njga_jwpt_lob disable storage in row nocache);  
 
C:\oracle\product\9.2\bin>imp njgajwpt/njgajwpt@pc609_ora9 file=d:\temp\lob.dmp ignore=y Import: Release 9.2.0.1.0 - Production on 星期一 9月 11 16:12:14 2006Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.连接到: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production经由常规路径导出由EXPORT:V09.02.00创建的文件
已经完成ZHS16GBK字符集和AL16UTF16 NCHAR 字符集中的导入
. 正在将NJGAJWPT的对象导入到 NJGAJWPT
. . 正在导入表                  "RY_RXZP"               5行被导入
成功终止导入,但出现警告。 注:如果目标数据库中不希望将lob字段单独存放,而是与其他对象存放在缺省表空间中,在定义表结构时,不定义lob storage即可.