oracle 之 基础操作

//删除存在的表空间及数据

drop tablespace TS_YYGL including contents and datafiles
若是出现了提示 错误 导致无法全部删除,那么就执行以下语句可以得到那些表有主键相关,再执行就可以
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 = 'TS_YYGL');

'ALTERTABLE'||OWNER||'.'||TABLE_NAME||'DROPCONSTRAINT'||CONSTRAINT_NAME||';'

1。“导出查询结果” 可以导出各种形式,包括了excel

2.“导出查询结果” --“复制到剪贴板” 将信息 复制到 命令窗口中,这样比复制到sql执行窗口方便,主要是 set define off

//给存在的用户赋予表空间

alter user username  default tablespace userspace;

原文地址:https://www.cnblogs.com/zmztya/p/7093513.html