zoukankan      html  css  js  c++  java
  • ORA-22868: 具有 LOB 的表包含有位于不同表空间的段

    由于lob对象引起的表空间无法删除。本来是要删除DMS表空间,但是上面有LOB对象,而且表却是在别的表空间DMS4上。解决的办法就是将这些lob移动到DMS4表空间。
    下面是解决过程


    删除用户时报错:



    drop tablespace dms


    第 1 行出现错误:
    ORA-01549: 表空间非空, 请使用 INCLUDING CONTENTS 选项


    SQL> drop tablespace dms including contents and datafiles;
    drop tablespace dms including contents and datafiles
    *
    第 1 行出现错误:
    ORA-22868: 具有 LOB 的表包含有位于不同表空间的段


    检查过程

    检查这个表空间上的Lob对象
    SQL> select owner, table_name, column_name, tablespace_name
        from dba_lobs
        where tablespace_name = 'DMS';


    已选择6行。


    另外再检查下约束有没有问题(因为这个问题常见,所以一并检查了下)。


    SQL> select 'alter table '||owner||'.'||table_name||' drop constraint '||constraint_name||' ;'
       from dba_constraints
        where constraint_type in ('U', 'P')
           and (index_owner, index_name) in
              (select owner, segment_name
                 from dba_segments
                 where tablespace_name = 'DMS');


    未选定行


    SQL>




    解决过程:



    下面是我写的脚本,这个脚本可以生成要用的语句。


           
    select 'alter table ' || xtable || ' move tablespace DMS4 lob' || '(' ||
           column_name || ') store as ( tablespace DMS4);'
      from (select xtable, wmsys.wm_concat(column_name) column_name
              from (select owner || '.' || table_name xtable,
                           column_name,
                           tablespace_name
                      from dba_lobs
                     where tablespace_name = 'DMS')
             group by xtable)


    结果如下:


    alter table DMS4.xxxx move tablespace DMS4 lob(ERROR_TEXT) store as ( tablespace DMS4);

    ^………………


    取消dms4在dms表空间上的限额,防止再出类似问题。


    alter user dms4 quota 0 on dms;

    原文地址:http://blog.csdn.net/bamuta/article/details/12492783

  • 相关阅读:
    转:5个AJAX Loading动画图标生成器
    小练习:图片轮播jQuery版
    找不同,在一定范围内找出不同数最小的数组。
    一个Hibernate的Hello World, 基于Hibernate 4.0
    队列的操作, 计算要出队某个数需要移动的距离.
    使用反射操作私有(Private)方法和属性
    求由色子组成的立方体的5个可见面(底部不算)中所有数字最小之和.
    动态代理的简单实例.
    设计模式:Java的代理模式.
    Java的反射 基础+简单复制对象实例
  • 原文地址:https://www.cnblogs.com/huacw/p/4089592.html
Copyright © 2011-2022 走看看