ORA-00997: illegal use of LONG datatype

http://www.orafaq.com/forum/t/21725/0/

http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:588223421081

Move doesnt support Long datatypes.
You can either convert them to LOBs and then move or do exp/imp of the table with the LONG column
or create the table with LONG in the locally managed tablespace and copy the data from the old table using PL/SQL loop
or CTAS with to_lob in the locally managed tablespace..

SQL> desc t
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 X                                                  NUMBER(38)
 Y                                                  LONG

SQL> alter table t move;
alter table t move
*
ERROR at line 1:
ORA-00997: illegal use of LONG datatype

-- You can create the new table in the Locally Managed tablespace

SQL> create table t_lob  tablespace users as select x,to_lob(y) y from t;

Table created.

SQL> desc t_lob
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 X                                                  NUMBER(38)
 Y                                                  CLOB

-- Now you can drop the old table and rename the new table

-- Or you can move the LOB table to the locally managed tablespace

SQL> alter table t_lob move;

Table altered.

-- Or you can precreate the new table with LONG in the locally managed tablespace and do exp/imp

-- export the Long table
SQL> !exp / file=t.dmp tables=t compress=n

Export: Release 9.2.0.3.0 - Production on Tue Mar 2 09:32:30 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to: Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
. . exporting table                              T          2 rows exported
Export terminated successfully without warnings.

-- just rename the old table for reference purposes
SQL> rename t to tbak;

Table renamed.

-- Create the LONG table in the locally managed tablespace

SQL> create table t(x int,y long) tablespace users;

Table created.

-- now import the data

SQL> !imp / file=t.dmp tables=t ignore=y         

Import: Release 9.2.0.3.0 - Production on Tue Mar 2 09:33:43 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Connected to: Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production

Export file created by EXPORT:V09.02.00 via conventional path
import done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
. importing OPS$ORACLE's objects into OPS$ORACLE
. . importing table                            "T"          2 rows imported
Import terminated successfully without warnings.

SQL> desc t
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 X                                                  NUMBER(38)
 Y                                                  LONG


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值