ORACLE - 分割分区时,我还能同时读取其中的数据吗?
语句
- 假设我有一个按日期范围分区的模式(但没有子分区)
- 包含很多行
- 假设我在这个模式中有分区 P1在某个时刻
- ,假设我想将其拆分,因为分区充满了行,分割时间需要 1 到 3 秒
在分割期间,我可以:
- 仍然读取参考分区(例如 P1)中包含的数据吗?
- 仍然读取正在移动或已经移动到新分区中的数据分区已创建?
根据文档:
我没有在官方文档中找到任何说明: https://docs.oracle.com/cd/B13789_01/server.101/b10759/statements_3001.htm#sthref3944
https://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1008028
https://docs.oracle.com/database/121/VDBG/GUID-65E169AC-3224-405E-AD1D-9FBF4D5231BA.htm
https://docs.oracle.com/database/121/VDBG/GUID-6BB84952-7021-4CBA-91ED-180E0656E02B.htm#VDBG00303
但是,他们有时会提到锁。但是这个“锁”是避免只写还是也避免读/写?
在您要求自己测试之前:
通常的分割时间仍然不到一秒,但有时我们会遇到分割参考分区的问题。而且,我们的分裂时间是不可预测的。最后,我们并不总是读取该分区中的数据,因此我们需要插入新数据,从而填充尽可能多的分区,然后尝试拆分和读取,这是相当复杂的。
所以如果有人知道答案那就更好了
Statements
- let say I have a schema partitioned by range of date (but no subpartitions)
- let say I have partition P1 in this schema containing a lot of rows
- at some point, let say I want to split it
- as the partition is full of rows, split time takes up from 1 to 3 seconds
During the split period, can I:
- still read data contained in the reference partition (e.g. P1)?
- still read data moving OR already moved into the new partition created?
According to documentation:
I didn't find anything stated in the official documentation:
https://docs.oracle.com/cd/B13789_01/server.101/b10759/statements_3001.htm#sthref3944
https://docs.oracle.com/cd/E11882_01/server.112/e25523/part_admin002.htm#i1008028
https://docs.oracle.com/database/121/VLDBG/GUID-65E169AC-3224-405E-AD1D-9FBF4D5231BA.htm
https://docs.oracle.com/database/121/VLDBG/GUID-6BB84952-7021-4CBA-91ED-180E0656E02B.htm#VLDBG00303
However, they sometimes mention a lock. But does this "lock" avoid writing only or also for reading/writing ?
Before you ask to test it by myself:
The usual split time is still less than a second but we get, sometimes, an issue to split our reference partition. Also, our splitting time is unpredictable. Finally, we do not always read data in this partition, so we would need to insert fresh data and thus fill as much a partition and then try to split and read, which is quite complex.
So if anyone knows the answer, would be much more better
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在处理范围和日期,为什么要担心拆分分区呢?您可以使用间隔,每次添加新日期(日、周、月、季度、年)时,都会自动添加 PARTITION,从而减少拆分分区的需要。
下面是每日分区的设置以及一些工具,用于重新管理分区并删除旧分区(如果您希望在一段时间后删除旧分区)。
If you are dealing with range and dates why worry about splitting PARTITIONS? You can use intervals and every time a new date (day, week, month, quarter, year) is added the PARTITION will be automatically added therefore alleviating the need to split partitions.
Below is a setup for a daily PARTITION and some tools to renane the PARTITION and drop older PARTITION if you wanted them dropped after a certain period.