删除表空间语句如下:

--删除空的表空间,但是不包含物理文件
drop tablespace tablespace_name;
--删除非空表空间,但是不包含物理文件
drop tablespace tablespace_name including contents;
--删除空表空间,包含物理文件
drop tablespace tablespace_name including datafiles;
--删除非空表空间,包含物理文件
drop tablespace tablespace_name including contents and datafiles;
--如果其他表空间中的表有外键等约束关联到了本表空间中的表的字段,就要加上CASCADE CONSTRAINTS
drop tablespace tablespace_name including contents and datafiles CASCADE CONSTRAINTS;

但实际情况并不是那么简单。当然啦,oracle嘛,跟java一样,总会比较折腾,都习惯了。如果顺风顺水,反而不正常。

以下是真实操作记录,一切尽在不言中:

SQL> drop tablespace sde_tbs including contents and datafiles;
drop tablespace sde_tbs including contents and datafiles
*
1 行出现错误:
ORA-29857: 表空间中存在域索引和/或次级对象


SQL> drop user sde cascade;
drop user sde cascade
*
1 行出现错误:
ORA-01940: 无法删除当前连接的用户


SQL> select username,sid,serial# from v$session where username='SDE';

USERNAME SID SERIAL#
------------------------------ ---------- ----------
SDE 202 65426
SDE 581 30637

SQL> alter system kill session'202,65426';

系统已更改。

SQL> alter system kill session'581,30637';

系统已更改。

SQL> drop user sde cascade;

用户已删除。

SQL> drop tablespace sde_tbs including contents and datafiles;

表空间已删除。

SQL>

参考文章:
​oracle 删除表空间及数据文件方法