Oracle中删除表空间中的表数据
我尝试使用命令从表空间中删除数据
删除用户 xyz 级联;
我发现用户被删除,但我的表空间的大小没有减少。 我的表空间中的数据是否已被删除?如果是,我该如何确认?为什么没有释放空间?
I tried to delete the data from tablespace using the command
DROP USER xyz CASCADE;
I found that user was dropped but size of my tablespace did not decreased.
Is my data fom the tablespace have been deleted? If yes, how can I confirm that? And why was the space not deallocated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Oracle 不会自动收缩数据文件,而数据文件正是表空间的组成部分。 Oracle 只是将用户 XYZ 的段(表、索引等)已使用的空间标记为空闲,以供其他用户的段使用。
SELECT * FROM DBA_OBJECTS WHERE OWNER = 'XYZ';
应表明用户 XYZ 不再拥有以下任何物理(表、索引、簇)或逻辑(序列、过程、包、触发器、类型)对象数据库。Oracle does not automatically shrink datafiles, which is what a tablespace is made of. Oracle simply marked the space which had been used by user XYZ's segments (tables, indexes, and the like) as free for some other user's segments to use.
SELECT * FROM DBA_OBJECTS WHERE OWNER = 'XYZ';
should demonstrate that user XYZ no longer owns any physical (tables, indexes, clusters) or logical (sequences, procedures, packages, triggers, types) objects in the database.在某些情况下,您可以使用以下命令缩小数据文件:
如果文件末尾没有数据,则可以缩小数据文件大小。请参阅“管理表空间”了解详情。
You can shrink datafile, under certain circumstances, with following command:
Datafile size can be reduced if there is no data at the end of file. See "Managing Tablespaces" for detailed information.