zoukankan      html  css  js  c++  java
  • oracle 删除表空间错误 提示:ora02429:无法删除用于强制唯一/

    sql>drop tablespace zfxfzb;
    ora-01549:表空间非空,请使用INCLUDING CONTENTS 选项
    sql>drop tablespace zfxfzb INCLUDING CONTENTS and datafiles;
    ora-00604:递归sql层1出现错误。
    ora-02429:无法删除用于强制唯一/主键的索引。
    sql>drop tablespace zfxfzb including contents cascade constraints;
    ora-00604:递归sql层1出现错误。
    ora-02429:无法删除用于强制唯一/主键的索引。
    sql>select segment_name,partition_name,tablespace_name from   dba_extents    where tablespace_name=upper('zfxfzb');

    显示出2个表的主键的表空间是:'zfxfzb'.
    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 = upper('zfxfzb'));

    显示结果如下:
    alter table TEST.SYS_CODE drop constraint PK_CODEID ;
    alter table TEST.KS_WPYP_PWPLGX drop constraint PK_KS_WPYP_PWPLGX ;
    执行以上2条显示的结果
    sql>alter table TEST.SYS_CODE drop constraint PK_CODEID ;
    表已经更改
    sql>alter table TEST.KS_WPYP_PWPLGX drop constraint PK_KS_WPYP_PWPLGX ;
    表已经更改
    sql>drop tablespace zfxfzb;


    表空间已经丢弃。
    记得修改上面2个被修改过的表。

  • 相关阅读:
    第10组 Beta冲刺(2/5)
    第10组 Beta冲刺(1/5)
    第10组 Alpha事后诸葛亮
    3月7-第十次机试课记录
    3月5-第九次机试课记录
    3月2-第八次机试课记录
    3月1-第六次机试课记录
    2月28-第五次机试课记录
    STL
    2月27-第四次机试课记录
  • 原文地址:https://www.cnblogs.com/emanlee/p/2213650.html
Copyright © 2011-2022 走看看