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个被修改过的表。

相关文章:

  • 2022-03-10
  • 2021-07-01
  • 2022-12-23
  • 2021-11-30
  • 2021-08-12
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-15
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案