oracle bigfile tablespace的一个缺点

本文讨论了Oracle Bigfile Tablespace在RMAN备份时无法实现多进程并导致备份时间延长的问题,以及在尝试resize扩展时可能引起的会话阻塞。这种情况源于extent分配和datafile扩展操作在数据文件头块上的序列化。解决方案包括在业务空闲时进行resize或分批小量resize以减少阻塞时间。对于实时交易系统,建议使用普通表空间以避免类似问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

有套生产系统由于数据量比较大,当时图方便直接建成了bigfile tablespace,用起来也没啥不同,只是在RMAN备份的时候发现无法多进程来备份该表空间,导致备份时间稍长,虽觉不爽,但咬咬牙也就忍了。

但是,有天早上上班,发现表空间使用率有点高,于是resize扩了下,结果发现,库上有一堆的会话被阻塞。心慌慌。幸亏resize值不大,几秒钟过去。在我理解中,数据库在线resize数据文件理论上不应该存在阻塞的情况。后来想了想,估计是bigfile的原因。

在MOS上搜索了下"bigfile resize cause block session",果然找到了些文章,如:

Alter Tablespace Resize on Bigfile Tablespace Causes Sessions to Hang with 'Enq: TX - contention' and 'Buffer busy waits' (Doc ID 2089689.1)

有如下阐述:

This is expected behaviour.

If a tablespace has only one datafile, extent allocation will always wait while a tablespace is being resized. This is because extent allocations as well as datafile extend operations serialize on the header block of the datafile. If the tablespace has more than one datafile, then Oracle may be able to allocate the extent in another datafile without having to wait. Since a bigfile tablespace has only one datafile, extent allocations will wait if the tablespace is being resized.
This is an unfortunate issue with bigfile tablespaces.  

对于该问题,文章中不无无奈的推荐了两种方式:

1、业务空闲时候resize

2、可以resize,但是呢,分批做,每次resize一点点,这样的话,阻塞的时间可以控制在很短时间内。

---------------------------------------------------

目前数仓那边很多表空间用的都是bigfile ,但由于是管理类系统,倒是没有多大影响。但涉及实时交易的,今后还需注意,还是使用普通表空间了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值