zoukankan      html  css  js  c++  java
  • Oracle数据库转移表

    1. 对于普通的表

         alter table table_name move tablespace new_space_name;

         后重建索引

         alter index index_name rebuild [tablespace new_space_name] ;

          即可完成表的迁移空间的操作。

    2. 对于含有Lob字段的表

         因为在建立含有lob字段的表时,oracle会自动为lob字段建立两个单独的segment,一个用来存放lob数据,另一个用来存放lob索引,并且它们都会存储在对应表指定的表空间中。

         可以通过   select segment_name,segment_type,tablespace_name   from dba_segments   where owner=userid;

        查询,会发现有

      SYS_IL0000026875C00002$$ LOBINDEX 
      SYS_LOB0000026875C00001$$ LOBSEGMENT

        在移动表到新空间时,同时也要将lobindex和lobsegment移动到新的表空间。

          alter table table_name move tablespace new_space_name lob(lob_column) store as(tablespace new_space_name );

        然后重建此表的其他索引就可。

  • 相关阅读:
    lambda表达式
    You can't specify target table 't_mail_marketing' for update in FROM clause
    从对象list中获取对象属性list
    枚举缓存
    Solr语法
    通过Telnet查询注册服务
    日志查询
    Maven 屏蔽静态文件
    抽奖
    随机码生成方法
  • 原文地址:https://www.cnblogs.com/cthulhu/p/2441991.html
Copyright © 2011-2022 走看看