加入收藏 | 设为首页 | 会员中心 | 我要投稿 汽车网 (https://www.0577qiche.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

oracle 删除表空间错误 提醒:ora-02429:无法删除用于强制唯一/

发布时间:2023-03-09 09:46:03 所属栏目:教程 来源:
导读: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;
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个被修改过的表。
 

(编辑:汽车网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章