由于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

ORA-22868: 具有 LOB 的表包含有位于不同表空间的段的更多相关文章

  1. 【从翻译mos文章】不再用par file如果是,export or import 包含大写和小写表名称表

    不再用par file如果是,export or import 包含大写和小写表名称表 参考原始: How to Export or Import Case Sensitive Tables With ...

  2. MySQL中 如何查询表名中包含某字段的表

    查询tablename 数据库中 以"_copy" 结尾的表 select table_name from information_schema.tables where tabl ...

  3. [Oracle]包含了MVIEW的表领域,在进行导出,表领域改名,再导入后,MVIEW会消失不见。

    包含了MVIEW的表领域,在进行导出,表领域改名,再导入后,MVIEW会消失不见. 测试环境12.1.0.2 =================步骤1:数据的准备 [oracle@db12102 ad ...

  4. mysql中,创建包含json数据类型的表?创建json表时候的注意事项?查询json字段中某个key的值?

    需求描述: 在mysql数据库中,创建包含json数据类型的表.记录下,在创建的过程中,需要注意的问题. 操作过程: 1.通过以下的语句,创建包含json数据类型的表 mysql> create ...

  5. MySQL中 如何查询表名中包含某字段的表 ,查询MySql数据库架构信息:数据库,表,表字段

    --查询tablename 数据库中 以"_copy" 结尾的表 select table_name from information_schema.tables where ta ...

  6. oracle 查看表是否存在、包含某字段的表、表是否包含字段

    表是否存在: select count(*) from user_tables where table_name = #{tablename} 包含某个字段的表 select * from user_ ...

  7. MySQL 查询某个数据库中所有包含数据记录的表名

    MySQL 查询某个数据库中所有包含数据记录的表名 有时根据实际应用需要,需要对数据进行备份. 如果一个数据库中有很多数据表,但是只想备份包含数据记录的那些表数据(空表不做数据备份). 如果通过如下S ...

  8. 包含LOB_Data列的表删除大量数据后表及数据库文件的收缩

    最近有一张表(内含varchar(max)字段),占用空间达到240G,删除历史数据后几十万条后,空间并未得到释放. 然后用DBCC CLEANTABLE(0,tb_name,100)来释放删除记录后 ...

  9. C/C++编译和链接过程详解 (重定向表,导出符号表,未解决符号表)

    详解link  有 些人写C/C++(以下假定为C++)程序,对unresolved external link或者duplicated external simbol的错误信息不知所措(因为这样的错 ...

随机推荐

  1. JSF dataTable 添加列 动态创建数据表 列

    @Named @ViewScoped public class LiveRangeService implements Serializable { private List< Map<S ...

  2. python标准模块(二)

    本文会涉及到的模块: json.pickle urllib.Requests xml.etree configparser shutil.zipfile.tarfile 1. json & p ...

  3. mysql forget root password

    http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password MySQL - ...

  4. spring--学习之IOC DI

    2.1.1  IoC是什么 Ioc-Inversion of Control,即"控制反转",不是什么技术,而是一种设计思想.在Java开发中,Ioc意味着将你设计好的对象交给容器 ...

  5. BZOJ4004: [JLOI2015]装备购买

    总之就是线性基那一套贪心理论直接做就好了. 然而加强数据后很卡精度的样子. 于是重点在于这个特技:在整数模意义下搞. #include<cstdio> #include<algori ...

  6. git的基本操作

    今天给同事培训了一下git的使用流程,简单记录一下 1,基本概念, 远程库和本地库. 2, git clone git://url/*.git clone远程的代码库到本地 3. 创建本地分支 当前是 ...

  7. CentOS 6.3下部署LVS(NAT)+keepalived实现高性能高可用负载均衡

    一.简介 VS/NAT原理图: 二.系统环境 实验拓扑: 系统平台:CentOS 6.3 Kernel:2.6.32-279.el6.i686 LVS版本:ipvsadm-1.26 keepalive ...

  8. Axure7.0汉化方法

    下载汉化包 AxureRP7CN_汉化包.rar 首先退出正在运行中的 Axure (如果您正在使用). 将 汉化包.rar 文件解压, 得到 lang 文件夹,  然后将其复制到 Axure 安装目 ...

  9. Linux下的网络环境配置

  10. Mastering C# structs

    http://www.developerfusion.com/article/84519/mastering-structs-in-c/