重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 343|回复: 0
打印 上一主题 下一主题

[Oracle] How To Shrink A Temporary Tablespace in 11G

[复制链接]
跳转到指定楼层
楼主
发表于 2024-10-20 11:03:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
方法:
Large sort operations can cause temporary tablespaces to grow very large and as such there may be a need to 'downsize' after such operations

Until Oracle 11g there was no SQL command to release the unused allocated temporary space.

One workaround for this problem is to create a new empty temporary tablespace with a smaller size, assign this new tablespace to the users and then drop the old tablespace.
   The disadvantage of this procedure is that it requires that no active sort operations are happening within the old temporary tablespace while it is being dropped.

In Oracle 11g, a new feature was added that can be used to shrink temporary tablespaces. This command can be used to shrink only locally managed temporary tablespaces :



ALTER TABLESPACE tablespace SHRINK SPACE | TEMPFILE tempfile_name [KEEP size];


The SHRINK SPACE clause allows a user to shrink a temporary tablespace, whereas SHRINK TEMPFILE allows the shrink of a temporary file.

The optional KEEP clause defines the lower bound that a tablespace can be shrunk to. It is the opposite for MAXSIZE for auto extensible tablespace.
If it is not specified, the system will try to shrink as much as possible, as long as the other storage attibutes are satisfied.
Otherwise, shrink will stop once the tablespace/tempfile already reaches the size specified through the KEEP option.   

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-25 00:04 , Processed in 0.091607 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表