oracle常用sql

来源:互联网 发布:淘宝客服管理在哪里 编辑:程序博客网 时间:2024/06/14 04:01

 删除user

drop user ×× cascade

说明: 删除了user,只是删除了该user下的schema objects,是不会删除相应的tablespace的。

 删除tablespace

--删除空的表空间,但是不包含物理文件
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;