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

  • 相关阅读:
    v-distpicker 一个好用的三级联动的插件
    截取url参数
    position: relative 和 position: absoution 的详解
    自己封装一个下拉列表
    临界区访问的两个类:临界区类,共享临界区类——多平台版本
    临界区访问的两个类:临界区类,共享临界区类
    beyond compare 4.2.9桌面右键集成的问题修复
    递归创建、删除目录的几个函数
    读取资源中的GIF文件相应像素宽高度
    在关于对话框中,自动获取当前程序的版本,以显示
  • 原文地址:https://www.cnblogs.com/huacw/p/4089592.html
Copyright © 2011-2022 走看看