Ora 11g 中的数据库分区
我需要从系统参数中选择需要创建分区的日期,然后需要使用存储过程创建分区。任何指导。 使用的是Oracle 11g。
I need to select a date from system param for which the partition needs to be created and then need to create the partition using a stored Procedure. ANy guidance.
Oracle 11g is being used.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Ronan,
也许你可以采用区间划分?您使用的是 11g,因此可以使用间隔分区。当插入数据并且所需的分区尚不可用时,这会在所需的基础上生成分区。
Ronan,
maybe you can adopt interval partitioning? You are using 11g so interval partitioning is available to you. This generates partitions on an is needed base, when the data is inserted and the partition that is needed is not yet available.
您可以使用动态 PL/SQL,例如:
You could use dynamic PL/SQL something like:
我同意@ik_zelf 的答案,如果您要在日期上实现分区,并且想要在日期到来时进行分区,请进行间隔分区。也不需要存储过程。
这是Oracle 11g 中的一个新特性。当插入记录时,它会为特定间隔创建分区,因此您不必担心新分区。新的分区将被赋予一个系统名称,如 SYS_PXXX。
这就是间隔分区的方式。
间隔分区与早期的分区无关,间隔之前创建的最后一个分区将是这里的过渡点。
您也可以使用
ALTER TABLE 方式来添加分区。
I agree with the answer from @ik_zelf, if you are going to implement a partiotion over date, and want to make as and when the date comes, Go for interval Partioning. There would be no need for a Stored Procedure as well.
Its a new feature in the Oracle 11g. Which Creates partiotioning for particular intervals when the records are inserted, so you need not worry on the new partitions. The new Partiotions would be given a system name as well like SYS_PXXX..
This is how go for Interval Partition..
Interval Partition has nothing to do with the earlier Partition, the last partition created before interval would be the transition point here.
You can also go with the
ALTER TABLE way to ADD PARTITION as well..