In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Oracle creation
Automatic partition on a daily basis using the official interva function
The sub-partition is written normally, and the core is to configure the sub-partition template. Only after configuration can the configured partition be automatically created according to the column value.
Look directly at the source code
CREATE TABLE "CEN_NORM_PART". "EMP_TB_HIS_MZ_REG" ("GHRQ" VARCHAR2 (8 BYTE) NOT NULL,... "YWRQ" DATE NOT NULL)-enable partition (partition field) partition by range (YWRQ)-enable automatic partition (by day) interval (numtodsinterval (1) 'day'))-- enable subpartition (medical institution) subpartition BY LIST (YLJGDM) (--initialize partition partition t01_p_day_1 values less than (to_date (' 2012-12-31)) (SUBPARTITION t01_sp_yljg VALUES (default) -- configure the sub-partition template (enable by column value) to put the mechanism data alter table "CEN_NORM_PART". "EMP_TB_HIS_MZ_REG" set subpartition template (SUBPARTITION T01_YLJG_DIYI VALUES ('43720289561010311A1001'), SUBPARTITION T01_YLJG_DISI VALUES (' 4372043726101010211A1001'), SUBPARTITION T01_YLJG_DIWU VALUES ('43750151061010411A1001'), SUBPARTITION T01_YLJG_DIBA VALUES (' 43720037161011311A5211'), SUBPARTITION T01_YLJG_DIJIU VALUES ('43523202X61010311A1001') SUBPARTITION T01_YLJG_ZHONGXIN VALUES ('4372029166101010211A1001'), SUBPARTITION T01_YLJG_HONGHUI VALUES (' 43720358061010311A1001'), SUBPARTITION T01_YLJG_ERTONG VALUES ('43720270561010411A5191'), SUBPARTITION T01_YLJG_ZHONGYI VALUES ('43720057461010311A2101'), SUBPARTITION T01_YLJG_XIONGKE VALUES ('43720042761011311A5231'), SUBPARTITION T01_YLJG_JINGWEI VALUES ('43720191361011311A5201'), SUBPARTITION T01_YLJG_YANLIANGTIELU VALUES ('X2900708961011411A1001'), subpartition T01_DEFAULT VALUES (default)
! Notice the code that configures the subpartition template. I am here according to the value of the YLJGDM field partition, a total of 12 hospitals. 13 lines in the configuration, the default partition has been added to prevent mismatch with the agency code of 12 hospitals and unable to insert the problem.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.