前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >支持alter table move 的数据类型 :raw blob clob

支持alter table move 的数据类型 :raw blob clob

作者头像
吹水老王
发布2022-05-17 16:39:56
6340
发布2022-05-17 16:39:56
举报
文章被收录于专栏:MySQL 8.0

结论: 支持alter table move 的数据类型 :raw blob clob  不支持的数据类型 :long 和 long raw 实践是检验真理的最佳方法! 测试过程 1.测试raw和blob类型 SQL> create table t_move (id raw(16),btype blob) tablespace users; Table created. SQL> insert into t_move values ('411FC41933DECA4BA6298877EB4446CF',null); 1 row created. 同一个表空间内move操作: SQL> alter table t_move move tablespace users; Table altered. SQL> select * from t_move; ID -------------------------------- BTYPE -------------------------------------------------------------------------------- 411FC41933DECA4BA6298877EB4446CF 1 row selected. 跨表空间的move操作: SQL> alter table t_move move tablespace test; Table altered. SQL> select * from t_move; ID -------------------------------- BTYPE -------------------------------------------------------------------------------- 411FC41933DECA4BA6298877EB4446CF 1 row selected. 成功。 实验证明 raw和blob类型支持move操作。 2.测试long和long raw类型 SQL> alter table t_move add (high_value long); Table altered. SQL> insert into t_move values ('23E23F4E23C97D4AAAB781A9F8F085F2',null,'long')   2  / 1 row created. SQL> alter table t_move move tablespace test;  alter table t_move move tablespace test * ERROR at line 1: ORA-00997: illegal use of LONG datatype SQL> alter table t_move move tablespace users; alter table t_move move tablespace users * ERROR at line 1: ORA-00997: illegal use of LONG datatype 失败 实验证明 long类型不能直接move。 SQL> alter table t_move add (high long raw); alter table t_move add (high long raw)                         * ERROR at line 1: ORA-01754: a table may contain only one column of type LONG 这里注意:long raw实验也是long类型的列,一张表内只能允许一个long类型的列。 所以,删除原long列再添加新long raw列。 SQL> alter table t_move drop column high_value; Table altered. SQL> alter table t_move add (high long raw); Table altered. SQL> desc t_move  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------  ID                                                 RAW(16)  BTYPE                                              BLOB  HIGH                                               LONG RAW SQL> alter table t_move move tablespace test; alter table t_move move tablespace test * ERROR at line 1: ORA-00997: illegal use of LONG datatype 失败 实验证明 long raw类型不能直接move。 SQL> alter table t_move drop column high; Table altered. SQL> alter table t_move add (tc clob); Table altered. SQL> desc t_move  Name                                      Null?    Type  ----------------------------------------- -------- ----------------------------   ID                                                RAW(16)  BTYPE                                              BLOB  TC                                                 CLOB SQL> alter table t_move move tablespace users; Table altered. 成功 实验证明 clob类型支持直接move。 SQL> drop table t_move; Table dropped. 实验结束。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2015-09-02,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
图像处理
图像处理基于腾讯云深度学习等人工智能技术,提供综合性的图像优化处理服务,包括图像质量评估、图像清晰度增强、图像智能裁剪等。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档