oracle - Oracle:范围-范围间隔分区/子分区
问题描述
我需要创建一个范围分区表:
IE
create table table1(item_id number(22), sys_entry_date timestamp default sysdate)
partition by range(sys_entry_date) interval(NUMTOYMINTERVAL(1,'YEAR'))
(partition p01 values less than (to_date('31-DEC-2016','DD-MON-YYYY')));
一些用于演示目的的插入:
---Should lie in the main partition's main subpartition (crnt_part) since the it's part of the latest records received.
insert into table1 values(1, sysdatetime);
---Should lie in the main partition's subpartition of default section (prev_part) since the it's 2 days older
insert into table1 values(1, sysdatetime-3);
insert into table1 values(1, sysdatetime-4);
---Would help us identify the yearly partitions (suggestive)
insert into table1 values(2, sysdatetime-1500);
insert into table1 values(3, sysdatetime-1200);
insert into table1 values(4, sysdatetime-800);
insert into table1 values(1, sysdatetime-400);
我想通过它实现以下目标:
- 年度分区;
- 年度内,基于 sys_entry_date 的子分区 2.a. 最近 2 天在 crnt_part 2.b 举行。保留在默认分区中,可能在 prev_part
感谢有人可以在这种特定情况下提供帮助。
解决方案
推荐阅读
- python - 无法在 Gcloud 上部署 Flask 应用程序:ModuleNotFoundError:没有名为“flask_bcrypt”的模块
- python - 如何删除在两列中具有重复值对的行?
- visual-studio - 解决方案使用 PackageReference,但在引用 packages.config 时出现编译错误
- python - 如何在 sklearn dbscan 中使用多核?
- javascript - 如何在反应自动建议中提交数据?
- asp.net - 错误请求失败,HTTP 状态 503 Service Unavailable only for specific report
- python - 使用 feedparser 检测重复的标题
- r - 如何使用 lm/glm 中 Y 值的所有三个结果重复三次实验结果创建回归?
- curl - 使用 Julia LibCurl Wrapper 的分段错误
- machine-learning - 套索回归 - 编码问题和寻求语法帮助