Oracle带blob字段移动表空间

来源:互联网 发布:路由选择算法分类 编辑:程序博客网 时间:2024/04/29 08:14

Oracle表移动表空间:
alter table tb_name move tablespace tbs_name;
使用上面语句对表做空间迁移时,只能移动非lob字段以外的数据,如果要同时移动lob字段数据,必需改用下面的语句才行:
alter table tb_name move tablespace tbs_name lob (col_lob1,col_lob2) store as(tablesapce tbs_name);

建立表空间,赋予表空间权限。
create tablespace tablespace_lob datafile 'd:/xxx/lob.dbf' size 100M autoextend on;//所有表的lob字段都用一个专用的lob表空间,导出导入数据时方便。
alter user bbb quota unlimited on tablespace_lob;//给bbb添加表空间权限。

使用exp和imp导出导入数据时,若含有blob字段,则imp过程中可能由于blob字段表空间不存在而报错。这时可以先检查源库中blob字段所在表空间名称,然后在目标库中建立同名表空间。数据导入完成后,可以使用上面语句移动blob数据到指定的表空间。