Oracle 截断带/不带删除存储

发布于 2024-08-16 14:54:44 字数 282 浏览 6 评论 0原文

试图获得更多关于此的信息,但想我只是问一下......我尝试使用删除存储在 Oracle 10g 上执行表截断,但结果并不完全符合我的预期。

基本上,相关表有超过 3000 万条记录,并为其分配了超过 3Gb,但不知何故为其分配的空间似乎仍在使用。有没有办法真正删除已使用的分配空间,或者我是否以错误的方式处理它?

===编辑====

我的错...我指的是物理磁盘空间,就数据文件大小而言...目前我们的导出/备份总计约为 13GB,因此这里的目的是缩小当我们导出到文件进行备份时截断数据的实际文件。

Tried to get a bit more info on this, but figured I'd just ask.... I attempted to perform a table truncate on Oracle 10g with the drop storage, however the results aren't entirely what I was expecting.

Basically, the table in question had over 30 million records and over 3Gb allocated for it, but somehow the space allocated for it still appears to be used. Is there a way to actually drop the allocated space used, or am I going about it the wrong way?

===EDIT====

My bad...I was referring to physical disk space, in terms of the datafile size... At the moment our export / backup amounted to about 13GB, so the intention here was to shrink the actual file in the process of truncating the data when we export to a file for backup.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

鹿! 2024-08-23 14:54:44

您没有确切地说出截断表格时预期会发生什么。
请记住,如果您从表/索引中取消分配存储,那么它只会作为可用空间返回到表空间。从操作系统的角度来看,磁盘上使用的空间不会变小。因此,虽然在需要更多空间时可以将表空间设置为“自动扩展”,但在释放空间时它不会自动收缩。

You don't exactly say what you were expecting to happen when you truncated the table.
Remember that if you de-allocate the storage from a table/index then it's just returned to the tablespace as free-space. The space used on disk from the operating system's perspective isn't going to get any smaller. So whilst a tablespace can be set to "auto extend" when more space is required, it does not auto-shrink when space is freed.

花辞树 2024-08-23 14:54:44

您使用什么样的范围管理和segment_space_management?

select tablespace_name from user_segments
  where segment_name = 'T'   ---T here would b your table name

TABLESPACE_NAME
------------------------------
TS_USERS_01

sql > select TABLESPACE_NAME, EXTENT_MANAGEMENT, SEGMENT_SPACE_MANAGEMENT
  2     from dba_tablespaces where tablespace_name = 'TS_USERS_01';

TABLESPACE_NAME                EXTENT_MAN SEGMEN
------------------------------ ---------- ------
TS_USERS_01                    LOCAL      AUTO

您使用的是字典管理的表空间还是带有系统分配段的本地管理的表空间?

What kind of extent management and segment_space_management are you using?

select tablespace_name from user_segments
  where segment_name = 'T'   ---T here would b your table name

TABLESPACE_NAME
------------------------------
TS_USERS_01

sql > select TABLESPACE_NAME, EXTENT_MANAGEMENT, SEGMENT_SPACE_MANAGEMENT
  2     from dba_tablespaces where tablespace_name = 'TS_USERS_01';

TABLESPACE_NAME                EXTENT_MAN SEGMEN
------------------------------ ---------- ------
TS_USERS_01                    LOCAL      AUTO

Are you using dictionary managed tablespaces or locally managed tablespaces with system allocated segments ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文