【问题标题】:release the physical space occupied by oracle tablespace after deleting back up table删除备份表后释放oracle表空间占用的物理空间
【发布时间】:2014-06-12 12:37:53
【问题描述】:

我是 oracle 新手,我正在努力删除 oracle 数据库上占用空间的表空间。

所以我面临这个问题:

在 oracle 表空间上创建了很多备份表。 我已从该表空间中删除了所有备份和临时表 但是这样做后表空间占用的空间并没有减少。

【问题讨论】:

  • 您是否已从表中删除或截断了数据?
  • 如果你放弃了,那么重复是A table still exists when dropped;如果您已删除;如果您已删除,则副本位于 DBA.SE dba.stackexchange.com/q/10514/5743
  • 我已经从表空间中删除了临时表和备份表。如果我从表中删除大行,是否没有机会获得空间?
  • 删除行不会释放空间,如果您想立即释放操作系统中的空间,您应该继续“启用行移动”或执行卸载过程。

标签: oracle11g tablespace


【解决方案1】:

Option1-卸载过程

备份表空间=>删除表空间=>恢复相同的表空间可以帮助您解决问题:

expdp user/password directory=name_of_directory dumpfile=tablespace_dumpfile.dmp logfile=tablespace_dumpfile.log  tablespaces=tablespace_name;

drop tablespace tablespace_name including contents and datafiles;

impdp user/password directory=name_of_directory dumpfile=tablespace_dumpfile.dmp logfile=tablespace_dumpfile_import.log  tablespaces=tablespace_name;

Option2-Row moment 启用:

alter table mytable enable row movement;
alter table mytable shrink space;

接下来,检查对象占用的总大小:

select sum(bytes) from dba_segments where tablespace_name='tablespace_name';

现在,尝试调整数据文件的大小以释放空间:

alter database datafile 'datafile_location_file_name' resize <<< size from above select statement >>>;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-12
    • 2016-03-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多