解决方案

1、--生成删除主键约束的脚本

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 = 'GBOSV1');----GBOSV1换成要删除的表空间

2、根据第一步产生的select数据内容,挨个执行表中的内容,如下:

alter table GBOSV1.T_O_OPEN_DOOR_RECORD drop constraint PK_O_OPEN_DOOR_RECORD_COLS ;

3、执行删除表空间语句

drop tablespace gbosv1 including contents and datafiles;

更多推荐