第一步:删除过期用户
DROP USER colin CASCADE;
第二步:查询过期用户相关的表空间是否还有对象
SELECT OWNER, SEGMENT_NAME, SEGMENT_TYPE, TABLESPACE_NAME
FROM DBA_SEGMENTS
WHERE TABLESPACE_NAME IN
(SELECT TABLESPACE_NAME
FROM DBA_TABLESPACES
WHERE TABLESPACE_NAME LIKE '%COLIN%')
第三步:转移过期用户表空间上的对象到其他表空间
ALTER TABLE tab_colin MOVE TABLESPACE colin_song_tbs;
ALTER INDEX idx_tab_colin REBUILD TABLESPACE colin_song_idx_tbs;
第四步:查询无对象的表空间
SELECT 'DROP TABLESPACE ' || TABLESPACE_NAME ||
' INCLUDING CONTENTS AND DATAFILES;'
FROM DBA_TABLESPACES
WHERE NOT EXISTS (SELECT 12
FROM DBA_SEGMENTS
WHERE DBA_SEGMENTS.TABLESPACE_NAME =
DBA_TABLESPACES.TABLESPACE_NAME);
第五步:删除之 把上述查询出来的语句贴到文本编辑里检查下(PS:这里会包含一个temp的临时表空间一定要去掉啊)
SQL> drop tablespace STAT_FTFY_CHRGSTAY_DTBS including contents and datafiles;
Tablespace dropped
SQL> drop tablespace STAT_FTFY_CHRGNEW_WIXTBS including contents and datafiles;
Tablespace dropped
SQL> drop tablespace STAT_FTFY_CHRGSMR_MIXTBS including contents and datafiles;
Tablespace dropped
最后去看下你的系统空间应该释放了吧
阅读(2026) | 评论(0) | 转发(0) |